Trouble scaling Moving Average into the 0-100 scale subwindow - page 2

 
Fabio Cavalloni #:

"The only thing you can do is to normalize the MA values to express it like an oscillator, but will be totally different of what you see right now."

No not totally different. Try it. Experiment with the baseline and scaling factor to modify the normalisation. Only sometimes the slope is "squashed" due to normalisation, but it also depends on the window size
 

It sounds like you want a moving average with dynamic levels, to make a "perceived" 20 and 80 level, but the levels must be dynamic to respect the fact that the range of a moving average isn't fixed

I created this before, but it's not common at all mind you. If you want I can share the code. But you really need to think clearly about what you set out to do before you set out to do it, otherwise there is no real goal, no real objective, and only confusion for people on the forum. You should clearly understand the differences between fixed range indicators and trend indicators that don't have a fixed range.


Fixed range indicators:

CCI, RSI, Stochastic


Unbounded indicators:

Moving average, macd, ADX, bollinger bands

 

I modified your code again, this time you get a normal moving average with dynamic levels that constantly update (like the thing that I made in the past)


this time the levels actually correspond to relative price values, and as you can see, there is no need to cause distortion on the plot with scaling

I make the levels adjustable in the input

 
Conor Mcnamara #:
Nobody clearly knows your objective. What is your main objective? When you start any topic, that should be made clear. Without knowing your true objective, its impossible for you to be helped.

It sounds like you want to put an MA on a stochastic or RSI, but you haven't mentioned those indicators so nobody actually knows what your goal is.
okay so let me explain the idea behind the exponential ma in the subwndow and the relevence of the 80 level and the 20 level these as i like to see them reflect the momentum of the market when the ma is above 80 we are now looking for potential Sell entries and when its below the 20 we are now looking for potential buy entries so thats the goal they kind of act as support and resistent levels
 
Conor Mcnamara #:
Nobody clearly knows your objective. What is your main objective? When you start any topic, that should be made clear. Without knowing your true objective, its impossible for you to be helped.

It sounds like you want to put an MA on a stochastic or RSI, but you haven't mentioned those indicators so nobody actually knows what your goal is.
okay one way alternative way i had considered was to use a template but for the 80 and 20 level i added horizontal lines so that if the EMA  crosses paths with eaither of these i would know exactly how to respond
 
Conor Mcnamara #:

I modified your code again, this time you get a normal moving average with dynamic levels that constantly update (like the thing that I made in the past)


this time the levels actually correspond to relative price values, and as you can see, there is no need to cause distortion on the plot with scaling

I make the levels adjustable in the input

oh wow  let me check it out
 
Conor Mcnamara #:

I modified your code again, this time you get a normal moving average with dynamic levels that constantly update (like the thing that I made in the past)


this time the levels actually correspond to relative price values, and as you can see, there is no need to cause distortion on the plot with scaling

I make the levels adjustable in the input

Amaizing this here's a comparison of the desired output so clearly it works but scaling is an issue though i might have to adjust a bit the current state would forget about interday trading but become an swing trade but it looks good thank you

Custom MA vs desire MAResult zoomed out scale

the above image is zoomed in  as you can see the yellow ma touches the 80 level and the 20 level a couple of times but the Custom MA doesnt 

below are results when we zoom out on the trading terminal so it clearly works very well on a larger scale

Zoomed out max REsults

 
ZhuwaoAbel #:

Amaizing this here's a comparison of the desired output so clearly it works but scaling is an issue though i might have to adjust a bit the current state would forget about interday trading but become an swing trade but it looks good thank you

the above image is zoomed in  as you can see the yellow ma touches the 80 level and the 20 level a couple of times but the Custom MA doesnt 

below are results when we zoom out on the trading terminal so it clearly works very well on a larger scale


You are comparing with an indicator with the name "stoch" which signifies stochastic. That is a different indicator. It's not a mere moving average.
In my scaled version of the moving average, there's a "window size" input, this is the amount of bars it should look back to find minimum and maximum buffer sizes. The smaller the window size the less distorted the moving average will be...but you also need at least up to 200 bars so it remains visible.
Focus on the non scaled version, because it was already discussed that scaling a moving average isn't necessary. Learn about the stochastic indicator as well.
 

If you would modify the values you can find a sweet spot... this would be a very decent normalization with minimal distortion:

If you will lower the window size, it will be looking at more recent bars for max and min values...and it will turn it into something like an oscillator

have fun with it

Files:
 
Conor Mcnamara #:
The smaller the window size the less distorted the moving average will be

I meant to say the smaller the window, the more distorted it will be