Bar Replay: how and why to test a strategy in the past

 

Bar Replay enables users to simulate past price movements for strategy testing. This tool assists traders in refining strategies by analyzing historical market behavior and practicing trading decisions without real financial exposure. It offers a risk-free, interactive, and dynamic way to enhance your trading skills, refine strategies, and gain valuable insights into historical market behavior.

Contents

This article provides a comprehensive overview of this feature, offering a step-by-step guide on using it for strategy testing and simulated trading.

Why do traders need Bar Replay?

Historical trading starts at a selected point with a controlled replay speed that allows traders to see how a strategy could play out. But, Bar Replay isn’t just about exploring the past, it can help traders think ahead for the future. Here are some of the key benefits of Bar Replay.

Strategy refinement. Test and refine trading strategies with historical price analysis and simulated trading, identifying areas for improvement.

Realistic learning. Traders can simulate real market conditions, gaining practical insights into strategy performance.

Historical insights. By studying past price movements, traders can uncover patterns and trends for informed decisions.

Risk-free practice. Beginners are able to practice without real financial risk, building confidence and experience before live trading.

Customized speed. Replay speed adjusts for various learning paces, allowing traders to get comfortable with tools and strategies.

How to use Bar Replay: a step-by-step guide

Getting used to any new feature is a challenge. Here is a quick how-to guide to get you started.

Open Bar Replay. To begin, locate the Bar Replay button on the top panel of your chart — it’s the button that resembles a rewind button on videos. Click to open the replay panel.

Navigate playback. Once inside the replay panel, you'll notice playback buttons that function similarly to those in media players. Try these buttons for yourself and explore how they work for navigation.

Select starting point. The chart will now allow you to choose a starting point for your replay. Hover your cursor over the chart screen, a blue vertical line with scissors will appear. Click on the specific date and time you wish to start from.

In this section, you can select specific dates, allowing you to make any bar within the chart’s history your starting point for the replay, without manually moving the chart. In the same way, you can also choose the "Select the first available day" button to use the first day of the chart as your starting point. Additionally, you can choose the random bar function which will take you to a random bar within the chart.

Start the playback. Click the Play button to initiate the replay. You can control the replay speed before or during playback according to your preferences.

Manual advancement. Slow the replay down to get all the details. To move forward one step at a time, simply click the Forward button.

Monitor status. On the corresponding status displayed on the chart, you can see when Bar Replay is running. When you see the replay symbol, the chart is in replay mode. You won’t see this symbol if you’re not replaying.

Change starting point. Even if the replay is running, you can switch to a different starting point. Choose from “Select bar,” “Select data,” or “Random bar” to add a starting point for your analysis.

Multiple charts. You can synchronously run the Bar Replay on all charts of the layout and track the dynamics of changes in one or completely different symbols at different timeframes at one point in time.

When switching to a workspace with several charts, you can select a replay mode: one current chart or all.

In single chart mode, the replay can be launched on only one of the charts, and it will not differ from what it was before.

In the “All charts” mode, when you select the starting bar, the starting line will appear on all charts of the layout, and while you choose the starting point on one, the charts are synchronized in time so that the point from which replay will begin on each chart is in the visible area.

Replay is synchronized in time, so if the charts have different timeframes, then charts with large timeframes will wait when playing until data from charts at smaller timeframes appears, that is, for example, on a chart with a weekly timeframe, a new bar will not appear until on a chart with a daily timeframe 7 bars will not load at timeframes.

End the replay.You can stop the replay and return to live data by using the "Jump to real-time chart" button. This brings you back to current market conditions instantly.

Close the replay panel. To close the replay panel, either click the [X] button on it or click the Bar Replay button again at the top of the chart.

How to use drawings and indicators in Bar Replay

Using drawings and indicators in Bar Replay and on a regular chart is a little different in terms of purpose and function. 

In Bar Replay, drawings act as annotations for historical price data, assisting in strategy testing. You can create drawings, and they will be saved after the closing of Bar Replay. 

Indicators provide insights into past price movements based on selected parameters, evaluating indicator performance for strategy improvement. In Bar Replay, indicators can be used to replay data for calculations. 

What's the maximum depth of data history?

The length of historical data in Bar Replay can vary depending on the selected symbol and chart timeframe. For daily and daily-based timeframes, we display all available data on the chart, and the same data can be used in the Bar Replay mode. For intraday timeframes, TradingView keeps a limited amount of data, and the length in Bar Replay varies depending on the plan. 

Essential plan
  • Calculated using the formula: now to 6 weeks back, multiplied by timeframe in minutes
  • The higher the timeframe selected, the more intraday data is available

Example

You can go 6 weeks back on the 1-minute chart, 12 weeks back on the 2-minute chart, 30 weeks back on the 5-minute chart, 90 weeks back on the 15-minute chart. 

Plus plan
  • Calculated to give more historical intraday data for Bar Replay: now to 6 months back multiplied by timeframe in minutes
  • The higher the timeframe selected, the more intraday data is available

Example

Plus users have access to 6 months of 1-minute data. For a 2-minute timeframe, this limit is doubled, and a year of 2-minute data is available; for 3-minute it is tripled and 18 months of 3-minute data is available. 

Subscription

Seconds-based timeframes

1-minute
chart

2-minute
chart

3-minute
chart

5-minute
chart

15-minute chart

Essential

-

6 weeks

12 weeks

