Two indicators with different scale values...how to fix that?

 

Hi everybody!

I'm triyng to code an indicator based on MA's in a separate window but the problem appears with the last one i want to add...in the following pic you can see that the red MA (which is a "Drag & Drop" MA from the left panel) is in a different scale over the others.I found the behavior of this red moving average visually very valuable but "out of scale" and thinking in programming terms,it's impossible the calculation of crossing.The new lines of code i've attached failed because,although the 3 MA's appear,they continue with bad scalling.The white and yellow are drawn on the zero line an the red on the MA price level....Is there any way to fix that problem?

Many thanx in advance!!

Best regards.

 

Some code would be helpful, otherwise I have to resort to 'if-but-unless-maybe' suggestions rather than saying 'this line here is the problem'

MAs of what? not price, as all pass through 0 line! DIFFERENCE of MAs will need to be scaled somehow perhaps.

I can give one suggestion though - lines plotted on same chart should use same units. Things like RSI scale to 0 - 100.

If the Red source is different to White & Yellow source, you will have to convert to some common scale. Things like ATR might help

One rule-of-thumb is ATR(Timeframe* 4) = 2 * ATR(Timeframe). i.e. as Timeframe quadruples, ATR doubles.

 

Norbert:

I'm triyng to code an indicator based on MA's in a separate window but the problem appears with the last one i want to add...in the following pic you can see that the red MA (which is a "Drag & Drop" MA from the left panel) is in a different scale over the others.

Moving average of price can not be out of scale.

Your indicator is calling iMA or iCustom, so the Drag&Drop is irreverent. Your indicator should be displaying the source iMAs so you know it's getting the correct inputs.