Question about styleNoRescale and logarithmic chart

I have one Bollinger Band indicator (bottom BB thick dark red line) that plots incorrectly when using styleNoRescale and a logarithmic chart.

Without styleNoRescale, log chart looks like this (correct):
image

With styleNoRescale, here is log with automatic bar height (bottom dark red BB is wrong):
image

With styleNoRescale, here is linear with manual adjustment of Y axis to show bottom line (correct):
image

With styleNoRescale, here is log after clicking "Shorter bars" icon as many times as allowed (bottom BB is still wrong but in a different way):
image

Here is the code for those lines (with styleNoRescale):

Plot( BBandTop( C, BBPeriods, 3 ), "BB3 Top " + BBPeriods, BB3Color, styleThick | styleNoRescale, Null, Null, Null, -2 );
Plot( BBandBot( C, BBPeriods, 3 ), "BB3 Bottom " + BBPeriods, BB3Color, styleThick | styleNoRescale, Null, Null, Null, -2 );
		

Am I not supposed to be using styleNoRescale with a log chart? Or is it something else?

I just realized that the bad plot of the line occurs when the value of the line dips below zero.

Obviously I can adjust for this by using Max(). But it makes me ask: am I not supposed to use styleNoRescale with a log chart in the first place?

Remember that the log function is only defined for values > 0.

1 Like

There must be at least ONE plot without styleNoRescale (i.e. at least ONE plot must be used to actually set the scale).

Also Log charts need data > 0 because logarithm from 0 is minus infinity.

That makes sense. Thanks!

Thanks for letting me know, that makes sense.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.