Student Looking for tutor correction

 
Hi All,

I try to modify the below EA, I need to be alert when SMA50 Start Rising or Falling and the current bar closed.

// Code //

//+------------------------------------------------------------------+
//| EMA-Signal.mq4 |
//+------------------------------------------------------------------+

/*
+------------------------------------------------------------------+
| Allows you to enter two ema periods and it will then show you at |
| Which point they crossed over. It is more usful on the shorter |
| periods that get obscured by the bars / candlesticks and when |
| the zoom level is out. Also allows you then to remove the emas |
| from the chart. (emas are initially set at 5 and 6) |
+------------------------------------------------------------------+
*/
#property copyright "Copyright © 2005"
#property link ""

#property indicator_chart_window
#property indicator_buffers 1

double Rising,Faling[];
extern int FasterEMA = 50;
extern bool SoundON=true;
double alertTag;
double control=2147483647;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start() {
int limit, i, counter;
double fasterEMAnow, fasterEMAprevious, fasterEMAafter;
double Range, AvgRange;
int counted_bars=IndicatorCounted();

//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i = 0; i <= limit; i++) {

counter=i;
Range=0;
AvgRange=0;
for (counter=i ;counter<=i+9;counter++)
{
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
}
Range=AvgRange/10;

fasterEMAnow = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i);
fasterEMAprevious = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i+1);
fasterEMAafter = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i-1);


if ((fasterEMAnow > fasterEMAprevious) && (fasterEMAprevious < fasterEMAafter)) {
Rising[i] = Low[i] - Range*0.5;

}
if (SoundON==true && i==1 && Rising[i] && alertTag!=Time[0]){
Alert("EMA Rising ",Symbol()," ",Period());
alertTag = Time[0];
}
if (SoundON==true && i==1 && Faling[i] && alertTag!=Time[0]){
Alert("EMA Faling ",Symbol()," ",Period());
alertTag = Time[0];
}
}
return(0);
}
/////


I got to some error.

Any one can help to Correcting my Mistake Please.

All the best
 
Impassable, No one can help???
 
Error at this line during compilation:
if ((fasterEMAnow > fasterEMAprevious) && (fasterEMAprevious < fasterEMAafter)) {
Rising[i] = Low[i] - Range*0.5;

Reason:
Rising has not been declared as an Array...


double Rising,Faling[]; /// wrong
 
Than, how to solve this ?

Could you please help.

All the best
 
See Reason above.
 
Could you please write the correct one