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

Re: Help with coding an initial stop loss



PureBytes Links

Trading Reference Links

At 11:03 PM 11/1/2005, you wrote:

>I am able to store the values for BarLow or BarHigh on the EntryBar but it
>seems that the system is not carrying the value forward to stop me out. 


Your code appears to be overwriting the BarLow and BarHigh values on each new bar.

And if you want the stop active on all bars after the entry bar than you need to change the BarsSinceEntry term. 

Something like this should work:

===========================================
IF XXXX THEN begin
   Buy ("Long Entry") This Bar on Close;
   BarLow = LOW;
   BarHigh = HIGH;
end;

IF MarketPosition = 1 and BarsSinceEntry >= 1
        THEN ExitLong ("SellStopLoss") BarLow Stop;

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

Bob Fulks