Stop – Entry bar HiLo time stop

This stop protects your position against scenarios where nothing happens.

Usually you would assume to be in a winning position after a few bars. Therefore this stop script is activated a few bars after the entry. Then it is set to the low (for long) or high (for short) of the entry bar.

Be aware that even if you set the time delay parameter to 0, there will be no stop generated on the entry bar. Use the % stop or cash stop additionally.

Stop Entry Bar HiLo


Meta: Synopsis("Sets stop to Hi/Lo of entry bar after x bars.");
Inputs: EntrypriceStopBars(5), visuals(true);

if barssinceentry>=EntryPriceStopBars then begin
if marketposition=1 then sell next bar at low[barssinceentry] stop;
if marketposition=-1 then cover next bar at high[barssinceentry] stop;
end;

if visuals=true then drawsymbol(getactiveorderprice(1));

Save script as strategy

Leave a comment