Hi,
I am trying to port the example strategy : Momentum Effect in Country Equity Indexes, written in Python to C#. The results appear to be quite different. Upon closer examination of the ranking table at any rebalance point, there appears to be a discrepancy between momentum ranks in C# and Python (produced by MOM indicator). I've attached the python and C# versions here. Looking at the Debug Console:
Why is there a difference?
I am attaching the Python and C# codes below.
Ivan P Krotnev
...And the Python varsion...
Yiyun Wu
Hi Ivan,
We are sorry that there is an error with Python version code. The self.symbols list under the def Initialize(self) function lack comma between "EIDO" and "EWI", "NORW" and "EWY". These two pairs are served as a whole respectively, this is why "EWY" cannot be recognized and doesn't appear in the result. It will work and the results will be the same between C# and Python after adding comma.
Thanks!
Ivan P Krotnev
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!