Load your code (not only this snippet) in a different editor and count the brackets: { and } and ( and ) and then start to find where have you either one of them too many or too less.
Carl Schreiber:
Load your code (not only this snippet) in a different editor and count the brackets: { and } and ( and ) and then start to find where have you either one of them too many or too less.
//+------------------------------------------------------------------+Load your code (not only this snippet) in a different editor and count the brackets: { and } and ( and ) and then start to find where have you either one of them too many or too less.
//| 6060.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
extern int stat1 = 50;
extern int stat2 = 100;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
}
//---
//+------------------------------------------------------------------+
string stat3()
if (stat1>stat2)
return("buy");
else if (stat1<stat2)
return("sell");
-
Play videoPlease edit your post.
For large amounts of code, attach it. - void OnTick()
{
}
^^^^^^^^^^^ OnTick has ended. vvvvvvvvvv everything below is on global scope.
reza90:
void OnTick()
{
}
//---
//+------------------------------------------------------------------+
string stat3()
if (stat1>stat2)
return("buy");
else if (stat1<stat2)
return("sell");
void OnTick()
{
}
//---
//+------------------------------------------------------------------+
string stat3()
if (stat1>stat2)
return("buy");
else if (stat1<stat2)
return("sell");
string stat3()
{
if (stat1>stat2) return("buy");
else if (stat1<stat2) return("sell");
return("");
}
{
if (stat1>stat2) return("buy");
else if (stat1<stat2) return("sell");
return("");
}
honest_knave:
Thank you dear friend
string stat3()
{
if (stat1>stat2) return("buy");
else if (stat1<stat2) return("sell");
return("");
}
{
if (stat1>stat2) return("buy");
else if (stat1<stat2) return("sell");
return("");
}
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
Hi
What is the problem the following code?
string stat3()
if (stat1>stat2)
return("buy");
else if (stat1<stat2)
return("sell");