Create own indicator and use there other indicators

 

Hi,


I want to create an indicator and want to use there the iTrix indicator.

How can I do this? I found this but I dont understand it for my case ^^

https://www.mql5.com/en/articles/127


following the code, where I have to implement this in the indicator... hm I think so :-)

   int start;
   if(prev_calculated==0) start=1;  // start filling out MTMBuffer[] and AbsMTMBuffer[] from the 1st index 
   else start=prev_calculated-1;    // set start equal to the last index in the arrays 
   for(int i=start;i<rates_total;i++)
     {
      //get iTrix Value
      //do something with this...

      //Buffer[i] = ...;
     }
   return(rates_total);
  }


Thank you

Gambzor

How to Write an Indicator on the Basis of Another Indicator
How to Write an Indicator on the Basis of Another Indicator
  • www.mql5.com
In MQL5 you can write an indicator both from a scratch and on the basis of another already existing indicator, in-built in the client terminal or a custom one. And here you also have two ways - to improve an indicator by adding new calculations and graphical styles to it , or to use an indicator in-built in the client terminal or a custom one via the iCustom() or IndicatorCreate() functions.
 
An example of an indicator based on iTRIX: TRIX Color
 

Thanks a lot, it works!

FillArrayFromBuffer(TRIXBuffer,handle_iTriX,values_to_copy)

Was important for that.