Combining MACD and Stochastics

 

Hi fellas,

Im want to ask if any of you previously had to combine indicators in 1chart in one mq file. Im combining macd and stoch, but the chart window get all wrong.

Any ideas?

  limit=rates_total-prev_calculated;
   if(prev_calculated>0)
      limit++;
//--- macd counted in the 1-st buffer
   for(i=0; i<limit; i++)
   {
      ExtMacdBuffer[i]=iMA(NULL,0,InpFastEMA,0,MODE_EMA,PRICE_CLOSE,i)-
                    iMA(NULL,0,InpSlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
     ExtStochBuffer[i]=iStochastic(NULL,0,InpKPeriod,InpDPeriod,InpSlowing,MODE_SMA,0,MODE_MAIN,i);               
   }
   return(rates_total);
  }
 
Stanislav Ivanov:

Hi fellas,

Im want to ask if any of you previously had to combine indicators in 1chart in one mq file. Im combining macd and stoch, but the chart window get all wrong.

Any ideas?

You combine two indicators with totally different values interval. Stochastic from 0 to 100 and MACD depends on the symbol but it could be from -0.002 to 0.002. If you want to combine two indicators in one window you have to normalize both indicators values.
 
Petr Nosek:
You combine two indicators with totally different values interval. Stochastic from 0 to 100 and MACD depends on the symbol but it could be from -0.002 to 0.002. If you want to combine two indicators in one window you have to normalize both indicators values.
The thing I’m mostly interested is overlapping one over the other. By normalising will this be done this way?
Thank you 
Reason: