Backtesting + IOG  [SOLVED]

Questions about MultiCharts and user contributed studies.
evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Backtesting + IOG

Postby evdl » 05 Jun 2013

I have the following situation:

With live trading (realtime), I use a strategy with IOG to have the marketposition and synchronisation of the marketposition synced after a tick. For order entry and exit calculation and placing of exits I use

Code: Select all

If barstatus(1) = 2 then begin
to calculate this at the close of bar (3min resolution).

But now the question, how this works in backtesting.

If I use the same code on backtesting with IOG, MC will look at the OHLC. If I use the same "if barstatus(1) =2" for the entry and exit calculation and placing. Will it calculate and place these values at close of bar (every 3min). Or does MC sees OPEN, HIGH, LOW, CLOSE as close of bar.

Quote from wiki. https://www.multicharts.com/trading-sof ... hart_Types
Calculation of the “Buy next bar at market” strategy is done as follows:
1. calculation on the first bar segment (Open) and generation of a market order on Open = Low of the next bar segment.
2. calculation on the second bar segment (Open-High) and generation of a market order on Open = High of the next bar segment.
3. calculation on the third bar segment (High-Low) and generation of a market order on Open = Low of the next bar segment.
4. calculation on the fourth bar segment (Low-Close) and generation of a market order on Open of the next bar.
In other words, does backtesting with IOG and "if barstatus(1) =2" will treat one of the OHLC as the "close" of bar and trigger exit's not always on the real close of bar (as it works with realtime + IOG).

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Backtesting + IOG

Postby Henry MultiСharts » 06 Jun 2013

Hello evdl,

Are you using one of the non-standard chart types?
If you are using regular chart type then you need to have a look at the following article:
How Signals_are_Calculated.
Calculation on historical data. IOG enabled. Bar Magnifier disabled.
The script is calculated four times on OHLC of the bar. It is considered that all prices were within the bar (Intra-bar Price Movement Assumption is used). Order is filled on any price within the bar with the step (minmove/pricescale).
That means order that was generated on bar close will live until the next calculation (open of next bar), if the order is not filled on the Open of the next bar and order generation condition is no longer met in the code - order no longer generated.

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: Backtesting + IOG

Postby evdl » 06 Jun 2013

Thanks for the link.

I use regular chart type.

Sorry I didn't explain it right I think. I try to code the strategy in a way that I can backtest and live trade with the strategy, without having to change the code and still get the same sort of outcome.

With live trade I use realtime+IOG. For the entry and exit and trailingstop placing I use the "if barstatus" to only do this on close of the barinterval. For the calculation of the trailingstop and marketposition and status changing of variabels I use tick by tick. Hence the IOG use.

Now with backtesting if I use IOG and "if barstatus" as describe above. The entry, exit and trailingstop placing is the same as in realtime live trading. But the calculation if I use IOG is done I think by OHLC and not tick by tick.

After reading the link, is it right that by using IOG + Barmagnifier (tickdata) with backtesting, is the same as Realtime + IOG?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Backtesting + IOG  [SOLVED]

Postby Henry MultiСharts » 06 Jun 2013

After reading the link, is it right that by using IOG + Barmagnifier (tickdata) with backtesting, is the same as Realtime + IOG?
Yes, but IOG enabled on historical data adds additional calulations on open and close of the main data series bar.


Return to “MultiCharts”