N-bar stop loss - intraday exit

Hi all

I've been researching and testing my knowledge of stop losses (i.e. Applystop) recently.

I've been having trouble achieving intraday price exits when using the N-bar stop loss during backtests, as I do for the other stop loss types.

Is it possible to achieve the result where - in a backtest - a position can be exited intraday at the price where the n-bar stop is breached (rather than at an open or close price )?

Kind regards
Geoff

n-bar stop is not set at a price point but at XX day's. So it will exit when those day's are breached. It does not breach a pricepoint.

Therefore your breach will either be at the open or close of bar XX and that price will be used.

No, n-bar stop does not trigger exit after n-days but after n-bars (which may be tick, volume, minute, daily, weekly, ... bars depending on set interval).

No, exit price may be set via SellPrice variable either via code or in UI settings. So it will not always be used Open or Close. Whether it is reasonable using certain other prices is written on different page.

1 Like

Thanks for the corrections.

Thanks Henri and fxshrat

I've now been able to use SellPrice in my coding - much appreciated.

That all makes sense. FYI, I've realised that I completely misunderstood what was meant by "N-bar stop" (i.e. simply a time-based stop) - I mistakenly thought it was referring to the LLV of the last N-bars!

Cheers
Geoff

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.