Rank: 110476 based on 0 downloads (last 30 days) and 0 file submitted
photo

Ivan

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Ivan
Updated File Comments Rating
23 Apr 2012 Algorithmic Trading with MATLAB - 2010 Files from the November 18, 2010 webinar. Author: Stuart Kozola

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

Contact us