Could it be the fact that you have defined the mode (MaMode) as double instead of
int?
Cheers!
Max
i tried int too, do the same
I've just tried the code you provided as an EA, works fine with me and both MAnow
and previous values are displayed in the Alert window...
Hi, I have turned your Simple Question into "SimpleAnswer.mq4" and have no trouble whatsoever.\ Cheers! Max
Files:
simpleanswer.mq4
2 kb

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
#property copyright ""
#property link ""
//---- input parameters
extern double TakeProfit = 25;
extern double Lots = 0.01;
extern double TrailingStop = 10;
extern double InitialStop = 20;
extern double slip = 2;
extern double MA = 21;
extern double MAMode = 1;
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int init()
{
//----
return(0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int deinit()
{
//----
return(0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int start()
{
int Trend;
double fasterMAnow,fasterMAprevious;
fasterMAnow = iMA(NULL, PERIOD_D1, 21, 0, 1, PRICE_CLOSE, 0);
fasterMAprevious = iMA(NULL, PERIOD_D1, MA, 0, MAMode, PRICE_CLOSE, 1);
Alert(fasterMAnow+"-"+fasterMAprevious);
......................