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

when changing the filter data, the layout is totally wrong #54

Open
raptoravis opened this issue Jul 12, 2023 · 7 comments
Open

when changing the filter data, the layout is totally wrong #54

raptoravis opened this issue Jul 12, 2023 · 7 comments

Comments

@raptoravis
Copy link
Contributor

image

when changing the filter data, the layout is totally wrong.
in the picture above, I added the secondary data feed and when I tried to see the secondary data feed.

I am looking at it but, it too many things are unclear..., if any clue?

@happydasch
Copy link
Owner

all this issues result from the update to bokeh 3.

b7c2fd1

The code before this commit should work live with bokeh < 3.

All was updated except the live plotting code. I will try to explain what is needed to be done to get it running in the other issue.

@raptoravis
Copy link
Contributor Author

raptoravis commented Jul 12, 2023

thanks very much, I've already tried bokeh 2.4.3....

@raptoravis
Copy link
Contributor Author

raptoravis commented Jul 13, 2023

I tried 2.4.3, but the live plotting is still wrong(the candle is not correct, I think it is caused by the constant change clock, so I tried to cached the clock)

I made a PR, #55, the candle can be correctly rendered though there are still some glitches. to see #53 with 1, 2, 3 problems.

thanks

@raptoravis
Copy link
Contributor Author

raptoravis commented Jul 13, 2023

and, why the clock uses the following, to use the last part except the first one?

        self._clk_cache = sorted(set(self._clk.array[-len(self._clk) + 1: last_index]))

@happydasch
Copy link
Owner

I saw your PR, a lot to go through but looks fine at first sight. the issue with the last index:
#48

Not really sure how to handle the last candle, since backtrader seems not to forward the latest candle until it is complete. It's some time ago since i worked on that so i do not remember correctly all the things. There were also some issues with the updating of data source vs setting a completely new data source and so on. As i never used that part of btplotting it did not get updated or worked on.

@raptoravis
Copy link
Contributor Author

image
@happydasch also, please review this line, it looks like the old one is incorrect.

@raptoravis
Copy link
Contributor Author

raptoravis commented Jul 13, 2023

image
and this code, If I understood it correctly, the code is used to exclude the fist one instead of the last one right? but, your sayings above is to exclude the last? yes, the data feed's last one is nan and I think it should be excluded.

if I understand it correctly, it should be

return sorted(set(self._clk.array[ : -1]))

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