logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
zigzag  
#1 Posted : Wednesday, January 28, 2009 11:27:11 AM(UTC)
zigzag

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/13/2009(UTC)
Posts: 42

hello

would anybody have handy the MS code for the system Pristine Variation discussed in May 2002's issue of Active Trader magazine? I have tried to code it but am not confident that i've done it right... should be an easy/quick task for the top programmers in EIOC...

below, the logic of the system (my interpretation of the article). The accompanying Easylanguage code is in the magazine's website under the name "Pristine Variation" in http://www2.wealth-lab.com/activetrader/ActiveTrader.htm (for some reason, I can't get to that site today, otherwise I would have pasted it here...).

the results stats for this system as published in the article are almost too good to be true...

LOGIC

LE

setup: three consecutive lower highs and three consecutive closes lower than the opens

1. go long at bar immediately after setup with stop at previous bar's high + 0.01

LX

1. Trailing stop: sell at current bar IF price crosses below previous bar's low with stop at previous bar's low - 0.01

2. Reversal stop: sell at current bar's close IF current bar's high is higher than previous bar's high but current bar's close is lower than previous bar's close

3. Profit-taking: sell at next bar IF next bar's open crosses above current bar's high with stop at next bar's open - 0.01

Other:

1. dynamic position sizing: available equity * percent of equity at risk per trade (5%) / (4*ATR(10))

2. no margining (ie, trade from a cash account)

Best

ZigZag

johnl  
#2 Posted : Thursday, January 29, 2009 9:00:17 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

Is this the "setup":

a1:=(H<Ref(H,-1));
a2:=(Ref(H,-1)<Ref(H,-2));
a3:=(Ref(H,-2)<Ref(H,-3));
b1:=(C<O);
b2:=(Ref(C,-1)<Ref(O,-1));
b3:=(Ref(C,-2)<Ref(O,-2));
c1:=a1*a2*a3*b1*b2*b3;
c1

Not too sure about the exits.
zigzag  
#3 Posted : Friday, January 30, 2009 12:12:35 PM(UTC)
zigzag

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/13/2009(UTC)
Posts: 42

Many thanks, johnl. I suspect that the setup look back period is three bars excluding current bar. So, I would re-write your code as follows:

a1:=Ref(H,-1)<Ref(H,-2);
a2:=Ref(H,-2)<Ref(H,-3);
a3:=Ref(H,-3)<Ref(H,-4);
b1:=Ref(C,-1)<Ref(O,-2);
b2:=Ref(C,-2)<Ref(O,-3);
b3:=Ref(C,-3)<Ref(O,-4);
LE:=a1*a2*a3*b1*b2*b3;

I am having trouble coding the rest of the system. Particularly, how to tell MS to sell at either of the three different stop prices. Also, how to have some trade conditions trade at current bar and others at next bar.

Maybe this is a mission for the real PRO(grammers) in EIOC...

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.