INNER CODE UNIT · Python
StrategySaveOHLCVToDF
WISEPLAT/backtrader_moexalgo · DataExamplesMoexAlgo/02 - Symbol data to DF.py:10
class StrategySaveOHLCVToDF(bt.Strategy):
"""Saves OHLCV in DF"""
params = ( # Parameters of the trading system
)
def __init__(self):
self.df = {}
self.df_tf = {}
def start(self):
for data in self.datas: # Running through all the requested tickers
ticker = data._name
self.df[ticker] = []
self.df_tf[ticker] = store.get_interval(data._timeframe, data._compression)
def next(self):
"""Arrival of a new ticker bar"""
for data in self.datas: # Running through all the requested tickers