question about indicator and sub indicator

 

hi guys  how  is  possiblòe interact  with indicator ? (explain better)

scenario: i have  a cross XAUDUSD  and attach over the CCI and over CCI, also MA, how is possible (for example ) trigger a long  when MA  touch CCI and CCi is max > of 70 ?

is possible to do that  or  in script  must rewrite CCI  and MA ??


thankz for all

 
faustf: is possible to do that  or  in script  must rewrite CCI  and MA ??
Don't try do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into the EA (using iCustom/iMA/iCCI) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
          Detailed explanation of iCustom - MQL4 programming forum
Reason: