Assess the viability of trading strategies with backtesting. (Part 2)

Pooja Porwal
DataSeries
Published in
4 min readJul 30, 2020

And how to read it?

Previously, we have learned how to backtesting trading a strategy using a simulator, this time we will talk about how to read the backtest results of a strategy that has been run before. And if you have not read the previous article, click on the link below to gain a better understanding of Assess the viability of trading strategies with backtesting Part 1

Testing trading strategies across all sectors can be time-consuming, luckily we have a trading robot platform, an algo vanguard Streak.world that lets us backtest and run scanners across multiple stocks and timeframe just by a click of a button

Getting Started

After you create an algo and click on run backtest, the system starts checking for all the signals that got generated during the selected period for that algo

Illustration 2: Backtesting a strategy on Streak. world

Here is a list of parameters that are required to run a backtest.

  • Initial capital: It represents the hypothetical maximum capital allocated for the backtesting of each contract. Initial capital acts as the maximum capital that will be used by the algo during the backtesting.
  • Quantity: It represents the trading quantity to be used by the algo. After the backtest is run with a quantity, the same quantity value is used when the algo is deployed.
  • Stop-loss percentage is the value used to calculate the stop loss level once the hypothetical entry position has been taken.
  • The target profit percentage is the value used by algo to calculate the target profit price once the hypothetical entry position has been taken.
  • Candle Interval is defined as the time frame of each candle interval. The time frame for the period for which the backtest is to be conducted.
  • Backtest period is the lookback period to perform a backtest and is defined by selecting the start and stop date for the backtest where traders can change the start and end date of the backtest period but the period range is limited based on the candle interval
Illustration 3: Understanding the backtest result

Backtest Results

On clicking the “Run Backtest” button, a fresh backtest is run for each in by first fetching all the appropriate historical market data for the respective instrument and initializing all the user-defined parameters. The historical market data is then processed to generate hypothetical trade signals and hypothetical trades are performed using the hypothetical initial capital.

Based on these hypothetical trades, certain performance metrics such as hypothetical profit/loss, winning streak, losing streak, etc. are generated to provide a generalized and simplified understanding of the algo’s hypothetical returns and risk. All the hypothetical trades generated are shown in the transactions table along with profit/loss and portfolio values during every trade.

Backtest P&L: The cumulative P&L realized after taking all the trades generated through the algo.

Wins vs Losses: Displays the number of trades that ended up being profitable and the ones that weren’t. This important piece of information can help you decide whether your Risk/Reward ratio based on stop loss/profit-target & average loss/losing trade v/s average gain/winning trade is favorable or not.

Winning Streak (WS): The highest number of subsequent winning trades, one after another.

Losing Streak (LS): The highest number of subsequent losing trades, one after another.

Max Drawdown (Max DD): Max drawdown measures the largest decline in the P&L curve at any given point of time.

Conclusion

Backtesting is the process of testing a trading strategy on relevant historical data to ensure its viability before the trader risks any actual capital. A trader can simulate the strategy and analyze the results. The results of all the backtest are hypothetical and do not guarantee or portray in any form or manner any future performance or returns. The backtest results are a hypothetical representation of algos performance and do not provide any guarantee to accuracy in data and are subject to limitations like rounding off, memory buffer limits, user’s browser, system limitation, data availability, accurate data, etc.

Based on these hypothetical trades, certain performance metrics such as hypothetical profit/loss, winning streak, losing streak, etc. are generated to provide a generalized and simplified understanding of the algo’s hypothetical returns and risk. All the hypothetical trades generated are shown in the transactions table along with profit/loss and portfolio values during every trade.

--

--

Pooja Porwal
DataSeries

Fintecher | Global Payments | Making Web3 safe | Blockchain | DeFi