pythonlessons / RL-Bitcoin-trading-bot

Trying to create Reinforcement Learning powered Bitcoin trading bot
MIT License
380 stars 208 forks source link

Utils - Unpacking the deque Render_data list without using a specific index #22

Closed Botman-Hotman closed 1 year ago

Botman-Hotman commented 1 year ago

Hello,

I am a bit confused about how your TradingGrpah.Render function deals with deque list Render_data.

Your code is the following:

self.render_data.append([Date, Open, High, Low, Close])

# Clear the frame rendered last step
self.ax1.clear()
candlestick_ohlc(self.ax1, **self.render_data**, width=0.8/24, colorup='green', colordown='red', alpha=0.8)

for this to work on my end I have to reference an index of the deque list like so:

self.render_data.append([Date, Open, High, Low, Close])

# Clear the frame rendered last step
self.ax1.clear()
candlestick_ohlc(self.ax1, **self.render_data[0]**, width=0.8/24, colorup='green', colordown='red', alpha=0.8)

If I don't do this and use your method I get the following error:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

or this if I pass my data in the same way using df.loc[current_step]

ValueError: not enough values to unpack (expected 5, got 0)

Any suggestions?

pythonlessons commented 1 year ago

It's not full error I assume

Botman-Hotman commented 1 year ago

No not full error, It just dosent make sense, what version of python did you write this in?

Botman-Hotman commented 1 year ago

Please Ignore, I found the error in my ways.