Multi-Timeframe Analysis#

In live trading, a single timeframe is often not enough. You might want to use the daily chart to gauge trend while using the 5-minute chart for entries, or compare a stock against its index. MultiCharts lets you load several data series onto one chart, and a script can read all of them.

Data Series Numbering#

The main chart symbol is Data1 — this is what scripts read by default. Additional series are numbered Data2, Data3, and so on, up to Data50 in current MultiCharts versions.

  • When a script writes Close, High, or Volume, it reads from Data1 by default.
  • To read from another series, append of dataN, e.g. Close of data2, High of data2.

Adding a Data Series#

Right-click the chart → Format → Add Symbol (or Insert → Symbol, depending on version) → pick the symbol and resolution → assign it to Data2 (or a higher number). The new series appears as a subchart or overlay.

Reading Data2#

1
2
3
4
5
6
7
8
// Close of Data2
Value1 = Close of data2;

// Prior bar's high on Data2
Value2 = High[1] of data2;

// 20-period MA computed on Data2
Value3 = Average(Close of data2, 20);

Bar Synchronization#

When the chart holds resolutions of different sizes (e.g. Data1 = 5-minute, Data2 = daily), the smaller resolution drives script execution. What Data2 returns depends on the Realtime-History Matching (RHM) option.

Where to find it: Format Indicator/Signal → Properties (Backtesting for signals) → Advanced → Realtime-History Matching checkbox. It is enabled by default.

Why RHM Exists#

In backtesting, every bar is already closed; the script walks forward bar by bar, and each Data1 bar reads a Data2 value that is already completed at that moment in time. In real time, however, Data1 and Data2 tick at different rhythms — reading Data2’s current (possibly unfinished) value produces results that do not match backtest output. RHM controls whether real-time calculation should imitate backtest behavior (time-aligned, closed bars only) so that the two stay consistent.

RHM Enabled (default)#

The script is calculated on the latest bar of Data1 and the currently completed bar of Data2.

With Data1 = 5-minute, Data2 = daily:

  • The script runs once per 5-minute bar.
  • Throughout today’s 5-minute bars, Close of data2 returns yesterday’s daily close and does not change tick by tick.
  • Only after today’s daily bar closes does Close of data2 update to today’s close.

This is the most common and easiest-to-reason-about mode, and it keeps backtest and real-time results aligned.

RHM Disabled#

The script is calculated on the latest bar of Data1 and the current (completed or not) bar of Data2.

In the same scenario, Close of data2 refers to the currently forming daily bar; its value updates with every new tick on Data1. This reacts faster but can produce mismatches between backtest (which only has closed historical bars) and real-time results.

Multi-Timeframe Example#

Use the daily chart for trend direction and the 5-minute chart for entries. Go long on the 5-minute chart only when the daily close is above its 20-day MA.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Inputs: TrendLength(20);
Variables: DailyMA(0), Trend(false);

// Data2 is the daily series; with RHM on (default), Close of data2 is the last completed daily bar
DailyMA = Average(Close of data2, TrendLength);
Trend = Close of data2 > DailyMA;

// Entry on Data1 (5-minute)
If Trend and Close crosses over Average(Close, 20) Then
  Buy ("Long") next bar at market;

If MarketPosition = 1 and Close crosses under Average(Close, 20) Then
  Sell ("Exit") next bar at market;

Relative Strength Example#

Compare the main symbol with a benchmark index. Enter long when the stock outperforms the index over the lookback window.

1
2
3
4
5
6
7
8
Inputs: Length(20);
Variables: StockRet(0), IndexRet(0);

StockRet = (Close - Close[Length]) / Close[Length];
IndexRet = (Close of data2 - Close[Length] of data2) / Close[Length] of data2;

If StockRet > IndexRet and MarketPosition = 0 Then
  Buy ("RS Long") next bar at market;

Notes#

  • Alignment: Different symbols may have different sessions and holidays. When Data1 has a bar but Data2 does not, price functions on Data2 return the prior bar’s value.
  • Backtest speed: More data series means slower backtests. Two or three series are usually enough for most strategies.
  • Order routing: By default, buy and sell commands execute on the data series the signal is applied to (normally Data1). To trade Data2, apply the signal directly to Data2.
  • RHM setting: RHM is on by default; keeping it on minimizes backtest/real-time divergence. Only turn it off if the strategy genuinely needs intraday values from the forming higher-timeframe bar.

Reference#

https://www.multicharts.com/trading-software/index.php?title=Multiple_Data_Series

https://www.multicharts.com/trading-software/index.php?title=Of_Data

https://www.multicharts.com/trading-software/index.php?title=Realtime-History_Matching