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

Stop Loss Code



PureBytes Links

Trading Reference Links

I'm having problems writing a stop loss used on S&P Intraday data. The signal buys at the previous  High and my stop is the low of the Setup Bar (previous Low).  The stop signal works unless the Low of the Entry Bar takes out the Low of the Setup Bar., which leaves me with an unrealistic trade of entering and exiting on the same bar.  Below are a few of my attempts at coding the stop.  Any help would be greatly appreciated.  Thanks/Noddy
 
ExitLong ("Break LowStop")from entry ("Break")
   next bar at$  stop;
 
ExitLong ("Break LowStop")from entry ("Break")
   at$  stop;
 
 If Time > entrytime then begin
  ExitLong ("Break LowStop")from entry ("Break")
   next bar at$  stop;
End;
 
If BarsSinceEntry >= 1 then ExitLong ("Break LowStop")from entry ("Break")
   next bar at$  stop;