EasyLanguage Code Question

surfcat88

Newbie
Messages
1
Likes
0
I'm trying to write a short line of code to add to one of my trading systems. I need to write a line of code for a stop exit when the security price breaks the lowest low or highest high based on the 10 trading days prior to entry date. Does anyone have any ideas? I keep getting caught in loops. Thanks for your help.
 
Hi Surfcat,

Try using the following code

Code:
Var: MP(0), LL(0), HH(0);
MP = Marketposition;

if MP <> 0 and MP[1] = 0 then begin
  LL = Lowest(Low, 10);
  HH = Highest(High, 10);
end;

If marketposition = 1 then Sell next bar at LL Stop;
If marketposition = -1 then BuyToCover next bar at HH Stop;

Good Luck.
 
Top