Hello good people,
[First post, usually newbie disclaimers apply.]
below is a simple implementation of buy and hold strategy written purely for learning the system. Strategy buys one security as long as there is cash available, then holds all position, re-investing the dividends as they become available.
My question is: Which portfolio is used as comparison in backtesting?
Example below is trading S&P 500 ETF and by running the backtest it becomes obvious that the comparison portfolio used is also S&P 500. But what if I trade AAPL, GOOG or any other single stock? One valid test is to compare the trading strategy to an index, yet there are other valid comparisons one may want to try:
- Compare algorithm to S&P 500 (this seems to be the default)
- Compare algorithm with another index/ETF of my choice
- Compare algorithm to a buy and hold strategy for the same portfolio.
- Compare to a specified portfolio
Is there a way to specify any of the above? Documentation shows the example of using a percentage of the most liquid stocks, usefulness of which I find limited.
Thanks,
Vlatko