← All videosTHE SHORT VERSION
Explore more ↗

backtesting / algotrading / walk forward testing

Backtesting vs Data Analysis

If you want to trade like the people on Wall Street, you need to understand the difference between backtesting and data analysis. A backtest is a historical simulation of how a set of trading rules performed, with results like percent gain, Sharpe ratio and Sortino ratio. Data analysis on raw data can't do that. A query can't rebalance the top 10 stocks by market cap every 14 days with a stop loss, handle mergers, acquisitions and ticker changes, model limit orders, or become a live trading engine. Account for slippage, walk-forward optimization and dividends too.

Transcript

0:00If you're trying to trade stocks like the billionaires that work on

0:03Wall Street then you need to understand the difference between backtesting and data analysis

0:09Here's the key idea When you run a backtest you're performing a historical simulation of how a set of trading rules performed in the past

0:20A backtest might look something like this where you have a strategy a set of trading rules and then you see the historical results of these

0:32rules You can see things like the percent gain the

0:35Sharpe ratio

0:37the Sortino ratio This is how this set of rules performed across this period in the past

0:44This is different than data analysis because you need a simulation engine

0:49You can't just analyze the raw data Unless your strategy is extraordinarily simple like buy and hold or double down every 7 days then you need

0:59to write code to codify your trading rules For example you can't just write a query to create a trading strategy that rebalances the top 10

1:09stocks by market cap every 14 days and include a stop loss for that strategy

1:16You can't make it account for merger changing their names

1:24You can't make it account for limit orders And most importantly you can't use that simulation engine to deploy a live trading engine to execute trades

1:35in real time

1:37They're so distinctly fundamentally different that if I'm wrong I just want you to prove it

1:43Let me see the queries you write to get the same results as some of these strategies

1:49This is an easy one so you should have really no trouble at all

Join the conversation

Loading conversation…