The moving average indicator does not have inherit scale

 
I want to add two moving averages on the same sub-window, but because they do have not `inherit scale` so the mt5 draws them almost in the wrong way.
 
milad: I want to add two moving averages on the same sub-window, but because they do have not `inherit scale` so the mt5 draws them almost in the wrong way.

The built-in moving average indicator cannot be set to a sub window unless there is already an existing subwindow.

So please explain in more detail, and show your code if relevant, as well as screenshots to help explain.

 
Fernando Carreiro #:

The built-in moving average indicator cannot be set to a sub window unless there is already an existing subwindow.

So please explain in more detail, and show your code if relevant, as well as screenshots to help explain.

I mean exactly built-in moving average. If you add some of them in the same sub-window and scroll the chart to the left or right, moving average lines move and braid together while you scroll.

As you said, this is ok behavior.

 
milad #: I mean exactly built-in moving average. If you add some of them in the same sub-window and scroll the chart to the left or right, moving average lines move and braid together while you scroll.

As you said, this is ok behavior.

You are only able to add a moving average to existing window, with the intent of using one of the following "Apply to" options:

  • Previous Indicator's Data
  • First indicator's Data


For all other "Apply to" options, the scale will NEVER match.

You will have to program your own custom indicator if you want to combine multiple moving averages with the same scaling.

 

This is however a trick you can use:

  1. Create a sub-window by adding an RSI for example.
  2. Add a moving average to it of Type: SMA, Period:1, Price: Close, Style Colour: none
  3. Delete the RSI from the sub window
  4. Add a new moving average (any parameters) and choose Apply to: First indicator's Data
  5. Add another new moving average and choose again Apply to: First indicator's Data 

You now have two visible moving averages and one hidden one, all with the same scale.


 
Fernando Carreiro #:

This is however a trick you can use:

  1. Create a sub-window by adding an RSI for example.
  2. Add a moving average to it of Type: SMA, Period:1, Price: Close, Colour: none
  3. Delete the RSI from the sub window
  4. Add a new moving average (any parameters) and choose Apply to: First indicator's Data
  5. Add another new moving average and choose again Apply to: First indicator's Data 

You now have two visible moving averages and one hidden one, all with the same scale.


Thank you, it's working perfectly.
👏👏👏