Inspired by T Smith idea to implement Gary's Antonacci's dual momentum approach to ETF
selection in "IN OUT" strategy.
-The execution code has been completely changed to keep levarage under control and avoid
insufficient buying power warnings.
-To calculate returns I used widely used in industry momentum with excluding period.
-Modified components that are more in line with the strategy.
-The IN OUT part of the strategy has not changed except for some cosmetics
to make it more readable for myself.
"DUAL MOMENTUM IN OUT" nearly doubled "IN OUT" Net Profit while maintaining risk metrics at the same level.
Compounding Annual Return
30.164%
Sharpe Ratio
1.667
PSR
97.773%
Beta
0.057
Drawdown
19.300%
Annual Standard Deviation
0.154
Here is my second version of "DUAL MOMENTUM-IN OUT".
Yuri Lopukhov
I wish the framework would do these calculations for me, it shows really small exposure and drawdowns even for thousands of contracts ;)
Here is a backtest for 60 contracts of SPY options. Not sure how much margin this requires…
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.
Thomas
Very nice code Yuri. Thank you so much for sharing .
A few points
60 contracts mean initial margin of ~50k USD on IBKR. You account size should be at min 60k USD.
Delta 0.01 means that there is 1% chance of assignment when u open your position (if you got assigned at SPY put strike 400, $2.4millon cash will be deducted from your account for 6,000 shares of SPY).
I would argue that 7% annual return is not worth the risk
2. Delta =0.01 is very illiquid. We may not get the trade fill and if it's filled it's not easy to get out. So need paper trade to understand if liquidity is an issue. In my experience it's super hard to fill 60 contracts for delta 0.01 or even 0.02 or 0.03
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.
Thomas
In my opinion , we need to decide when to run the algo. Some days when J.P speaks or CPI data are being released for examples are super volatile. Traders can take market in either up or down direction. We should avoid those days or weeks with those days. I did some analysis for the last 1 year- Days with big drawdown for the strategy are when fed releases the meeting minutes, CPI , jobless claims , JP speaks or days after CPI were release.
Traders need to make some judgement to run or not to run the strategy. For example this week we have FOMC minutes tomorrow, Initial jobless claims on thu. I think we need to avoid running the algo this week
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.
Yuri Lopukhov
I wish the framework would do these calculations for me, it shows really small exposure and drawdowns even for thousands of contracts ;)
Here is a backtest for 60 contracts of SPY options. Not sure how much margin this requires…
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.
Thomas
Very nice code Yuri. Thank you so much for sharing .
A few points
60 contracts mean initial margin of ~50k USD on IBKR. You account size should be at min 60k USD.
Delta 0.01 means that there is 1% chance of assignment when u open your position (if you got assigned at SPY put strike 400, $2.4millon cash will be deducted from your account for 6,000 shares of SPY).
I would argue that 7% annual return is not worth the risk
2. Delta =0.01 is very illiquid. We may not get the trade fill and if it's filled it's not easy to get out. So need paper trade to understand if liquidity is an issue. In my experience it's super hard to fill 60 contracts for delta 0.01 or even 0.02 or 0.03
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.
Thomas
In my opinion , we need to decide when to run the algo. Some days when J.P speaks or CPI data are being released for examples are super volatile. Traders can take market in either up or down direction. We should avoid those days or weeks with those days. I did some analysis for the last 1 year- Days with big drawdown for the strategy are when fed releases the meeting minutes, CPI , jobless claims , JP speaks or days after CPI were release.
Traders need to make some judgement to run or not to run the strategy. For example this week we have FOMC minutes tomorrow, Initial jobless claims on thu. I think we need to avoid running the algo this week
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.
Yuri Lopukhov
I wish the framework would do these calculations for me, it shows really small exposure and drawdowns even for thousands of contracts ;)
Here is a backtest for 60 contracts of SPY options. Not sure how much margin this requires…
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.
Thomas
Very nice code Yuri. Thank you so much for sharing .
A few points
60 contracts mean initial margin of ~50k USD on IBKR. You account size should be at min 60k USD.
Delta 0.01 means that there is 1% chance of assignment when u open your position (if you got assigned at SPY put strike 400, $2.4millon cash will be deducted from your account for 6,000 shares of SPY).
I would argue that 7% annual return is not worth the risk
2. Delta =0.01 is very illiquid. We may not get the trade fill and if it's filled it's not easy to get out. So need paper trade to understand if liquidity is an issue. In my experience it's super hard to fill 60 contracts for delta 0.01 or even 0.02 or 0.03
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.
Thomas
In my opinion , we need to decide when to run the algo. Some days when J.P speaks or CPI data are being released for examples are super volatile. Traders can take market in either up or down direction. We should avoid those days or weeks with those days. I did some analysis for the last 1 year- Days with big drawdown for the strategy are when fed releases the meeting minutes, CPI , jobless claims , JP speaks or days after CPI were release.
Traders need to make some judgement to run or not to run the strategy. For example this week we have FOMC minutes tomorrow, Initial jobless claims on thu. I think we need to avoid running the algo this week
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!