I want to compare moving average of two points to check if moving average chart is ascending or not.
double startEMA = iMA(NULL,TimeFrame,MovingAveragePeriod,0,MODE_EMA,PRICE_CLOSE,1);
double endEMA = iMA(NULL,TimeFrame,MovingAveragePeriod,0,MODE_EMA,PRICE_CLOSE,15);
if (startEMA - endEMA > 0)
SlopeDirection = "+";
SlopeDirection = "-";
But the result is not correct!
Could you please help me to solve it?
Thank you in advance.
What do you mean? What result are you getting?
How do you know that it is not correct?
Is the variable
“Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless. How To Ask Questions The Smart Way. 2004 When asking about code
Please enable the necessary setting in your browser, otherwise you will not be able to log in.