Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Botman-Hotman opened this issue Oct 8, 2022 · 3 comments

Comments

@Botman-Hotman
Copy link

Botman-Hotman commented Oct 8, 2022

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
Copy link
Owner

It's not full error I assume

@Botman-Hotman
Copy link
Author

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

@Botman-Hotman
Copy link
Author

Please Ignore, I found the error in my ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants