Multiple timeframe analysis: how to use it in rules

By Oalgo · Last reviewed

Multiple timeframe analysis looks at the same prices on more than one timeframe. A common split is a longer timeframe to see the trend, such as 4 hours, and the chart's own shorter one, such as 15 minutes, to time the entry. In a rule, one condition reads the longer candles and another reads the short ones.

Chart: example candles, with every 4 candles boxed as one longer candle. A line shows an indicator on the longer candles. It stays flat while a longer candle is forming and steps only once that candle has closed. The last box is still forming, so no value from it is drawn.Chart candlesLonger candle, 4 chart candlesIndicator on the longer candlesStill forming
Example prices, made up for this page. Each longer candle is 4 chart candles.

How does a rule read a longer timeframe?

#

A longer candle is complete only when its last chart candle closes. A rule can use it only from then on. Until then the rule reads the value from the longer candle before. If a rule read the forming candle instead, its value would keep changing as the candle went on, and a test would use prices that were not yet known (see lookahead bias). Oalgo reads a longer candle only after it has closed.

An example with a 1-hour chart and an indicator on the 4-hour timeframe. Here the 4-hour candles run 00:00 to 04:00, 04:00 to 08:00, and so on.

Chart candle closes atLonger candle it belongs toLonger-timeframe value the rule reads
01:0000:00 to 04:00, still formingThe value from the candle that closed at 00:00
02:0000:00 to 04:00, still formingThe value from the candle that closed at 00:00
03:0000:00 to 04:00, still formingThe value from the candle that closed at 00:00
04:0000:00 to 04:00, just closedThe value from the candle that closed at 04:00
05:0004:00 to 08:00, still formingThe value from the candle that closed at 04:00

What are the rules of a multiple timeframe strategy?

#
  • Trend filter on the longer timeframe: the close is above the 50-period EMA of the 4-hour candles.
  • Entry on the chart's own timeframe: RSI over 14 candles falls below 40.
  • Exit: RSI rises above 60, or the close falls below the 4-hour EMA.
  • Stop: a Stop Loss as a percentage.

The EMA pullback strategy page has the same rule with both parts on one timeframe.

How do you set a timeframe on an indicator in Oalgo?

#

Every indicator block in the builder has a Multi-timeframe box: a number and a unit, minutes, hours, days or weeks. Left on "Same as chart" the block reads the chart's own candles. Set to 4 hours it reads 4-hour candles. Only the indicator changes: the Price block is still the close of the chart's own candle.

In Oalgo you can tell Oalgo AI your multiple timeframe rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.

For example, you could tell Oalgo AI: "Enter when the close is above the 50-period EMA on the 4-hour timeframe and RSI (14) falls below 40. Exit when RSI rises above 60. Use a 2% Stop Loss and a 4% exit target. Run it on 15-minute candles." These numbers are examples to change. In the builder the two entry conditions are joined with an AND block, so both must be true at the same time. A Live Strategy needs a stop on each side it can enter, and an exit target is optional. The example names both.

How do you test this strategy honestly?

#
  • Run the same entry with and without the longer-timeframe condition on the same dates, and compare the number of trades.
  • Run a backtest on a rising period, a falling one and a sideways one.
  • Try another longer timeframe, such as 1 hour and 1 day, and see how the report changes.
  • Run a forward test on new prices, with simulated funds.

What can multiple timeframe analysis not tell you?

#

A longer timeframe slows a rule down. Its value changes only when a longer candle closes, so a filter can still say "up" for hours after the move has turned. Because the value changes so rarely, a rule that reads a longer timeframe opens at most one trade per candle of that timeframe in Oalgo. A long average on a long timeframe also needs many longer candles before it has a value, so it starts late in a test. Two timeframes agreeing is the same prices read twice, and each one adds settings that can be fitted to the past.

Read next