18 weeks

30 weeks

90 weeks

Plus

-

6 months

12 months

18 months

30 months

90 months

Premium and  professional plans

Our Premium and professional plans (Expert and Ultimate) provide even more historical intraday data for Bar Replay and allow you to play absolutely all data available in TradingView's data storage. By “all data” here we really mean all historical data that we have, with no extra limitations set. For all time intervals, whether it’s 1 hour, 1 minute or even 1 second, you’ll get access to the maximum depth of data history and you’ll be able to play it in the Replay mode as far back as the symbol’s data is available on TradingView.

The amount of historical data may vary depending on the selected symbol and chart timeframe. On intraday timeframes, TradingView keeps a limited amount of data. As a result, the length of the data on intraday timeframes may be shorter than on daily ones. For example, if you play NASDAQ:AAPL on a daily timeframe, the daily history starts from December 12, 1980, while 1-minute AAPL data starts from January 3, 2000, and the earliest 1-second bar in Replay dates from August 17, 2022.

For some symbols, we have 1-minute data as far back as 2011, for some, back to 2009, while for others, the data can extend even further, back to 2000. So, you can play up to 20+ years of minutes data in the Replay mode. At the same time, other symbols have shorter intraday history, therefore less data is present in Replay.

For all seconds-based timeframes, TradingView stores the data starting from August 2022, and the earliest seconds-bar in Replay dates from 2022-08-17.

So, Premium and professional-tier plans can replay the data as far back as the symbol’s data is available in our storage. Here are some examples:

SymbolInitial 1-second barInitial 1-minute barInitial daily bar
NASDAQ:AAPLAugust 17, 2022January 3, 2000December 12, 1980
NASDAQ:MSFTAugust 17, 2022
January 3, 2000
March 13, 1986
SP:SPXAugust 17, 2022
January 3, 2000
January 1, 1871
TVC:VIXAugust 17, 2022
April 8, 1997January 3, 1990
TVC:DXYAugust 17, 2022
March 13, 2007January 31, 1967
FX:EURUSD
FX:GBPUSD
August 17, 2022
November 28, 2001January 4, 1971
BITSTAMP:BTCUSDAugust 17, 2022
August 18, 2011August 18, 2011
BITSTAMP:ETHUSDAugust 17, 2022
August 7, 2015August 7, 2015

 

Please note that the above-mentioned replay limits for each plan are not applied to continuous futures charts — 1! and 2! symbols (for example, ES1!, BANKNIFTY1!), and to futures contracts with the enabled setting "Use settlement as close on daily interval" as they have their own special intraday limitations due to their synthetic nature and it's not possible to play more than 20K intraday bars in the Replay mode.

To find out where the initial replayable bar for a certain symbol according to your subscription is, please turn the Replay mode on, choose “Select date…” in the dropdown at the replay panel and then press “Select the first available day”.

So, you can initiate the replay from the very first bar or any other bar within the available history from the “Select date” menu.

Additionally, to access deep intraday data, you can select the starting point for Bar Replay on a higher timeframe and then switch to a lower timeframe. For example, if you want to play older 1-minute bars, you can go to the daily timeframe, turn on the Replay mode, choose the “Select bar” option, and select the starting point manually somewhere on the chart within your plan's limits. Then, switch to a 1-minute timeframe and press Play.

If the specified starting point for the replay is too far away and there is no data available for the selected time period, Bar Replay will automatically bring you to the first available bar.


When you switch timeframes from higher to lower ones, it may happen that there is data available on the higher timeframe (e.g. 1 day) that is not available on the lower time frame chart (e.g. 1 min) as the intraday plan’s limit has been reached or there is no intraday data in our data storage this far back in time. In this case, you will see the message “Data point unavailable” in the bottom left corner of the chart, and your timeframe remains unchanged.

If you want to use a lower timeframe in Replay anyway, you need to choose a starting point where a lower timeframe data is available by using the “Select date” option  →  “Select the first available day”.

Which hotkeys for Bar Replay you can use?

Getting from A to B as quickly as possible is important for everyone. Hotkeys can be used in Bar Replay to help you quickly and conveniently control playback from the keyboard, without having to use your mouse or trackpad.
To start or stop playback, simply press Shift + ↓
To move one step forward, just press Shift + → 

What else do you need to know to get started?

As you move through the potentials that Bar Play offers, you’ll find out more about the feature and how it works in practice. Here are some helpful hints to get you started. 

  • Server-side alerts persist based on real-time data
  • Generating new server-side alerts is not feasible during replay
  • Trading orders (including Paper Trading and other brokers) are executed using real-time data
  • Quotes visible on the trading panel and in the quotes list align with real-time data when in replay mode
  • Non-standard chart types are incompatible with Bar Replay
  • Regression Trend and Fixed Range Volume Profile tools are inactive during replay 
  • It is not possible to replay bars in smaller segments 
  • Bar Replay does not work with spread charts and tick-based charts

What if my Bar Replay isn’t working as it should?

We always strive to keep things running smoothly, but in the rare case that Bar Replay isn’t working as expected, there are a couple of things you can do.

  • If the Bar Replay isn’t displaying the desired data, this may be for a number of reasons, for example, there is no data available for this time period or if no data is available under the plan. In these cases, access to data is not possible.
  • Should the problem persist, you can always check out our Help Center. Here, you can find the answers to some of the frequently asked questions or reach out to our support team.