[IntrabarOrderGeneration = true] in backtesting

Questions about MultiCharts and user contributed studies.
dario
Posts: 31
Joined: 01 Dec 2015
Has thanked: 7 times
Been thanked: 1 time

[IntrabarOrderGeneration = true] in backtesting

Postby dario » 11 Dec 2015

Hi to all,
I have a Strategy where I use Weekly timeFrame,
now with [IntrabarOrderGeneration = false] the script is executed at the close of a bar and all it's ok.... if I set [IntrabarOrderGeneration = true] in backtesting the script is executed tick by tick or only at Open, High, Low and Close of a Weekly bar?? I'm a little confused.

Because I want to close the order some minutes before the end of a Weekly bar and I don't want to use "sell this bar at close" or "SetExitOnClose" that work only in backtest.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: [IntrabarOrderGeneration = true]

Postby TJ » 11 Dec 2015

Hi to all,
I have a Strategy where I use Weekly timeFrame,
now with [IntrabarOrderGeneration = false] the script is executed at the close of a bar and all it's ok.... if I set [IntrabarOrderGeneration = true] in backtesting the script is executed tick by tick or only at Open, High, Low and Close of a Weekly bar?? I'm a little confused.

Because I want to close the order some minutes before the end of a Weekly bar and I don't want to use "sell this bar at close" or "SetExitOnClose" that work only in backtest.
See post #4
[FAQ] Autotrade / Backtest / Optimization
viewtopic.php?f=16&t=10811

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: [IntrabarOrderGeneration = true]

Postby JoshM » 11 Dec 2015

I have a Strategy where I use Weekly timeFrame,
now with [IntrabarOrderGeneration = false] the script is executed at the close of a bar and all it's ok.... if I set [IntrabarOrderGeneration = true] in backtesting the script is executed tick by tick or only at Open, High, Low and Close of a Weekly bar?? I'm a little confused.
It depends on whether you've enabled the Bar Magnifier alongside IntrabarOrderGeneration (IOG).

During backtesting...

- When IOG is on but Bar Magnifier off, then the script is calculated four times (for the open, high, low, and close price) and orders are executed/filled per the intra-bar price movement assumptions.
- When IOG is on and Bar Magnifier is also on, then the script is calculated on the open of the main data series, then the open, high, low, and close of the Bar Magnifier data series, and then on the close of the main data series.

For more, see how signals are calculated.

dario
Posts: 31
Joined: 01 Dec 2015
Has thanked: 7 times
Been thanked: 1 time

Re: [IntrabarOrderGeneration = true]

Postby dario » 11 Dec 2015

Ok,so If :
1) data1 = Weekly
2) BarMagnifier = on (1 minute)
3) [IntrabarOrderGeneration = true]

Then my script is executed on:
-) Open of the Weekly bar
-) Open, High, Low, and Close of 1Minute bar
-) Close of the Weekly bar

But it is not necessary that the script is executed on Open, High, Low, and Close of 1Minute bar,
if I want to execute the script only on the close of 1 Minute bar it is possible?

Thank you for the answer.

Bye

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: [IntrabarOrderGeneration = true]

Postby tony » 11 Dec 2015

In IOG mode your script is calculated on every tick. Now if your data resolution is less than every tick, for example OHLC then you will only get a calculation on OHLC. For example say you have data for ES and backtest over one year. The most recent 6 months likely have tick data and thus the script is calculated on every tick. But the previous 6 months may only have OHLC for those bars and thus your calculations will be only for OHLC over that time period. That's why you need to make sure when you have backtests that they are filling outside of just OHLC.


Return to “MultiCharts”