ReillyFox:
Can somone tell me why its saying 'else' - illegal 'else' without matching 'if'
Because you are missing an if, or you have more than 1 else.
Replicate like so:
void OnStart()
{
else Print("Where is the if?");
}
{
else Print("Where is the if?");
}
void OnStart()
{
if(1>2) ;
else ;
else Print("One too many elses!");
}
You will need to post your code up if you need more specific help.
{
if(1>2) ;
else ;
else Print("One too many elses!");
}
honest_knave:
Because you are missing an if, or you have more than 1 else.
Replicate like so:
void OnStart()
{
else Print("Where is the if?");
}
{
else Print("Where is the if?");
}
void OnStart()
{
if(1>2) ;
else ;
else Print("One too many elses!");
}
You will need to post your code up if you need more specific help.{
if(1>2) ;
else ;
else Print("One too many elses!");
}
sorry, thought i did add it:
if(glBuyPlaced == true)
Trade.Sell(_Symbol,(tradeSize));
Print("glbuyplaced = true, trade.sell executed");
glBuytimerclose = true;
else if(glSellPlaced == true)
Trade.Buy(_Symbol,(tradeSize));
Print("glsellplaced = true, trade.buy executed");
glSelltimerclose = true;
else Print("Timerclose error");
Trade.Sell(_Symbol,(tradeSize));
Print("glbuyplaced = true, trade.sell executed");
glBuytimerclose = true;
else if(glSellPlaced == true)
Trade.Buy(_Symbol,(tradeSize));
Print("glsellplaced = true, trade.buy executed");
glSelltimerclose = true;
else Print("Timerclose error");
You need to use { } between each section.
if(glBuyPlaced == true)
{
Trade.Sell(_Symbol,(tradeSize));
Print("glbuyplaced = true, trade.sell executed");
glBuytimerclose = true;
}
else if(glSellPlaced == true)
{
Trade.Buy(_Symbol,(tradeSize));
Print("glsellplaced = true, trade.buy executed");
glSelltimerclose = true;
}
else Print("Timerclose error"); // OK because just 1 line
{
Trade.Sell(_Symbol,(tradeSize));
Print("glbuyplaced = true, trade.sell executed");
glBuytimerclose = true;
}
else if(glSellPlaced == true)
{
Trade.Buy(_Symbol,(tradeSize));
Print("glsellplaced = true, trade.buy executed");
glSelltimerclose = true;
}
else Print("Timerclose error"); // OK because just 1 line
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
Can somone tell me why its saying 'else' - illegal 'else' without matching 'if'