my Indicator-calculations works fine with 100 close-data (oneColum-array).
class myIndi(bt.Indicator): def next(self): lastdataclose = np.array([self.data.get(size = 100)])
But now I need to enhance oneColumn to 4Column-array (OHLC).
But my cerabro explodes...
lastdataOHLC = [[self.data.open[0:100], self.data.high[0:100], self.data.low[0:100], self.data.close[0:100]]]
->Gives: "TypeError: unsupported operand type(s) for +: 'int' and 'slice'"
lastdataOHLC = [[self.data.open, self.data.high, self.data.low, self.data.close]] for i in range(1,100): lastdataOHLC = np.append(lastdataOHLC,[[self.data.open[i], self.data.high[i], self.data.low[i], self.data.close[i]]], axis=0)
-> works, but finally Breakes cerebro.run() after a while, even in un-vectorized mode (runonce=False)): "index out of range"
All data should exist. but how address and slice? which array?
Or can be read out from self.array? self.linebuffer? self. lineseries?
Needs to be build with np.append?
How to have  actuell within realtimeTrading? with every "next" the strategie?
Where to place it?
- Indicator-Class: init or next?
- Strategie-Class: init or next?
And finally the 4Column-Array (OHLC) will need even more columns (Indicator-values) without crashing the framework.
Anybody with this usecase?
I could not find anything in docs and community-topics...
Thanks and Cheers in advance!
What is the point of using this
lastdataclose = np.array([self.data.get(size = 100)])
but not simply this
lastdataclose = self.data.get(size = 100) # baktrader approach
it is needed to be an numpy-array finally, to be understood by Tensorflow.
But anyway, this works, as this is an oneColumn-array with only close-data.
The question is, how to get an OHLC-fourColumn-array, in which the first row  allways actuell ...
I have printed it out and "self.get.data" only gives close-data, not the whole row of data, with OHLC, Volume, date...right?!