|
Source Code: Modified from myidisck6 code in TS8/MC
Input: starttime(0850),closetime(1340), stoppoint1(55),stoppoint2(80),stoppoint3(30) ;
Vars:DownIn(0);
If time=closetime then begin
If CloseD(1)<CloseD(2) and CloseD(1)>OpenD(1) then begin
If (CloseD(1)-OpenD(1)>10 and CloseD(1)-OpenD(1)<=40 and openD(0)<CloseD(1)) then begin
Buy("DownRed1") 1 contracts next bar at close +1 limit;
DownIn=1;
end;
If (CloseD(1)-OpenD(1)>40) then begin
Buy("DownRed2") 1 contracts next bar at close +1 limit;
DownIn=2;
end;
end;
end;
If time>=starttime then begin
if marketposition = 1 and DownIn=1 then begin
If OpenD(0)>=CloseD(1)then begin
sell("S_L1") 1 contracts next bar at entryprice + stoppoint1-1 stop;
end
else begin
sell("W_L1") 1 contracts next bar at CloseD(1) limit;
end;
end;
if marketposition = 1 and DownIn=2 then begin
If OpenD(0)>=CloseD(1)then begin
sell("S_L2") 1 contracts next bar at entryprice + stoppoint2-1 stop;
end
else begin
sell("W_L2") 1 contracts next bar at entryprice + stoppoint3-1 limit;
end;
end;
end; |
|