Last September someone wanted to import custom data, and because of security restrictions, QuantConnect does not allow System.IO. I would like to revisit that restriction please.
I am writing an Alorithm for Abhi Goal, a fellow member, and he wants to read in some custom data upon which to base his trades. Call it a custom indicator. QC allows me to get data from an http:// call using WebClient and I would like to process the return data as a Stream. I would like to use StreamReader on the return from the call, but I could live with putting the returned csv data into a String and reading it into a MemoryStream and pass the MemoryStream to my parsing class. Streams are nice because I can grab a line at a time with one call.
I suppose could rewrite the parser to get the lines from the string variable, but that is painful what with having to parse for newlines and substring the result.
Thanks,
Nicholas Stein
Michael Handschuh
Nicholas Stein
Nicholas Stein
Nicholas Stein
Michael Handschuh
AddData("MyIndicator", Resolution.Daily);
It doesn't need to be market data, we have examples that import weather data! The defaults for AddData< T > set fill forward=false, so you'll receive data in your OnData(MyIndicator data) only when there's new data on the irregular spacing. When that method fires, place your trade. It should be pretty simple. If you'd like more help, share the csv format. I wouldn't try to lift that data into a QC indicator type or try and merge it with the trade bar information. I think that may be unneeded complexity.Nicholas Stein
AddData("ABHIGOAL", Resolution.Daily);
It looks like the only place I can add the Security is in the Initialize function. In the OnData handler tried adding the Security usingAddSecurity(SecurityType.Equity, symbol, Resolution.Daily);
but it did not add it. Is there any way to add a Security after Initializing the algo and it is running? When I read the whole list in during Initialize, I was able to loop through and add all the symbols. Of course I do not know the symbols until I get the data. Thanks, NickMichael Handschuh
Nicholas Stein
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!