Before anything, please wrap your code in a code block by clicking the following button:
With that said, the code you posted looks fine. I don't know why you're getting the following error:
Compiling error: 'else' - illegal 'else' without matching 'if' DGNFractals.mq5 84
All I can think of is you're missing a curly bracket somewhere else in your code.
Have used Search in Documentation e.g. "Separating Operators {do stuff}
Search for operator or for the actual operator, such as &&
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
My code from DGNfractals.mq5
//--- main cycle of calculations
for(int i=start; i<rates_totalD-3 && !IsStopped(); i++)
{
//--- Upper Fractal
if(highD[i]>highD[i+1] && highD[i]>highD[i+2] && highD[i]>=highD[i-1] && highD[i]>=highD[i-2])
{
ExtUpperBuffer[i]=highD[i];
DGNHigh[i]=highD[i+1]; // problem area line 82
}
else
{
ExtUpperBuffer[i]=25; //was EMPTY_VALUE
DGNHigh[i]=Zero1;
}
//--- Lower Fractal
if(lowD[i]<lowD[i+1] && lowD[i]<lowD[i+2] && lowD[i]<=lowD[i-1] && lowD[i]<=lowD[i-2])
ExtLowerBuffer[i]=lowD[i];
else
ExtLowerBuffer[i]=26; //was EMPTY_VALUE
}
Have used Search in Documentation e.g. "Separating Operators {do stuff}
Amazing how one can get sidetracked with 2011 articles that still do not show how to correctly use two operators after an If expression. Yes e.g. of nesting after the Else expression.
Compiling error: 'else' - illegal 'else' without matching 'if' DGNFractals.mq5 84 7
Please point me in direction in Documentation which lets me LEARN about this. Thanks