
Backtest of an algorithmic trading strategy
- or -
Post a project like this1630
$215
- Posted:
- Proposals: 1
- Remote
- #3220287
- Awarded
Description
Experience Level: Entry
Estimated project duration: 1 - 2 weeks
Hi Dillon, I need to backtest an algorithmic trading strategy in PYTHON and have that backtest be modifiable by myself to change out or add securities, change time periods, and change leverage amounts for further testing. The strategy is as follows:
We have a universe of 12 securities: SPY, QQQ, EEM, IWM, GLD, VNQ, LQD, AGG, SHY, TLT, IEF, EFA. We score all securities based on the average of 1 month, 3 month, 6 month, and 12 month returns ie SPY returns= 3%,4%,5%,6% for the respective time periods. 3+4+5+6=18%/4=4.5%. We select the top 5 securities from our universe of 12 based on this score.
The weighting of those 5 securities is based on the inverse of each individual security's trailing 3 month standard deviation. Ex: Our portfolio holds SPY, EEM, QQQ... SPY Std Dev= .10, EEM Std Dev= .20, QQQ Std Dev= .40. Divide 1 by standard deviation and sum the results SPY- 1/.10=10, EEM- 1/.20=5, QQQ- 1/.4=2.5. 10+5+2.5=17.5. Divide each by the sum to get percent capital allocation: SPY 10/17.5=57.143%, EEM 5/17.5%=28.571%, QQQ=2.5/17.5=14.286%.
Final step: if the S&P 500 is above its 200 day moving average we add leverage of 1.5x distributed evenly amongst the 5 securities original weighting. To continue from the above example if the SP 500 is above its 200 DMA: SPY = .57143*1.5=85.715%, EEM= .28571*1.5= 42.857%, QQQ= .14286*1.5= 21.429%.
The portfolio is rebalanced monthly on the final trading day of the month. Agnostic as to time of day trades take place
The backtest should be from Jan 1, 2000 to Jan 1, 2021. Hope you can help me out.
Thanks Dillon,
Joe Morrissey, CFA
We have a universe of 12 securities: SPY, QQQ, EEM, IWM, GLD, VNQ, LQD, AGG, SHY, TLT, IEF, EFA. We score all securities based on the average of 1 month, 3 month, 6 month, and 12 month returns ie SPY returns= 3%,4%,5%,6% for the respective time periods. 3+4+5+6=18%/4=4.5%. We select the top 5 securities from our universe of 12 based on this score.
The weighting of those 5 securities is based on the inverse of each individual security's trailing 3 month standard deviation. Ex: Our portfolio holds SPY, EEM, QQQ... SPY Std Dev= .10, EEM Std Dev= .20, QQQ Std Dev= .40. Divide 1 by standard deviation and sum the results SPY- 1/.10=10, EEM- 1/.20=5, QQQ- 1/.4=2.5. 10+5+2.5=17.5. Divide each by the sum to get percent capital allocation: SPY 10/17.5=57.143%, EEM 5/17.5%=28.571%, QQQ=2.5/17.5=14.286%.
Final step: if the S&P 500 is above its 200 day moving average we add leverage of 1.5x distributed evenly amongst the 5 securities original weighting. To continue from the above example if the SP 500 is above its 200 DMA: SPY = .57143*1.5=85.715%, EEM= .28571*1.5= 42.857%, QQQ= .14286*1.5= 21.429%.
The portfolio is rebalanced monthly on the final trading day of the month. Agnostic as to time of day trades take place
The backtest should be from Jan 1, 2000 to Jan 1, 2021. Hope you can help me out.
Thanks Dillon,
Joe Morrissey, CFA

Joe M.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
100%
Last project
2 Jun 2021
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies