[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening Range Breakout



PureBytes Links

Trading Reference Links

I coded this system before the summer but don't trade it because I 
don't have time to trade intraday. Since then I've developped several 
EOD systems based on opening range breakout and trade one of them 
real time.

Attached is the intraday version as described on the website. It 
doesn't work perfectly, there's something wrong with it. If I have 
enough motivation ;-) I'll refine this system and turn it into a 
profitable one.

Have fun
Nam


============================

newday=TimeNum()<Ref(TimeNum(),-1);

Odaym0=ValueWhen(newday,O,1);
Odaym1=ValueWhen(newday,O,2);
Odaym2=ValueWhen(newday,O,3);
Odaym3=ValueWhen(newday,O,4);
Odaym4=ValueWhen(newday,O,5);
Odaym5=ValueWhen(newday,O,6);
Odaym6=ValueWhen(newday,O,7);
Odaym7=ValueWhen(newday,O,8);
Odaym8=ValueWhen(newday,O,9);
Odaym9=ValueWhen(newday,O,10);
Odaym10=ValueWhen(newday,O,11);

Cdaym1=ValueWhen(newday,Ref(C,-1),1);
Cdaym2=ValueWhen(newday,Ref(C,-1),2);
Cdaym3=ValueWhen(newday,Ref(C,-1),3);
Cdaym4=ValueWhen(newday,Ref(C,-1),4);
Cdaym5=ValueWhen(newday,Ref(C,-1),5);
Cdaym6=ValueWhen(newday,Ref(C,-1),6);
Cdaym7=ValueWhen(newday,Ref(C,-1),7);
Cdaym8=ValueWhen(newday,Ref(C,-1),8);
Cdaym9=ValueWhen(newday,Ref(C,-1),9);
Cdaym10=ValueWhen(newday,Ref(C,-1),10);

Ldaym1=ValueWhen(newday,Ref(LowestSince(newday,L),-1),1);
Ldaym2=ValueWhen(newday,Ref(LowestSince(newday,L),-1),2);
Ldaym3=ValueWhen(newday,Ref(LowestSince(newday,L),-1),3);
Ldaym4=ValueWhen(newday,Ref(LowestSince(newday,L),-1),4);
Ldaym5=ValueWhen(newday,Ref(LowestSince(newday,L),-1),5);
Ldaym6=ValueWhen(newday,Ref(LowestSince(newday,L),-1),6);
Ldaym7=ValueWhen(newday,Ref(LowestSince(newday,L),-1),7);
Ldaym8=ValueWhen(newday,Ref(LowestSince(newday,L),-1),8);
Ldaym9=ValueWhen(newday,Ref(LowestSince(newday,L),-1),9);
Ldaym10=ValueWhen(newday,Ref(LowestSince(newday,L),-1),10);

Hdaym1=ValueWhen(newday,Ref(HighestSince(newday,H),-1),1);
Hdaym2=ValueWhen(newday,Ref(HighestSince(newday,H),-1),2);
Hdaym3=ValueWhen(newday,Ref(HighestSince(newday,H),-1),3);
Hdaym4=ValueWhen(newday,Ref(HighestSince(newday,H),-1),4);
Hdaym5=ValueWhen(newday,Ref(HighestSince(newday,H),-1),5);
Hdaym6=ValueWhen(newday,Ref(HighestSince(newday,H),-1),6);
Hdaym7=ValueWhen(newday,Ref(HighestSince(newday,H),-1),7);
Hdaym8=ValueWhen(newday,Ref(HighestSince(newday,H),-1),8);
Hdaym9=ValueWhen(newday,Ref(HighestSince(newday,H),-1),9);
Hdaym10=ValueWhen(newday,Ref(HighestSince(newday,H),-1),10);

Volat=(Hdaym1+Hdaym2+Hdaym3+Hdaym4+Hdaym5+Hdaym6+Hdaym7+Hdaym8+Hdaym9
+Hdaym10 - 
Ldaym1-Ldaym2-Ldaym3-Ldaym4-Ldaym5-Ldaym6-Ldaym7-Ldaym8-Ldaym9-Ldaym1
0)/10;

COrange=(Cdaym1+Cdaym2+Cdaym3+Cdaym4+Cdaym5+Cdaym6+Cdaym7+Cdaym8+Cday
m9+Cdaym10 - 
Odaym1-Odaym2-Odaym3-Odaym4-Odaym5-Odaym6-Odaym7-Odaym8-Odaym9-Odaym1
0)/10;

trade=COrange/Volat >=0.5;
keyprice=(Hdaym1+Ldaym1+Cdaym1)/3;
Buyeasier=Cdaym1>=keyprice;
Selleasier=Cdaym1<keyprice;

Buystop=IIf(Buyeasier,Odaym0+0.3*Volat,Odaym0+0.6*Volat);
Sellstop=IIf(Buyeasier,Odaym0-0.6*Volat,Odaym0-0.3*Volat);

Buy=Cross(H,Buystop);
BuyPrice=ValueWhen(Buy,Buystop);
Short=Cross(Sellstop,L);
ShortPrice=ValueWhen(Short,Sellstop);

PositionSize=BuyPrice*50;

scond1=Cross(LLV(Ref(L,-1),4),L);
scond2=Ref(newday,1);
Sell=scond1 OR scond2;
SellPrice=IIf(scond1,LLV(Ref(L,-1),4),ValueWhen(scond2,C));

Cvcond1=Cross(H,HHV(Ref(H,-1),4));
Cvcond2=Ref(newday,1);
Cover=Cvcond1 OR Cvcond2;
CoverPrice=IIf(cvcond1,HHV(Ref(H,-1),4),ValueWhen(Cvcond2,C));


--- In amibroker@xxxx, "wdbaker8" <wdbaker8@xxxx> wrote:
> Hi All,
> Has anyone coded this system or something like it, it looks a 
little 
> complicated for me but will take a stab at it, just didn't want to 
> duplicate efforts.
> 
> http://www.tradingeducators.net/3.htm 
> 
> I saw this listed on the www.elitetraders.com website as a possible 
> daytrade system for volatile stocks or futures, it was originally 
set 
> up for the S&P 500
> 
> Thanks
> wdbaker8