facing issue while trying to Plot Moving average and CCI inside one Custom indicator

 

Hi All.

I am trying to display moving average and cci inside of one custom indicator.
if you take a look at the attached screenshot you will see that the moving average looks like just a straight line , that is to be expected since moving average value is a lot less then the cci value.

I tried adding 200-300 in the value of the moving average but I feel like thats not the correct way , still tried it but no luck moving average was still a straight line , it was just plotted above the cci, then i tried adding the cci value to the moving average value and tried to use that as the value to draw the Moving average on , but still failed.


Here is my attempt to draw MA and CCI inside of the custom indicator :

   for(int i = limit-1; i >= 0; i--)
     {
        valueCCi= iCCI(Symbol(), PERIOD_CURRENT,14,PRICE_CLOSE,i);
        Buffer1[i] = valueCCi;

        valueMa= iMA(Symbol(), PERIOD_CURRENT,10,0,1,PRICE_CLOSE,i)  ;
        Buffer2[i] = valueMa;

     }

Hence i am posting here in search of a correct method to draw MA and CCI inside of one indicator.
any and all help will be highly appreciated 

Files:
 
ffST_ Rhodes:

Hi All.

I am trying to display moving average and cci inside of one custom indicator.
if you take a look at the attached screenshot you will see that the moving average looks like just a straight line , that is to be expected since moving average value is a lot less then the cci value.

I tried adding 200-300 in the value of the moving average but I feel like thats not the correct way , still tried it but no luck moving average was still a straight line , it was just plotted above the cci, then i tried adding the cci value to the moving average value and tried to use that as the value to draw the Moving average on , but still failed.


Here is my attempt to draw MA and CCI inside of the custom indicator :

Hence i am posting here in search of a correct method to draw MA and CCI inside of one indicator.
any and all help will be highly appreciated 

Please using   iCCIOnArray or   iMAOnArray

exmple

This is an example you can set the input values


 for(i=0; i<limit; i++)
   {
      CCIResult[i]=iCCI(Symbol(),0,14,PRICE_CLOSE,i);
   }
   
      
   for(i=limit-1; i>=1; i--)
   {
      
      double adxma1=iMAOnArray(CCIResult,0,ma_adx_period,ma_adx_shift,ma_adx_method,i);
      
      
   }
 
ST_ Rhodes: Hence i am posting here in search of a correct method to draw MA and CCI inside of one indicator.

Can't be done (in general). MA will be, say  around 1.23456 and CCI is [0 … 100].

The MA would be flat and you only see the CCI, or the CCI would be off chart and you only see the MA.

 
Thank you   for your reply  @Mehmet Bastem i will look into it

@William Roeder thank you for your reply ,  i know you said its impossible (in general) but is also impossible using  iMAOnArray() ?  or is there some hope?
 
ST_ Rhodes:
Thank you   for your reply  @Mehmet Bastem i will look into it

@William Roeder thank you for your reply ,  i know you said its impossible (in general) but is also impossible using  iMAOnArray() ?  or is there some hope?

You can have the CCI and a MA of the CCI by using iMAOnArray.

You cannot have the CCI and a MA of price in the same window in any practical form.

 
Keith Watford:

You can have the CCI and a MA of the CCI by using iMAOnArray.

You cannot have the CCI and a MA of price in the same window in any practical form.

Thank you @Keith Watford 
Reason: