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

[BUG] marker position get displaced when plot second time #453

Open
skunkyevil opened this issue Oct 6, 2023 · 2 comments
Open

[BUG] marker position get displaced when plot second time #453

skunkyevil opened this issue Oct 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@skunkyevil
Copy link

Requirements (place an x in each of the [ ])**

  • [x ] I realize finplot is not a web lib. (Hint: it's native!)
  • [ x] I've read the snippets and not found what I'm looking for.
  • [ x] I've searched for any related issues and avoided creating a duplicate issue.
  • [x ] I've updated finplot (pip install -U finplot).
  • [x ] I've supplied the required data to run my code below.

Code to reproduce

The code along with csv files is inside attached .zip archive:
bug.zip

Describe the bug

I plot bars (1 minute, NQM23 contract), then I draw markers.
Please don't pay attention that markers are not tied to the prices and kind of "hang in the air".
The unexpected behavior is that when I plot marker_up second time, this set of marker is displaced by 4 bars (if you zoom into rightmost markers, see the image)

Expected behavior

When I plot marker_up second time it should appear in the same location as for the first time.

Screenshots

4_bars_distance

Reproducible in:

OS: Windows 10
finplot version: finplot-1.9.2
pyqtgraph version: 0.13.3
pyqt version: 6.5.2

@skunkyevil skunkyevil added the bug Something isn't working label Oct 6, 2023
@highfestiva
Copy link
Owner

This is a bug in finplot, caused by you plotting a bunch of indexes in that are not present in the first candlestick plot. A couple of examples:

2023-06-16 11:26:00 - present in marker_up, but not in ochl
2023-03-01 18:20:00 - present in marker_down, but not in ochl
2023-03-09 00:00:00 - present in marker_down, but not in ochl

etc. Anyway, this is the reason. To circumvent the bug, you can ensure all indexes are the same before plotting.

I seem to remember something related to how I implemented this which has to do with runtime updates. Perhaps this might be a bit difficult to fix. Please keep the issue open in the meanwhile, thanks!

@skunkyevil
Copy link
Author

Thanks for being so prompt and helpful on this. I will always filter the indexes on my side for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants