ES great thread..
I want to Back test this method, but I am very new to Tradestation.
I have written a code in Easy Language, since I am newbie to TS i need lot of help.
My setup is the following...
In Data2 ( subgraph), I have Daily data of YM and in Data1, I have 1 minute data of YM.
Could some body check my code, for this method because my trades are not coming out right. If some body modifies and post the correct code, I can back test.
Thx
{******************************8
This is the Code for YM in a can Journal in ET by Electric servant
http://www.elitetrader.com/vb/showthread.php?s=&threadid=32206&perpage=6&pagenumber=1
*****************************}
Inputs: Price(close);
Vars: H4(0), H3(0), H2(0), H1(0), L4(0), L3(0),L2(0), L1(0), MP(0);
MP = MarketPosition;
If Date <> Date[1] then begin
H4 = ((High[1] of Data2 - Low[1] of Data2)*(1.1/2)) + Close[1] of Data2;
H3 = ((High[1] of Data2 - Low[1] of Data2)*(1.1/4)) + Close[1] of Data2;
H2 = ((High[1] of Data2 - Low[1] of Data2)*(1.1/6)) + Close[1] of Data2;
H1 = ((High[1] of Data2 - Low[1] of Data2)*(1.1/12)) + Close[1] of Data2;
L1 = Close[1] of Data2 - ((High[1] of Data2 - Low[1] of Data2)*(1.1/12)) ;
L2 = Close[1] of Data2 - ((High[1] of Data2 - Low[1] of Data2)*(1.1/6)) ;
L3 = Close[1] of Data2 - ((High[1] of Data2 - Low[1] of Data2)*(1.1/4)) ;
L4 = Close[1] of Data2 - ((High[1] of Data2 - Low[1] of Data2)*(1.1/2)) ;
{ H4 Breakout }
If close of Data1 crosses above H4 and MP < 1 then begin
Buy 1 contract next bar at H4 limit;
If Close of Data1 crosses below H3 and MP > 0 then begin
Sell 1 contract next bar at the H3 Limit;
End;
If Close of Data1 crosses below L4 and MP > 0 then begin
Sell 1 contract next bar at the L4 limit;
End;
End;
{H3 Short }
If Close of Data1 crosses below H3 and MP > -1 then begin
Sell short 2 contract next bar at the H3 Limit;
If close of Data1 crosses above H4 and MP < 0 then begin
Buy cover 2 contract next bar at H4 limit;
End;
If Close of Data1 crosses below L3 and MP < 0 then begin
Buy Cover 2 contract next bar at the L3 Limit;
End;
End;
{ L3 Long }
If Close of Data1 crosses above L3 and MP < 1 then begin
Buy 2 contract next bar at the L3 Limit;
If Close of Data1 crosses below L4 and MP > 0 then begin
Sell 2 contract next bar at the L4 limit;
End;
If Close of Data1 crosses above H3 and MP > 0 then begin
Sell 2 contract next bar at the H3 Limit;
End;
End;
{ L4 Breakout to the Short side }
If Close of Data1 crosses below L4 and MP > -1 then begin
Sell Short 1 contract next bar at the L4 limit;
If Close of Data1 crosses above L3 and MP < 0 then begin
Buy 1 contract next bar at the L3 Limit;
End;
If close of Data1 crosses below H4 and MP < 0 then begin
Buy 1 contract next bar at H4 limit;
End;
End;
End;