Indicator buffers inverted when applying it to chart programatically

 
Hello Everyone,

I've encountered a strange issue with an indicator while developing my EA. When applying the custom indicator to the chart manually it works fine but when doing it programatically, the two plots of the indicator are inverted.


I use several custom indicators in my EA attching them to the chart like so :
ChartIndicatorAdd(chart_id, subwindow_index, indicator_handle);

This works fine for every indicators I use except for the one I'm talking here. To illustrate the problem here's two screenshots of the indicator plots :


1) Applying the indicator manually (plots are correct) :


2) Applying it programatically from my EA using the method above (plots are inverted):



I've checked the values in the data window and i can see that when applying the indicator via the EA's code, the indicator buffers get reversed (data which should be in buffer 0 gets in buffer 1 and reciprocately), here's a screenshot demonstrating it :




Any clue why this is happening ?