Choosing Indicator Timeframes for Tick-Based Backtests
Summary
This discussion explains how to align indicators with tick-level backtests when the indicators are usually defined on daily data. For an indicator intended to use daily observations, one approach is to aggregate the ticks into daily closes, calculate the indicator, then apply its values to the intraday record. The answer uses 23:59:59 GMT as a suggested foreign-exchange daily close, while noting that daily aggregation discards intraday information.
An alternative is to calculate measures from the tick data and normalize them to longer horizons, or to first aggregate ticks into bars such as five-minute OHLC data and calculate indicators on those bars. The appropriate interval depends on the trading frequency and research question. The response cautions that very short bars can reflect microstructure effects such as bid-ask bounce, and suggests that strategies making a few trades per day may need a coarser interval. These are practical suggestions rather than a comparison of tested methods; the discussion does not establish a universally correct FX close or optimal bar size.
Key ideas
- Daily indicators can be computed from daily observations and aligned with intraday data, but this discards intraday detail.
- The suggested FX daily close is 23:59:59 GMT.
- Tick data can be aggregated into OHLC bars before calculating indicators.
- The useful bar interval depends on trading frequency and research goals.
- Very fine intervals can capture microstructure noise such as bid-ask bounce.
Tags
Full text
# Beginner question: how do I use common indicators in backtesting with tick data? Do I resample to 1-day data? # Beginner question: how do I use common indicators in backtesting with tick data? Do I resample to 1-day data? Sorry if this is the wrong place for this, but I've Googled around quite a bit and can't find this spelled out anywhere. Most of the common indicators seem to be based on daily periods. If I want to incorporate an indicator value while backtesting bid/ask tick data - say a 10 day moving average - do I need to resample the ticks into 1-day data, run the indicator on it, and then merge the daily indicator values back in with my tick data? Since Forex is a 24 hour market, what time should I consider the "Close" for the day? 11:59:59pm GMT? Also, if they are only updated on "Close", does this really mean that most of the commonly used indicator values are constant for the entire trading day, or have I just not looked into enough indicators? Thanks for your help. ## Answer by JejeBelfort (score 0, accepted) https://quant.stackexchange.com/a/32464 Regarding your first question on the Closing time for the FX market, this is correct, you should consider the 11:59:59 pm GMT as the close. This approach is the most intuitive one and is also the one used by Bloomberg when displaying the graph price. For the second question, if the indicator you want to compare to uses daily data, then you need to sample daily data from your dataset as well (by taking the closing daily FX values for instance). With this approach you would lose the information contained in your intraday data though. I would recommend you compute your indicator on your tick data and then normalize it to get daily / weekly / yearly data so that you capitalize on your available tick data. ## Answer by sobabe09 (score 0) https://quant.stackexchange.com/a/32467 You can also adjust your statistics so they match a smaller time frame. For example, you could create Open, High, Low, Closing statistics for 5 minute chunks of tick data, and from then, calculate a moving average from that data set. It really depends on the granularity you want to look at. If you go too small, you'll start picking up micro structure noise like the bid-ask bounce - i'd recommend for a few trades a day, use 15 minute data (at the smallest) but if you want to research at a higher granularity, then you're probably best off using other metrics/methods.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.