[BUG] marker position get displaced when plot second time
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
Reproducible in:
OS: Windows 10 finplot version: finplot-1.9.2 pyqtgraph version: 0.13.3 pyqt version: 6.5.2
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!
Thanks for being so prompt and helpful on this. I will always filter the indexes on my side for now