25.10.2016 Views

Expert Advisor Programming by Andrew R. Young

Expert Advisor Programming by Andrew R. Young

Expert Advisor Programming by Andrew R. Young

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tips and Tricks<br />

• Illegal assignment used – This is usually in reference to an equal sign (=). Remember<br />

that a single equal sign is for variable assignment, and two equal signs (==) is a comparison<br />

operator. Correct the assignment operator to the appropriate comparison operator.<br />

• Assignment expected – This is usually in reference to the "equal to" comparison operator<br />

(==). You used two equal signs instead of one in a variable assignment. Correct the operator<br />

to a single equal sign.<br />

• Unbalanced right parenthesis – These usually occur in an if statement when using<br />

nested parentheses. Go to the line indicated <strong>by</strong> the first error and insert a left parenthesis in<br />

the appropriate place.<br />

• Unbalanced left parenthesis – This is a tricky one. The error usually points to the end of<br />

program line. Basically you forgot a right parenthesis somewhere. Double check the code you<br />

recently edited and look for a missing right parenthesis. You may have to comment out lines<br />

of code to locate the problem.<br />

• Wrong parameters count – You have too few or too many arguments in a function.<br />

Double check the function syntax in the MQL Reference and correct the arguments.<br />

• Semicolon expected – You probably forgot to put a semicolon at the end of a line. Place a<br />

semicolon at the end of the previous line. Note that a missing semi-colon may cause any of<br />

the above errors as well, so be sure to place those semicolons!<br />

145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!