Changing the scaling of LinearRegSlope?
Author: bentonjj
Creation Date: 11/30/2016 5:48 AM
profile picture

bentonjj

#1
Hello,

Is there any way to change the scaling used by the LinearRegSlope indicator? For example a .10 change over a certain period shows the same slope if looking at a $100/share symbol, a $10/share or even a $800 share symbol, even though this same change is a much bigger or smaller change depending on the share price.

For example the below code colors any 40 period bar for slopes over 0.02 or below 0.02 and seems to work fine for an issue close in price to $100:

CODE:
Please log in to see this code.


But for issues at a much lower price i.e. $10 does not reach those slope levels for extreme levels, and for more expensive issues i.e. $800 is overactive. Even for back testing the same issue where their are earlier periods where the price is very different from the current price prevents me from just changing the slope values being looked at. I figure using a baseline like 100 and dividing it by the bar close price then multiplying it by the slope value should equalize out the slope value by increasing it for smaller than $100 issues and reducing it for over $100/share issues. Here is the code:

CODE:
Please log in to see this code.


This seems to work just looking for a second opinion. Thanks.
profile picture

Eugene

#2
For some reason, ChartPanes (i.e. other than PricePane/VolumePane) do not support the LogScale property. It they did it would be simpler - just a click of the LogScale button on the Function toolbar.
profile picture

mezic11

#3
Have have simply divided the LRS by the price and multipled it all by 1000. Not perfect, but it helps normalize the magnitude of the slope.
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).