I tried this in my ea, but the values were wrong:
double x1= iCustom(NULL,0,"MOM_EMA_MTF",14,MODE_EMA,50,60,0,0); double x2=iCustom(NULL,0,"MOM_EMA_MTF",14,MODE_EMA,50,60,0,10); double y1=iCustom(NULL,0,"MOM_EMA_MTF",14,MODE_EMA,50,60,1,0); double y2=iCustom(NULL,0,"MOM_EMA_MTF",14,MODE_EMA,50,60,1,10);
I tried this in my ea, but the values were wrong:
You are using iCustom correctly,
but you can make your problem more clear if you show this with picture of the chart attached the indicator
(momentum with calculated average momentum) and the values you read in your EA
I think the problem is you are calculating values of bar 0 This is changing every tick.
Also iMAOnArray(momTF,0,MaPeriod,0,MaType,j); is that way not a constant value
and why do you compare value bar 0 with the value of bar 10.
Wouldn't it be the intersection will happen in two following bars ??
momTF[i] = iMomentum(Symbol(),TimeFrame,MoMPeriod,PRICE_CLOSE,i);
The "i" on the left is a bar on the current chart. The "i" on the right is a bar on the TimeFrame chart. Apples and oranges.
What you have is meaning less unless the TF of the chart matches TimeFrame's value. Look in the codebase for MTF indicators.
Hi,
thank you for your answer.
But the two buffers mom and ema are drawn on my current chart and I can see the values in the data-window. Why can't I get them and why they are different from my read values with iCustom?
Do I have to change the code from the indicator??

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have fond the following indicator:
But I can't get the intersection point from this two lines with my ea, even I can't get the right value from the indicator, which is displayed.
I can calculate the normal Momentum-value with the indicator function, but how could I calculate the real value over the momTF-Array in my ea?