Best way to test backtest fill prices within a bar?  [SOLVED]

Questions about MultiCharts and user contributed studies.
thutch
Posts: 52
Joined: 16 Sep 2011
Has thanked: 16 times
Been thanked: 10 times

Best way to test backtest fill prices within a bar?

Postby thutch » 28 Jan 2014

I'm backtesting a strategy based on a custom future with 30-min bars. I realise that bar magnifier is not available for custom futures, and I need to look back over a longer period than a month (future rolls monthly) so want to use the custom future. I also have IntrabarOrderGeneration = True in the code. Entries are limit orders, whereas exits are stop orders.

Oh, and I have data at 1-min granularity from which the 30-min bars are built.

I am sceptical of the results and backtest assumptions, so today traded it live getting 8 fills. In aggregate, these roughly tallied with the backtest results & slippage assumptions, though many of the fills were off by a tick vs. live. Nonetheless, I'm not convinced of the performance over say 1,000 trades, especially in more volatile markets, and not sure how to verify this better.

Can the strategy be calculated from the 30-min bar but orders based on 1-min bars somehow? I would like to have a far better feel for the likelihood of the entry limit order fills, and also the stop exit.

In other strategies I have successfully used limit orders that are left in for the whole bar (eg 1-min), and then verified that price traded through the order. This is more complex now that I am using calculations based on a 30-min bar that could have both entries and exits in it i.e. IOG = True.

Appreciate any pearls of wisdom the backtesting gurus on this forum can share...
Last edited by thutch on 28 Jan 2014, edited 1 time in total.

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

Re: Best way to test backtest fill prices within a bar?

Postby TJ » 28 Jan 2014

I'm backtesting a strategy based on a custom future with 30-min bars. I realise that bar magnifier is not available for custom futures, and I need to look back over a longer period than a month (future rolls monthly) so want to use the custom future. I also have IntrabarOrderGeneration = True in the code. Entries are limit orders, whereas exits are stop orders.
Oh, and I have data at 1-min granularity from which the 30-min bars are built.
I am sceptical of the results and backtest assumptions, so today traded it live getting 8 fills. In aggregate, these roughly tallied with the backtest results & slippage assumptions, though many of the fills were off by a tick vs. live. Nonetheless, I'm not convinced of the performance over say 1,000 trades, especially in more volatile markets, and not sure how to verify this better.
Can the strategy be calculated from the 30-min bar but orders based on 1-min bars somehow? I would like to have a far better feel for the likelihood of the entry limit order fills, and also the stop exit.
In other strategies I have successfully used limit orders that are left in for the whole bar, and then verified that price traded through the order. This is more complex now that I am using calculations based on a 30-min bar that could have both entries and exits in it i.e. IOG = True.
Appreciate any pearls of wisdom the backtesting gurus on this forum can share...
You can set up 2 data series in the chart, a faster 1 min series for trading, and a slower 30 min for timing.


see post #18
[FAQ] Multiple time frame, Multi-Data Analysis
viewtopic.php?f=16&t=10811

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

Re: Best way to test backtest fill prices within a bar?  [SOLVED]

Postby TJ » 28 Jan 2014

or, you can export the Custom Future to a dummy symbol, and do your backtest on the dummy symbol.

Load your 1 min Custom Future on the chart... then

File > Export Data...


Return to “MultiCharts”