backtrader

Backtrader error: 'DataFrame' object has no attribute 'setenvironment'

我只是一个虾纸丫 提交于 2021-01-07 01:39:54
问题 I am new to backtrader, and I have a big problem. I want to start my strategy (just a simple GoldenCross strategy). This GoldenCross.py Script looks like this: import math import backtrader as bt class GoldenCross(bt.Strategy): params = (("fast", 50), ("slow", 200), ("order percentage", 0.95), ("ticker", "AAPL")) def __init__(self): self.fast_moving_average = self.bt.indicators.SmoothedMovingAverage( self.data.close, period=self.p.fast, plotname="50 day moving average") self.slow_moving

Backtrader error: 'DataFrame' object has no attribute 'setenvironment'

痴心易碎 提交于 2021-01-07 01:36:54
问题 I am new to backtrader, and I have a big problem. I want to start my strategy (just a simple GoldenCross strategy). This GoldenCross.py Script looks like this: import math import backtrader as bt class GoldenCross(bt.Strategy): params = (("fast", 50), ("slow", 200), ("order percentage", 0.95), ("ticker", "AAPL")) def __init__(self): self.fast_moving_average = self.bt.indicators.SmoothedMovingAverage( self.data.close, period=self.p.fast, plotname="50 day moving average") self.slow_moving

Backtrader error: 'DataFrame' object has no attribute 'setenvironment'

左心房为你撑大大i 提交于 2021-01-07 01:36:54
问题 I am new to backtrader, and I have a big problem. I want to start my strategy (just a simple GoldenCross strategy). This GoldenCross.py Script looks like this: import math import backtrader as bt class GoldenCross(bt.Strategy): params = (("fast", 50), ("slow", 200), ("order percentage", 0.95), ("ticker", "AAPL")) def __init__(self): self.fast_moving_average = self.bt.indicators.SmoothedMovingAverage( self.data.close, period=self.p.fast, plotname="50 day moving average") self.slow_moving