Back to Community
Dual Moving averages clone w/ major indices

First backtest I have posted, this site is awesome! Instead of using this strategy w/ individual stocks I chose major market etfs (i.e. spy, dia, qqqq). I changed the long moving average to 100 days from 50, left the short moving average at 10. I added one line that adds commissions per shares traded (not sure how realistic this is, I don't trade in real life) I really like the way this performs during major downturns in SP500.

Clone Algorithm
Backtest from to with initial capital ( data)
Total Returns
Information Ratio
Benchmark Returns
Max Drawdown
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 50b8c993e61d5250895487b1
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.
7 responses

I noticed I need to fix some of the comments to accurately represent changes I made.

@Andrew, great share!

The commissions rate you have is on the high side for per share commissions - you can find prices between $0.005 and $0.001 per share from direct market access brokers like Interactive Brokers. The commission model lets you specify a per trade commission as well, which you would see at a retail broker. That cost would be more like $7-$10 per trade. If you assume 100 share trades, your current per share commission actually resembles the cost of a retail broker.

@John Thanks for the Info and kind words.

I ran another full backtest with sight modifications to the above algo; is there anyway I can post it in this thread instead of making a new post/newthread?

@Andrew, sorry! not yet. It comes up a lot. As a work around, people have posted a comment and pasted the algo code in using the "fence posts" that you can insert to mark a code block (triple back quotes before and after your code, code sample button above will insert them for you).

You can post the code in a reply, but you can't post a backtest in a reply - at least not yet.

Hello Fawce,

To get the $0.005 to $0.001 per share commission from direct market access brokers, what are the typical minimums, restrictions, etc.? For example, does this assume a certain daily/monthly/yearly number of shares traded? What is the implication for the amount of capital required to be "in the game"? I understand that Quantopian is planning/hoping to set up live trading with real money. I think that it would be helpful to provide some initial guidance on the barriers to entry. Realistically, how much capital would need to be ventured?

Hi Andrew,

Could you explain the "context.invested" code?