Backtest requirement of STOP or LIMIT Order in IOG mode

Questions about MultiCharts and user contributed studies.
henrywl
Posts: 28
Joined: 28 Jun 2012
Has thanked: 5 times
Been thanked: 1 time

Backtest requirement of STOP or LIMIT Order in IOG mode

Postby henrywl » 24 May 2014

Hello,

I have an issue regarding the use of Stop and Limit order in the IOG enable, in which it works perfectly fine when the IOG is disable,

As suppose I would like to set a buy order with a stop price as the following:
Buy Next Bar AT 100 STOP <-- in which I intend to have an buy order at 100 or higher when the current level is at 80 only

This works fine with the IOG mode disable and buy order would be waiting at 100 to get executed; however, with the IOG enable the order simply filled at the current level of 80 instead of waiting until the price hit 100. For the property setting, I enable the extended backtesting mode, and backtesting precision to use bar magnifier at 1 tick.

The same issue applied to sell order with both Limit and STOP orders.

Please explain me how I can get the desire backtest result with any particular settings.

Thank you.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Backtest requirement of STOP or LIMIT Order in IOG mode

Postby Andrew MultiCharts » 27 May 2014

Hello henrywl,

A buy stop order cannot be filled at lower price. If you have the following code, it should not execute the order at 80 in backtesting:

Code: Select all

Buy Next Bar AT 100 STOP;
If it indeed happens, please come to our live chat during working hours (6:30 am – 2:45 pm EST) to let our operators connect to your computer remotely and help you: http://messenger.providesupport.com/mes ... pport.html

If you have a code like this:

Code: Select all

Buy Next Bar AT X STOP;
Where "X" is a variable, please print this variable at every code calculation to find out why it changes to a different value. You can find an example here.

Please read this article to learn how script is calculated and orders are executed with your setup.


Return to “MultiCharts”