Strategy
Buy:
- Price above 200 day MA, and
- Price above the 50 day MA, and
- Price sets a new 10 day low
Sell:
- Price drops below the 50 day MA, orIn order to check if our signals provide an edge we compared it to a random strategy. We will be calling this our 'base case' and the signals are:
- Price sets a new 10 day high, or
- Position has been open for 10 days
Base Case
Buy:
- None
Sell:
- Random day in the next 1 to 10 daysWe've also created a portfolio function that allows us to account for our initial investment, commissions, and slippage; it will also avoid fractional ownership. Our portfolio parameters are:
Portfolio
- 5,000 initial investmentWe conducted 10,000 scenarios with each being a possible sequence of trades over the duration of our analysis. Here is our data:
- 3.95 comission
- Random slippage of [-.5%, .5%] of the target price
Chart Legend
- Gray: end of trade portfolio values for all 10,000 scenarios
- Blue: middle 25% of gray values
- Red: the return of buying and holding SPY
2007
2008
2009
2010
2011
2012
Code:
Language: Python 2.7
Third party packages: NumPy, matplotlib
FileSnack zip folder: http://snk.to/f-c7k56nnx
GitHub main program: https://gist.github.com/theBrokeQuant/5746064
The FileSnack link has everything we'll need to run our program; it's a zipped folder that contains:
FileSnack zip folder: http://snk.to/f-c7k56nnx
GitHub main program: https://gist.github.com/theBrokeQuant/5746064
The FileSnack link has everything we'll need to run our program; it's a zipped folder that contains:
- theBullsSupplier.py
- poorBoysData.py
- SP500.txt
- Empty folder 'Tickers"
I'm interested in working with your code and project. I really appreciate the work you've done so far. I've begun work here (https://github.com/chas11man/theBrokeQuant). I want to make sure that you get proper credit and that I have your permission to work with your code. I looked at your github page but I could only find the code on your gist page. I added links to both this blog and your gist page in the readme, but I want to ensure that you are happy with the credit. Please let me know what I can do to ensure proper credit and permission. Thanks for the work you've done. Currently I'm running into an index out of bound error but I'd love to work with you on developing the code. I'm going to be working on it myself, but if you're interested in any sort of collaboration I'd be more than happy to work with you.
ReplyDeleteWhat are the best casinos to play in 2021?
ReplyDeleteWhich casinos offer slots? ford fusion titanium — Casino Sites. Best casino sites are those https://vannienailor4166blog.blogspot.com/ that allow players to try a game septcasino from anywhere. The most common casinosites.one online slots 바카라 사이트