I am writing a script that calculates the angle of the trend and for the calculations to coincide with my chart, I use the same "Lock price to bar ratio" setting for the chart and the script. The problem is that each asset has a different price and for correct angle calculations, I need to manually change this setting for each asset. However, if you disable this setting and enable auto scaling, TradingView will automatically calculate the optimal price to bar ratio for the chart. Is there any formula for automatic calculation of this price to bar ratio or other solutions to the problem?
"Lock price to bar ratio" button: