backtesting.py
backtesting.py copied to clipboard
How to plot enter trade events
Sorry if I missed it in the documentation, but how one plots the trade events (long or short)? It's hard to understand from the candlestick chart when exactly the position was opened (the beginning of the dashed line). Thanks!
There are only trade exits on the P/L triangles plot.
I considered adding a gray line extending from trade entry to its exit triangle (I thought I uploaded an example image somewhere on the forum, but now I can't find it), but that has yet to manifest.
The relevant code is to be added here: https://github.com/kernc/backtesting.py/blob/65f54f6819cac5f36fd94ebf0377644c62b4ee3d/backtesting/_plotting.py#L400-L426