get handle of a custom indicator possible?

To add comments, please log in or register
Alex
123
Alex  

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

lippmaje
593
lippmaje  

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);
Alex
123
Alex  

Hey lippmaje,

thank you very much, it works!

To add comments, please log in or register