Conversion of Williams Percentage values to Stochastic range values

17 Views Asked by At

This may appear redundant to some, as well as if this has been done before - please direct me to where this may be found. However I am attempting to create a specific type of indicator for trading that overlays Commodity Channel Index,Williams Percent Average stochastic and a bunch of others over one another to create an average plot of all the values.

The issue I run into is that due to the Williams and Commodity channel index have negative values. Obviously this would not be an accurate calculation.

So my problem:

Need to convert Williams percentage values to fit in the standard stochastic range of 20-80 (As CCI and Williams could technically “approach infinity in a sense”

0 to 20 of the plot would have to represent -infinity and 80-100 would have to represent +infinity essentially.

Now as Williams has a local range of -80 to -20 with the respective lower and upper bounds extending to their infinity positions. I need some advice on if it is possible to convert this to the stochastic bound. I have played around with various homemade formulas but to no avail as the change in multipliers is not linear.

For simplicity:

Williams range (-80,-20) Stochastic range (20,80)

Convert Williams range to stochastic range, I.e:

-80 to 20 -20 to 80

With all the values in between converted correctly, as well as all the values above the upper bound and the one below lower bound extending to “infinity”

I am merely looking for suggestions as the rough idea is:

x = willaims_value
if x > 50
multiplier = desired_value / williams_value
converted_value = williams_value x multiplier
if x < 50
converted_value = williams_value / multiplier

However as I am sure you can see the issue with this is that it is not linear, and rather tedious to manually find the desired values for one’s that are not multiples of 5 or 10.

If you need any further clarity, please let me know

If further clarity is required. Please let me know. I understand it is not correct but I