Back

System.IO not permit

The System.IO is not permit in algorithm why ?

The sample in Rest Api use the System.IO.MemoryStream

///
/// When we have a new event trigger, buy some stock:
///

public List GenerateFromURL(string url)
{
List events = new List();
byte[] rawData = null;
string line;

using (var wc = new System.Net.WebClient())
rawData = wc.DownloadData(url);

MemoryStream stream = new MemoryStream(rawData);

using (StreamReader sr = new StreamReader(stream))
{
sr.ReadLine();
while ((line = sr.ReadLine()) != null)
{
Weather w = new Weather(line);
events.Add(w);
if (w.errString != "")
Debug("Weather Err:" + w.errString);
}
}

return events;
}


How to find a solution ?

Update Backtest








Good catch ysos, we were tightening security on a bunch of libraries but forgot about this use case. In the long run perhaps we'll can permit that use case again -- however since we launched the new LEAN engine there is a better way to use custom data -- please see the NIFTY algorithm which uses two custom data types.

You can define the data source, the type of the object, and then the event handlers, and we'll automatically fetch, cache and stream the data into your algorithm.
0

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.


Update Backtest





0

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.


Loading...

This discussion is closed