Hi, I'm having trouble understanding how to use my custom data in conjunction with universe selection. I have a dropbox file that is updated daily with this format (ticker, date, signal1, signal 2). Basically, I would like to load each of those tickers into my universe before market open, and make trades using the rules in the file attached. This is how I'm retrieving the data from the dropobox:
public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, DataFeedEndpoint datafeed){
Signal signal = new Signal();
try{
string[] data = line.Split(',');
signal.Ticker = Convert.ToString(data[1]);
signal.Sig3d = Convert.ToDecimal(data[2]);
signal.Sig1m = Convert.ToDecimal(data[3]);
signal.Time = DateTime.Parse(data[4]);
}
catch (Exception){
return null;
}
return signal;
}
}
The code I currently have attached would only take signals and date to trade one ticker, I would like to make this modular and trade new tickers each with unique signals each trading day. Would i be able to save each line as an object? “ticker, sig3d, sig1m, date” and then use that object to load tickers into my universe?
I was planning on using DropboxUniverseSelectionAlgorithm.cs but im unsure how it would work with the code I have already written included below. Ideally, I would use the output from signal.Ticker to populate my universe every day at 9am. Let me know you have any ideas!
Varad Kabade
Hi Gil Cohen,
We recommend going through the following algorithm.
Best,
Varad Kabade
Gil Cohen
Hi, Varad! Thanks for your response, I tried using that algo to no success. I tried running the code as is to see if it works, but no data was pulled and no trades were taken. I'm unsure how to further debug it
Alexandre Catarino
Hi Gil Cohen,
Could you please share a backtest that shows the issue since the code snippet is not enough so that the community can help you further?
Best regards,
Alex
Gil Cohen
Here you go, Alexandre.
Alexandre Catarino
Hi Gil Sapir ,
Thank you for your patience.
You have shared the algorithm suggested by Varad, so the Community cannot help you with your particular case.
In principle, you can use the exact same algorithm but you need to modify the GetSource and Reader of the NyseTopGainers class, tweak this code block:
using Sig1m instead of TopGainersRank.
Gil Cohen
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!