This is odd, for some reason using a copy buffer for this indicator doesn't seem to work like for other indicators.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all,
Can someone explain me why the same peace of code executed in OnStart() of a script and OnTick() of an EA does not give the same result. And what should I do to retrieve indicator value in the EA?
Peace of code :
int handle=iCustom(_Symbol,_Period,"TrendMagic_V2",50,5);
double TM_Price[];
ArraySetAsSeries(TM_Price,true);
CopyBuffer(handle,0,D'2010.10.01 00:00:00',D'2010.10.01 04:00:00',TM_Price);
for (int i=0;i<ArraySize(TM_Price)-1;i++)
Print(" i = ", IntegerToString(i)," TM_Price = ", DoubleToString(TM_Price[i],Digits()));