Code covered by the BSD License  

Highlights from
Algorithmic Trading with MATLAB - 2010

5.0

5.0 | 4 ratings Rate this file 261 Downloads (last 30 days) File Size: 1.87 MB File ID: #29489
image thumbnail

Algorithmic Trading with MATLAB - 2010

by Stuart Kozola

 

22 Nov 2010 (Updated 06 Dec 2010)

Files from the November 18, 2010 webinar.

| Watch this File

File Information
Description

Files used in the webinar - Algorithmic Trading with MATLAB Products for Financial Applications broadcast on November 18, 2010. This webinar can be viewed at http://www.mathworks.com/wbnr52491.

The download includes an additional demo, not shown in the webinar, that shows how to generate C-code from MATLAB.

Required Products Financial Toolbox
Global Optimization Toolbox
Optimization Toolbox
Statistics Toolbox
MATLAB release MATLAB 7.11 (2010b)
Other requirements To run AlgoTradingDemo5.m you will also need a compatible compiler and Real-Time Workshop
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
06 Dec 2010 Fabrice

Really Amazing !!

09 Dec 2010 Artik Crazy

Great Webinar and usefull code.
Only how can I get the PP slides that were used in the webinar?

26 May 2011 zhang  
20 Oct 2011 Jorge

I am having difficulty trying to load my own high frequency data in line 181 of AlgoTradingDemo1.m. I get the following error message:
??? Error using ==> movavg at 41
Lead and lag arguments must be positive <= 23.
I believe the error stems from line 39 of movavg.m:
r = length(asset);
somehow, input 'asset' is being passed as zero to function movavg. I notice that when bund1min.mat is loaded using the load function, it automatically generates a variable 'data'. When I load my own .mat file, it does not generate a 'data' variable. Could this be the problem?

29 Dec 2011 imad kachacha  
17 Mar 2012 Justinas Barauskas

Hi is just wanted a sharpe question :)

%%
% Develop a trading signal and performance measures. We'll assume 250
% trading days per year.
s = zeros(size(BundClose));
s(lead>lag) = 1; % Buy (long)
s(lead<lag) = -1; % Sell (short)
r = [0; s(1:end-1).*diff(BundClose)]; % Return
sh = sqrt(250)*sharpe(r,0); % Annual Sharpe Ratio

Hi Stuart,

if I am to use minute data(NOT DAILY as used in the example) does that mean i have to adjust the sharpe annual scaling as well?

i.e. sqrt(250*60*11)

09 Apr 2012 Trader

I was wondering the same thing, could someone please explain why he is multiplying by 60 and 11?

09 Apr 2012 Paul Wesson

60 minutes in 1 hour.
11 trading hours of 1-minute data in a day.

09 Apr 2012 Paul Wesson

http://quant.stackexchange.com/questions/2260/how-to-annualize-sharpe-ratio/2271#2271

23 Apr 2012 Ivan

I have some problems with tradeSignal.m function

It seems to be a mistake there: le assume we have
 
pop = [ 1 0 0 1 0 0 0 0 1 1]
,which means not to use indicator1, and return True if indicator2 == 1 and indicator3 == 0

signals = [ 0 1 0], which must satisfy the conditions of pop.

Now, I run tradeSignal(pop, signals) and get 0.

So there is a mistake. I'm thinking of line 50 and 57. But first we should declare
line 46: filteredSignals = ind(:,ind2use);

line 51: A = eval(['(filteredSignals(:,1) == pop(r,',idxstr,'));']);
line 57: B = eval(['(filteredSignals(:,',num2str(i+1),') == pop(r,',idxstr,'));']);

Now, test of corrected function

signals =
[0 0 0;
0 0 1;
0 1 0;
0 1 1;
1 0 0;
1 0 1;
1 1 0;
1 1 1];
s = tradeSignal(pop, signals)
s =

     0
     0
     1
     0
     0
     0
     1
     0

Please login to add a comment or rating.
Updates
06 Dec 2010

Updated link to recorded version of the webinar.

Tag Activity for this File
Tag Applied By Date/Time
algorithmic trading Stuart Kozola 30 Nov 2010 14:10:35
trading Stuart Kozola 30 Nov 2010 14:10:35
moving average Stuart Kozola 30 Nov 2010 14:10:35
rsi Stuart Kozola 30 Nov 2010 14:10:35
williams percent r Stuart Kozola 30 Nov 2010 14:10:35
evolutionary learning Stuart Kozola 30 Nov 2010 14:10:36
genetic programming Stuart Kozola 30 Nov 2010 14:10:36
genetic algoirthm Stuart Kozola 30 Nov 2010 14:10:36
sharpe ratio Stuart Kozola 30 Nov 2010 14:10:36
trading strategy Stuart Kozola 30 Nov 2010 14:10:36
trading strategy mathworks2011 10 Jan 2011 13:56:24
algorithmic trading Shichang 18 Jan 2011 17:00:31
algorithmic trading Danil Biktudin 19 Jan 2011 21:27:40
trading Danil Biktudin 19 Jan 2011 21:28:00
moving average Alexander 26 Apr 2011 08:31:38
algorithmic trading Alessandro Juri 18 May 2011 05:15:54
algorithmic trading Ilari Törönen 18 May 2011 14:02:27
sharpe ratio Ilari Törönen 18 May 2011 14:02:29
algorithmic trading damiano 14 Jun 2011 17:17:24
trading strategy Charles 29 Jul 2011 03:25:43
algorithmic trading Jorge 07 Aug 2011 13:50:23
algorithmic trading Anish 18 Aug 2011 18:49:32
algorithmic trading Petr Krivdin 04 Sep 2011 14:48:21
algorithmic trading Cheuk Hong Leung 29 Sep 2011 11:24:58
trading strategy Chun 15 Oct 2011 05:31:56
algorithmic trading dd 10 Nov 2011 11:07:46
trading strategy Jan Viebig 12 Dec 2011 08:31:21
algorithmic trading Eugene 06 Jan 2012 15:26:28
trading Turguy Goker 09 Jan 2012 00:07:40
algorithmic trading shmul 04 Feb 2012 08:27:35
algorithmic trading Matthew Sheskey 01 Mar 2012 12:31:37
algorithmic trading Leonard 10 Apr 2012 03:07:29

Contact us at files@mathworks.com