Log scale for indicator ChartPanes?
Author: sourkraut
Creation Date: 4/2/2019 2:51 PM
profile picture

sourkraut

#1
Hi all,

I would like to suggest adding log-scale option to chart panes for indicators.
Please see the attached image as a demonstration, why that would be a benefit.

Thanks,

sourkraut
profile picture

Cone

#2
Here you go:

CODE:
Please log in to see this code.
profile picture

sourkraut

#3
Thanks very much, Cone.

Is there a way to make log scale the default for all new chart panes? Like adding a switch to the configuration file?

Tia,

S.
profile picture

Eugene

#4
Sure there is:

CODE:
Please log in to see this code.


To apply this to every Strategy window on open you might want to save the code snippet as Default template (Edit menu > Set as Default Template Code).
profile picture

sourkraut

#5
Thanks, Eugene, I'll give this a try.

S.
profile picture

Eugene

#6
You're welcome. Please note that the code uses an undocumented property. No harm done, however.
profile picture

rk089

#7
Hi,

unfortunately, setting ChartPane.LogScale = true does not change anything, the ChartPane still has a linear scale :(

WealthLab version is 6.9.23.1, .net Framework used: 4.7.2

Thanks,
Robin
profile picture

Eugene

#8
Robin, certainly you're doing something incorrectly.
profile picture

Cone

#9
Sure it changes it. Make sure that you compile the code and execute it.
profile picture

rk089

#10
i'm quite sure the correct code was executed since i checked it by changing the height too. The height adjustment was visible. Same for all other parameters provided with CreatePane
profile picture

Eugene

#11
Code from post #4 works without a doubt. If you have a different opinion, could you provide some insight into the context?
profile picture

rk089

#12
I've attached a simple example for reproducing and two screenshots. It's not quite like i said. After opening the strategy and selecting a symbol, the scale is log. But after maximizing the strategy window, it's linear again. If the window was maximized before selecting a symbol, it's linear from the beginning
profile picture

Eugene

#13
Problem is, your charts are not equal. The "linear from the beginning" includes white space on the left which forces linear scale. Once you change the data loading range, the scale will turn to logarithmic.
profile picture

rk089

#14
Ah, ok. But the lower price pane still is logarithmic, so apparently only additional panes are affected.

Can this be fixed with a future release? From a users perspective, this is a bug.

Even if i zoom into the chart, and the white space disappears, the scale is still linear. So the handling is quite cumbersome if i want to see a logarithmic chart for data of a short period of time

Many thanks,
Robin
profile picture

Eugene

#15
This topic deals with log scale for indicator panes but if you wish the PricePane to be logarithmic, please click the "Semi-Log" button.
profile picture

rk089

#16
Yes, this topic deals with log scale for indicator panes :)

But from a software developers perspective (which is typically mine) i just wondered why this is a problem when it's obviously not one for the price pane - that's all.

But ok, i have nothing to add here. As i said, it would be very nice if you add this to your backlog.
profile picture

Cone

#17
But it's not a problem. The pane in your code IS LOG. You just didn't a plot it with a series sufficient to perceive it visually.
Just try this code on something like a TSLA:

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).