algorithmicStrategiesWinningStrats&Rational

Common Backtesting Pitfalls

Look Ahead Bias

Means your using future information to make a prediction at the current time. A common example would be to use a day’s high or low price to determine the entry signal of the same day during a backtest. Essentially a programming error and can only affect a backtest program because theres no way a live trading program can get future information.

.

Data Snooping & Linearity


howToBuildAlgo - Ernie Chan

How Capital Availability affects your many choices

Low Capital High Capital
Prop trading firms membership Retail Brokerage Account
Intraday Intraday and interday (overnight)
Directional Directional or market neutral
Small stock universe for intraday trading Large stock universe for intraday
trading
Daily historical data with survivorship bias High-frequency historical data,
survivorship bias–free
Low-coverage or delayed news source High-coverage, real-time news source
No historical news database Survivorship bias–free historical news
database
No historical fundamental data on stocks Survivorship bias–free historical
fundamental data on stocks

The upshot here is that the more regularly you want to realize profits and generate income, the shorter your holding period should be. There is a misconception aired by some investment advisers, though, that if your goal is to achieve maximum long-term capital growth, then the best strategy is a buy-and-hold one. This notion has been shown to be mathematically false. In reality, maximum long-term growth is achieved by finding a strategy with the maximum Sharpe ratio (defined in the next section), provided that you have access to sufficiently high leverage.

Information Ratio = Average of Excess Returns / Standard Deviation of Excess Returns

where Excess Returns = Portfolio Returns − Benchmark Returns

Sharpe ratio is actually a special case of the information ratio suitable to compare across different strategies where everyone agrees on what the risk free rate is. Info ratio you could be swapping out the risk free rate is to use certain benchmark returns. For example, trading small cap stocks only you should use the Russell 2000 instead of the S&P 500.

A higher Sharpe ratio will actually allow you to make more profits in the end, since it allows you to trade at a higher leverage. It is the leveraged return that matters in the end, not the nominal return of a trading strategy.

How will transaction costs affect the strategy?

Market orders you are paying the bid ask spread. Limit orders you avoid liquidity costs but incur opportunity costs because limit orders may not be executed missing out on potential profits of the trade. When you buy or sell large chunks you will not be able to complete the transaction without impacting the prices at which the transaction is done.

Transaction costs vary widely for different kinds of securities. You can typically estimate it by taking half the average bid-ask spread of a security and then adding the commission if your order size is not much bigger than the average sizes of the best bid and offer