Hello,
I've been having some trouble with a particular set up, where I attempt to use a custom coarse universe that uses the standard TradeBar objects. In initialize I have:
AddUniverse<TradeBar>("myCustomUniverse", Resolution.Daily, SelectCoarse);
And for “SelectCoarse”
public IEnumerable<Symbol> SelectCoarse(IEnumerable<TradeBar> tbs)
And unfortunately, selectCoarse will refuse to output/input anything, and result in a backtest completing in a singular second.
If anyone knows how to help, I beg you, cus the alternatives I've found force me to run out of memory.
Fred Painchaud
Hi Nicholas,
Sorry to read you're having issues. I will try to help you out.
Would you be able to post your entire code? Did you read this?
From the code you posted, it looks like your method:
public IEnumerable<Symbol> SelectCoarse(IEnumerable<TradeBar> tbs)
should accept an IEnumerable<CoarseFundamental>, instead of <TradeBar>. It might be just that small mistake which makes the engine not find the method with the correct/expected signature. But with complete code, it would be possible to see if other issues are present or not.
Cheers,
Fred
LordNile
Hello Fred,
Please see the attached backtest. Although, I am fairly confident that <TradeBar> is correct, at least for what I intend to do. I wish to use tradebars instead of CoarseFundamental data for the use of creating ichimoku objects. Although, It may just not be possible, but I thought I'd ask and make sure.
Fred Painchaud
Hi Nicholas,
No sorry, you cannot receive TradeBars in the coarse selection. This is by design. Coarse selection is sending very specific information coming from a specific dataset, in the form of CoarseFundamental objects. And CoarseFundamental objects are not TradeBar objects - you can't see CoarseFundamental objects as TradeBar objects, so to speak.
Your universe coarse selection will need to be based on something else than Ichimoku, something simpler I'd say. Then of course, you can certainly track the Ichimoku for all selected assets in your Universe. But that's a different topic.
Don't give up!
Fred
LordNile
Ah! That is totally okay! The backtest I shared didn't feature the on-data solution, but I did end up using trade bars from there instead, and I found some ways to cut down memory usage. Thank you for the answer though!
LordNile
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!