As the most popular charting software tool, TradingView also allows you to backtest your strategy. This can be easily done with the Bar Replay tool. Now, if you wonder how to backtest on TradingView, you’ve come to the right place. In this article by Finestel, we’ll clearly explain how this can be done, both manually and automatically. We’ve also included several screenshots so you’ll know step by step how everything is done.
Key Takeaways
- Using the Bar Replay feature, you can manually backtest strategies by replaying historical price action and analyzing trades candle by candle.
- Code your strategy in Pine Script and utilize the Strategy Tester tab for automated backtesting and detailed performance analysis.
- You can backtest using the TradingView mobile app with the same Bar Replay feature. however, it’s less recommended for comprehensive analysis.
- Proper backtesting requires a paid TradingView plan to access sufficient historical data and advanced features like Deep Backtesting.
Backtesting in TradingView Full Guide Infographic
How to Backtest on TradingView Using Bar Replay?
If you’ve worked with TradingView in the past, you’ve probably seen the Bar Replay button above the chart. This tool essentially takes you back in time, as you can select a point in the past, and the chart will return to that time, but you won’t be able to see the candles after this point.
You can then click on the “Play” button to begin printing the candles one by one. The speed of this process can be set from one new candle per ten seconds up to ten new candles in one second. You can also move forward candle-by-candle and at your own pace by clicking on the Forward button. This way, you’ll be able to move on to the next candle with each click, making the process manual.
Don’t miss out – learn the secrets of autotrading on TradingView and transform your trading strategy now!
Moreover, you can select the bar you want to go back to on the chart or by entering a date and time. There’s also a relatively new option where you can go to a completely random bar. This is especially interesting, as you’d probably have no idea of the market conditions at that time.
Start your journey with the most advanced copy trading software on the market – your first week is on us!
It’s also possible to use the Replay Trading feature, the manual TradingView backtesting software. The Replay Trading tab is located at the bottom of the screen, which you can activate by clicking on it. Set your trades by specifying the volume and clicking on the Buy or Sell buttons. Setting stop loss and take profit orders is also possible by dragging the SL and TP lines directly on the chart. Reversing the position is also quite easy, as you only need to click on the reverse button.
Discover the best free indicators on TradingView to supercharge your trading strategy – read our guide now!
After you’re done with backtesting, or whenever you want to view your trading strategy‘s performance, take a look at the Replay Trading tab. You will be able to see an overview of your performance alongside the full list of the trades you’ve taken. You can also take screenshots using the Snapshot button on the top right and save them on your device or cloud storage for further analysis.
How to Backtest on TradingView Mobile App?
While I don’t recommend it, you can also backtest on the TradingView mobile app using the same Bar Replay feature. To do so, you should tap the three dots button below the chart area and select Bar Replay from the menu. The rest of the process will be exactly similar.
Automated Backtesting on TradingView
TradingView also allows you to backtest your trading strategy automatically. Of course, in order to do so, you’ll need your strategy to be written in code. First, enter and save your strategy’s code in the Pine Script located below the charting area.
Then, access the Strategy Tester tab, which is the dedicated TradingView backtesting software for automated strategies. It is located right next to the Pine Script tab. Load your strategy, and it will be tested on the selected time period, which is where the chart shows. You can also switch the Deep Backtesting toggle so the strategy can be tested on all the historical data of the selected symbol.
Similar to Replay Trading, a detailed analysis of your performance will be demonstrated in the Strategy Tester tab after the backtesting is done. Therefore, you can easily evaluate and optimize automated strategies directly on TradingView.
TradingView Backtesting Feature Pricing
You might’ve visited this article to find out how to backtest on TradingView for free. Well, it’s not possible, at least if you want to do it properly. You have to subscribe to a paid TradingView subscription plan to access sufficient historical data and even features like Deep Backtesting, which we’ve already mentioned.
Yet, things can get a bit complicated, as you should consider the data and features offered on each plan before subscribing. So, here’s a brief overview of the TradingView backtesting prices based on each paid plan’s features:
Plan | Essential | Plus | Premium | Expert | Ultimate |
---|---|---|---|---|---|
Price | $14.95/month
($155.40/year) |
$29.95/month
($299.40/year) |
$59.95/month
($599.40/year) |
$239.95/month
($2399.40/year) |
$599.95/month
($5999.40/year) |
Bar Replay: Historical Data by the Minute | 42 Days | 180 Days | All | All | All |
Bar Replay: Historical data by the second | – | – | All | All | All |
Strategy Tester | Yes | Yes | Yes | Yes | Yes |
Export strategy data | No | Yes | Yes | Yes | Yes |
Deep Backtesting | No | No | Yes | Yes | Yes |
Conclusion
In this article, we’ve thoroughly explained how to backtest on TradingView, either manually or automatically. Yet, it is not really possible to do so for free as you’ll need to subscribe to a paid plan in order to access the complete features and historical data. With a wide range of tools, numerous symbols, and tons of data, however, it is safe to say that using the TradingView backtesting features is worth it for serious traders.
Great article. One question: how far back can you go while backtesting on TradingView?
Well it depends on the plan. In my case, I use the Essential plan which allows you to go back 6 weeks on the 1-minute chart, 12 weeks on the 2-minute chart, 30 weeks on the 5-minute chart, and 90 weeks back on the 15-minute chart. These are the intraday timeframes, as I’m a day-trader.
I was totally unaware that you can also execute orders while backtesting on TradingView with the bar replay. However, is there any option so you can calculate position size based on risk?
That’s the problem with backtesting on TradingView. I don’t think it’s possible to do so (yet). Maybe try using some alternatives like FX Replay (it uses TradingView charting but is a dedicated backtesting tool).
I’m here for the strategy tester. Sadly, a lot of these backtesting platforms do not offer automated backtesting features like TradingView does. And guys, come on, if you can’t code a strategy, you can backtest it properly 😀