Back

Framework Algorithm - manual universe: Runtime Error: An item with the same key has already been added

Hello,

I'm trying to create a universe with forex symbols from Oanda, but I get this error:

Runtime Error: An item with the same key has already been added. Key: 11/03/2017 20:00:00

although the symbols are different:

instruments=['EURUSD','EURJPY']
symbols = [Symbol.Create(instrument, SecurityType.Forex, Market.Oanda) for instrument in instruments]
self.SetUniverseSelection( ManualUniverseSelectionModel(symbols) )

Can somebody help please?

Thanks
Daniele

Update Backtest







Please see the attached framework algorithm, can't repeat the same issue with ManualUniverseSelectionModel().

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.


I recreated the algorithm and it looks like there are no problems anymore, maybe I was doing something wrong.

0

When any of our algorithms has a exception method that we don't understand and cannot debug, the best procedure is to simplify the code as much as possible and share it with the community so that we can reproduce the issue and work on a solution.

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