Hi everybody,
I want to write a EA code to alert when a previous M1 body size exceeds 10 points in EUR/USD and USD/CHF. One of programmers here kindly wrote a code for me and when I put it on the meta Editor it was as follows:
//+------------------------------------------------------------------+
//| M1 body size more than 10 pips.mq4 |
//| Hooman |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Hooman"
#property link "http://www.metaquotes.net"
//---- input parameters
extern int ExtParam1;
static int alert_bar;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
static int alert_bar
if(iHigh(Symbol(),PERIOD_M1,1)-iLow(Symbol(),PERIOD_M1,1)>=10*Point && Bars-alert_bar>0)
{
Alert("Previous M1 bar is greater than 10 pips");
alert_bar=Bars;
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
After compiling, it showed one error: 'if'- comma or simicolon expected
please tell me what should I do to correct this error and what should I add to it to tell the program work with EUR/USD and USD/CHF only.
Looking forward,
Hooman
I want to write a EA code to alert when a previous M1 body size exceeds 10 points in EUR/USD and USD/CHF. One of programmers here kindly wrote a code for me and when I put it on the meta Editor it was as follows:
//+------------------------------------------------------------------+
//| M1 body size more than 10 pips.mq4 |
//| Hooman |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Hooman"
#property link "http://www.metaquotes.net"
//---- input parameters
extern int ExtParam1;
static int alert_bar;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
static int alert_bar
if(iHigh(Symbol(),PERIOD_M1,1)-iLow(Symbol(),PERIOD_M1,1)>=10*Point && Bars-alert_bar>0)
{
Alert("Previous M1 bar is greater than 10 pips");
alert_bar=Bars;
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
After compiling, it showed one error: 'if'- comma or simicolon expected
please tell me what should I do to correct this error and what should I add to it to tell the program work with EUR/USD and USD/CHF only.
Looking forward,
Hooman