Hello QuantConnect Community,
I am new member to Quant community. I am not from Computer science or finance background. I learnt some concepts and i want to write my first algorithm.
The algorithm is described below
Source: Book - The Alpha formula
Author : Connors Research Team
Strategy:
Universe: etfs = [
# Equity
'SPY', # S&P 500
'IWM', # US Small cap
'QQQ', # NASDAQ
'EFA', #Developed Ex US
'EEM', #Emerging markets
'VNQ', #US RealEstate
'LQD', #US Inv. Grade Crops
# Fixed incomet
'GLD', # Treasury Bond
'SHY', # High yield bond
'IEF', #
'TLT', #
'AGG'
]
Rising Assets Strategy Rules
1. On the last business day of every month, invest in the top 5 assets with the highest
momentum score.
2. Sell any asset that was previously in the top 5 but has since dropped out.
3. Weight each asset by the inverse of its 63-day historical volatility.
Momentum Score
Our momentum score is the average of the last 1mo, 3mo, 6mo and 12mo trailing total
returns.
We opt for an unoptimized average of lookbacks. This is consistent with the method
Momentum Score Example:SPY 1 Month Return = +2.0%
SPY 3 Month Return = -4.0%
SPY 6 Month Return = +11.0%
SPY 12 Month Return = +8.0%
Average Return = (2% - 4% + 11% + 8%) / 4 = 4.25%
Result is a Momentum Score of 4.25%
Inverse Volatility Asset Weights
Asset weights are equivalent to the inverse of each asset’s trailing 3-month (63 trading
days) historical volatility. Volatility here is measured by the standard deviation of each
ETF’s daily returns.
This step serves to increase diversification in the portfolio as inverse weighting every
asset avoids one volatile asset from dominating the portfolio.
The typical effect of this step, compared to equal weighting the assets, is a slight decrease in
returns but a larger decrease in risk. This increases the return / risk metrics such as the
Sharpe Ratio.
Inverse Volatility Example:
SPY Std Dev = 0.10
EEM Std Dev = 0.20
Take 1 divided by each Std Dev observations and sum the results:
SPY 1 / 0.10 = 10
EEM 1 / 0.20 = 5
10 + 5 = 15
Divide each by the sum to get percent capital allocation:
SPY 10 / 15 = 0.666
EEM 5 / 15 = 0.333
Result is a 66.6% allocation to SPY and a 33.3% allocation to EEM
My doubts:
- Whats the period i should select for month, three, six month , 12 month i.e is it trading days or all days in months?
- How to calculate the volatality and asset allocaton ?
Derek Melchin
Hi Pardhu.
Best,
Derek Melchin
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Pardhu Nani
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!