Hello everyone. I am just starting with LEAN and have already hit my second hurdle. With this algo, I am just trying to experiment with the framework, so the strategy is very basic. I get a manual selection universe with 3 equities ("MSFT", "MRNA", "MELI") and benchmark these against "SPY" over 3 weeks period using hourly resolution. For every change in securities, I compute MOM and KAMA parameters and if these meet certain criteria, I set the Insight Direction triggering "buy", "hold" or "sell" action.
When backtesting this algo, I get all sorts of inconsistencies. Firstly, security.Price only gets returned for "SPY" and it stays the same (i.e. 362.06) regardless. This makes all my checks (i.e. mom_dir >0 and price>kama ) completely irrelevant. My expectation was that every change invokes OnSecuritiesChanged method where I can capture market data, perform some analysis, and then use Update method to implement some action. Secondly, If I use self.SetPortfolioConstruction(MeanVarianceOptimizationPortfolioConstructionModel(Resolution.Daily,PortfolioBias.LongShort,1,63,Resolution.Daily,0.02,MaximumSharpeRatioPortfolioOptimizer(0,1,0)))) the whole model breaks apart giving me error even if I supply dummy magnitude value when constructing Insights.
I have gone through the documentation a number of times, searched this discussion board but still missing something.
anyone can shed some light on what I could be doing wrong?
thanks
AlexP
Lastly, if I get "GOOG.L" I get "Runtime Error: It is not possible to cast a non-finite floating-point value (NaN) as decimal. Please review math operations and verify the result is valid. Parameter name: input Overflow or underflow in the arithmetic operation. (Open Stacktrace)"
AlexP
sorted this out. help us no longer needed
AlexP
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!