Back

Custom data Symbol has ticker DataType.Symbol, so SetHoldings says price == 0?

Hi,

 I created a custom data class for my PortfolioWeight object, which loads pre-calculated portfolio weights from a file. The Data class sets PortfolioWeight.Symbol == config.Symbol. The ticker for this symbol is PortfolioWeight.Ticker, so for this test data. "PortfolioWeight.184840". My bar prices for this ticker have the ticker "184840" , so then SetHoldings looks up the price, it is not found. 

I would like to get around this gracefully - my custom data is not a tradeable instrument, the identifiers are meant to be linked to symbols for tradable equities in my universe.  

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.


Hi George,

Did you set the value and date fields for your custom data? And how is your custom data organized? You should set the symbol for your PortfolioWeight object to the symbol of the security the portfolio weight belongs to. It is difficult to determine how to exactly debug your algorithm without more context. Please post a code snippet or a back test if possible. This will help greatly in figuring out how to proceed.

Best
Rahul

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.


Rahul,

I was surprised that the framework gave my data object the ticker PortfolioWeight.ticker, it seems counterintuitive. But I worked around it by forcing the object to have the same ticket as the stock it belongs to. 

I was able to resolve the issue of the Time being reset to the beginning of the session so I am now just loading my data from a file at the beginning of the init() method. 25 million rows load and are processed into a lookup by date in about 30 seconds. This is a small amount of time, be use the overall simulation cannot run in any reasonable amount of time, i am not sure why. 

 

0

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