Not sure if many people here remember much about TradeStation 2000i but it was possible to build a daily chart by loading, say, 5 min data, compress that to a daily chart, run your system code on the daily chart (so that trading levels, etc were all generated from daily OHLC) and then check a '5min' box in the backtest settings so that the order of execution of trades would be checked against 5min data while the system itself was running on daily data. That meant TradeStation effectively 'looked inside' the daily bar to check the order of execution of trades against what really happened in the market on a lower timeframe.
This was really handy if you were running a system that has a limit buy entry below the market and an If-Done limit sell exit above the market. In this case you could finish the session either with a profitable trade (if the buy entry limit was triggered first and the If-Done sell limit was triggered second), or a large loss if the market traded up to the If-Done sell limit and then traded down through the buy entry limit and kept selling off.
On daily data there is no way to determine which outcome actually happened, so TradeStation used to make all sorts of assumptions about the open being closer to either the high or the low and by using things like BouncingTicks to try and simulate intraday volatility.
I have been looking into how it might be possible to run a system on daily data built from hourly data and then have AmiBroker 'look inside' the bar to determine the order of trade execution based on intraday data rather than trying to code assumptions. I can load up hourly data & set Periodicity to daily so that the system runs on daily data but this changes the OHLC arrays to daily as well and does not check the order of execution of trades on the intraday data, from which the daily data the system is running on, is built.
I have read up on TimeFrameSet() and it seems you cannot reference a lower timeframe from a higher one. The only way to do this is in AmiBroker, I think, is to load the hourly data, set Periodicity to Hourly in the Backtest Settings and then have the code convert all arrays to daily using TimeFrameSet(). Then you run that portion of the system code which needs daily data.
From there you use TimeFrameRestore() to go back to Hourly and then run the portion of code which controls entry and exit to make sure the order of execution of your trades reflects reality.
My question is, does anyone know if it possible in AmiBroker to run a system on daily data constructed from hourly data so that the system calculations are correct, but then revert back to hourly data to run the code which physically checks and executes trades so that the order of execution is what would have really happened in the market? Or is coding the system to operate on intraday data, setting Periodicity to the lower timeframe and using TimeFrameSet() to switch between timeframes the only way?
Any assistance or clarity on this would be greatly appreciated!