Hey guys,
I have been trying to include Oanda Cfd data in my algorithm for hours, but did not manage to get it right.
I think I have done it how it was described in the documentation but it still does not work.
I would appreciate if you could let me know how I can get Oanda Cfd data. Forex data works flawless by the way.
import numpy as np
class BasicTemplateAlgorithm(QCAlgorithm):
def Initialize(self):
self.SetBrokerageModel(BrokerageName.OandaBrokerage)
self.SetCash(1000000)
self.SetStartDate(2007,01,01)
self.SetEndDate(2017,01,01)
self.SetWarmup(200)
self.AddCfd("XAUUSD", Resolution.Minute, Market.Oanda)
def OnData(self, data):
bar = data["XAUUSD"]
cfd = self.Securities["XAUUSD"]
if not self.Portfolio.Invested:
self.SetHoldings(cfd, 1)
Kind regards