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?");
}
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.
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");
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