Hi all;
In writing a C# algo I am getting the following warning:
warning CS0618: 'Security.SetDataNormalizationMode(DataNormalizationMode)' is obsolete: 'This method is obsolete. Use the 'SubscriptionDataConfig' exposed by 'SubscriptionManager' and the 'SetDataNormalizationMode()' extension method'
This occurs on the code:
// Security security
security.SetDataNormalizationMode(DataNormalizationMode.Adjusted);
However, QCAlgorithm.SubscriptionManager only has a SubscriptionDataConfigService (no SubscriptionDataConfig) property. And that property does not have a SetDataNormalizationMode() method.
So where is this?
thanks - dave
Fred Painchaud
Hi David,
Nice one. I'd say that warning message needs a bit of review. But then, it would not be a warning message anymore… 😊
I can track the model used of SubscriptionDataConfigExtensions over SubscriptionDataConfig….. but I can't really track where it starts. It looks like the very general case where one (most likely a LEAN dev) would want to iterate over all subscriptions in the manager and set data norm mode…
From a client perspective, it looks more like the SetDataNormalizationMode method defined on Security (the base class) was moved down to two sub-classes for which data norm makes sense: Option and Equity. So if your security object is an equity, it should really be an instance of Equity. If you treat it like so, you will be able to call SetDataNormalizationMode on it without a warning.
Fred
David Thielen
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!