Issue with adding a custom short name to my moving average indicator

 

Hi, 

my code looks like this:

MqlParam params[4];
//--- period
params[0].type = TYPE_INT;
params[0].integer_value = maData.period;
//--- shift
params[1].type = TYPE_INT;
params[1].integer_value = 0;
//--- type of smoothing
params[2].type = TYPE_INT;
params[2].integer_value = maData.mode;
//--- type of price
params[3].type = TYPE_INT;
params[3].integer_value = maData.typeOfPrice;
    
int movingAverage = IndicatorCreate(NULL, PERIOD_CURRENT, IND_MA, 4, params);
ChartIndicatorAdd(0, 0, movingAverage);
movingAverageHandles.Add(movingAverage); //array

and I have 

IndicatorSetString(INDICATOR_SHORTNAME, maData.shortName);

which I tried to put everywhere but did not work.


I could not find any solution anywhere except having a subclass of the inidcator itself which I don't need nor want.


The overall story:

I created an expert advisor with a window which creates MAs and print them on the chart which works fine.

But I need the short_name to grab the indicator from the chart to delete it (based on the documentation).


Any ideas?