Pine Script
À propos de la leçon

To see the results of the backtest, we use the “Strategy Tester”. Backtesting is a technique for evaluating the historical performance of a strategy by simulating and analyzing its past results on historical market data.

The “Strategy Tester” module is available for all scripts declared with the strategy() function. It makes it easy to view strategy backtesting results and analyze hypothetical performance results.

 

The tab « Overview » of the « Strategy Tester » allows you to visualize the equity and drawdown curves on a simulated sequence of transactions. The summary table uses two scales: the left is for the equity curve (in green/red) and the right is for the drawdown curve (in purple).

Curve of the evolution of the equity for the backtest

 

The tab « Performance Summary » presents a complete overview of a strategy’s performance metrics, with profits, drawdown, sharpe ratio,…:

Backtest performance summary of the strategy

 

The tab « List of Trades » provides a granular overview of the transactions simulated by the strategy with information such as execution date and time, order type used,…:

List of trades taken during the backtest period

 

Finally, the tab « Properties » provides detailed information on the configuration of a strategy: backtest date range, symbol information (asset, timeframe,…), script parameters and strategy properties (capital initial, commission, slippage,…).

Properties of the strategy

 

The strategy tester allows you to quickly see if the strategy you have developed is effective. However, the backtest is carried out on a limited history.

To calculate the strategy on all available historical data (or on a specific date range), you must use the « Deep Backtesting » functionality. This feature requires a paid Trading View subscription.

 

Note that currently, Trading View does not support automated trading. Strategies can run in backtest, but they cannot submit a real/live order on a trading platform (like Binance).

 

Participer à la discussion