Hi , I am trying to play around with the example stategy, but can´t get the data feed to work. What am i missing ? (AttributeError: 'NoneType' object has no attribute 'close')
Quandl returns the fx-data with a column rate instead of close.
#!/usr/bin/python
from datetime import datetime
import backtrader as bt
class SmaCross(bt.SignalStrategy):
params = (('pfast', 10), ('pslow', 30),)
def __init__(self):
sma1, sma2 = bt.ind.SMA(period=self.p.pfast), bt.ind.SMA(period=self.p.pslow)
self.signal_add(bt.SIGNAL_LONG, bt.ind.CrossOver(sma1, sma2))
cerebro = bt.Cerebro()
data = bt.feeds.Quandl(dataname='CURRFX/GBPEUR', apikey='xxxxxxxx')
cerebro.adddata(data)
cerebro.addstrategy(SmaCross)
cerebro.run()
cerebro.plot()