Open
Description
Original Discussion Post: #355
There's something that I noticed which makes it difficult to view indicator graph on the chart if you're backtesting for longer period. Below is an example of an indicator view on the chart without zooming in. Notice the y axis scales.
Now, when I zoom in to focus on a specific period when ttm squeeze value stayed between -5 to +5, it still shows the full scale from -15 to+20. which makes it really hard to visualize the indicator chart. See below.
I know that re-scaling is allowed for the price chart/Volume. Is that something that can be implemented on the indicator charts as well?
Activity
zlpatel commentedon May 22, 2021
I fiddled around with the code and made it work :)
Here's what I did:
I have added code
right above
backtesting.py/backtesting/_plotting.py
Line 526 in 0a76e96
then,
right below these lines
backtesting.py/backtesting/_plotting.py
Lines 610 to 611 in 0a76e96
then,
right below these lines
backtesting.py/backtesting/autoscale_cb.js
Lines 30 to 33 in 0a76e96
Here's how it looks on the graph:
Without Zooming in:

When Zoomed in:

[-]Allow Auto-scaling of Y axis values for Indicator(when overlay=False) when you zoom in or out the chart.[/-][+]Auto-scale Y-axis for indicators when zooming[/+]Auto-scale Y-axis for indicators when zooming kernc#356
Auto-scale Y-axis for indicators when zooming kernc#356
Auto-scale Y-axis for indicators when zooming kernc#356
Auto-scale Y-axis for indicators when zooming kernc#356
Auto-scale Y-axis for indicators when zooming kernc#356
Auto-scale Y-axis for indicators when zooming kernc#356
Merge pull request #1 from zlpatel/kernc#356
Auto-scale Y-axis for Profit/Loss chart when zooming kernc#356
Auto-scale Y-axis for PL chart when zooming kernc#356
Add auto scaling of y-axis for PL chart kernc#356
Add whitespace after , to fix lint issue kernc#356
[-]Auto-scale Y-axis for indicators when zooming[/-][+]Auto-scale Y-axis for indicators and Profit/Loss graph when zooming[/+]17 remaining items