get handle of a custom indicator possible?

 

Hi,

normally, someone can get a handle of an (built-in-) indicator and add this indicator to chart via ChartIndicatorAdd():

int _handle = iMA(_Symbol, _Period, 20, 0, MODE_EMA, PRICE_CLOSE);
ChartIndicatorAdd(CHART_ID, SUB_WIN, _handle);

Can this be done with my own indicator (not built-in)? An example would be great... :-)

Why do I want to do this? I want to add multiple EMA's to a chart via script/EA, but I want to adjust color and line on each. AFAIR is this not possible with built-in indicators.


Best regards,
Alex

 

Didn't do it before but maybe this works:

int _handle = iCustom(_Symbol, _Period, "Alex\\MyIndi", 20, 0, MODE_EMA, PRICE_CLOSE);
ChartIndicatorAdd(CHART_ID, SUB_WIN, _handle);
 

Hey lippmaje,

thank you very much, it works!

Reason: