[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 281

 
I wish I hadn't hit my head when formatting code like this. I'll fix it :)
 

You have repeated the error several times:

You put an if condition, then write something in its parentheses, then put a semicolon behind the closing bracket. like this:

if(iSAR(NULL,0,SAR_Step,SAR_MaxStep,GeneralShift)>Close[0]); 

That's not right. This is correct:

if(iSAR(NULL,0,SAR_Step,SAR_MaxStep,GeneralShift)>Close[0]){

}
 
drknn:

You have repeated the error several times:

You put an if condition, then write something in its parentheses, then put a semicolon behind the closing bracket. like this:

That's not right. This is correct:

I see, I'll try it now - but actually it was a template in which I had to substitute buying and selling conditions - and accordingly I'm a beginner.
 
drknn:

You have repeated the error several times:

You put an if condition, then write something in its parentheses, then put a semicolon behind the closing bracket. like this:

That's not right. This is correct:

Nothing good comes out :(
 

In short, I had patience for exactly a hundred lines. It's absolutely unclear where in your idea the condition should be closed. For example, if(total<1){ but it's hard to understand where to close it. Well, here's a file with a hundred of code lines fixed. Look how it's formatted and don't be lazy to put curly brackets...

The file is attached to the post. This hundred lines is enough to see the difference between using normal and abnormal code formatting.

Files:
newx2.mq4  6 kb
 
drknn:

In short, I had patience for exactly a hundred lines. It's absolutely unclear where in your idea the condition should be closed. For example, if(total<1){ but it's hard to understand where to close it. Well, here's a file with a hundred of code lines fixed. Look how it's formatted and don't be lazy to put curly brackets...

The file is attached to the post.

Gives out two errors - generally doesn't work. (Error in program end)
 
And there will be errors - it's not clear where the curly braces should be put. I would if I understood the intent.
 
LeksusMt4:
Outputs two errors - does not work at all. (Error in endprograms)
The essence of trading robot is buying and selling following Sar indicator - maybe I did not set conditions correctly?
 
You didn't place braces correctly and put semicolons where they don't belong. Format the code!!!
 
LeksusMt4:
The essence of the trading robot is buying and selling following the Sar indicator - maybe I have not set conditions correctly?


Here is the code editor: http://depositfiles.com/files/2ippj8zao - download, unzip, run (installation is not required). Open in this editor the file I posted for you earlier and look at your code - where the vertical dashed lines go.

Buying and selling following any indicator can be executed differently. Your intent is not entirely clear.

P.S.

The editor has been already sharpened for MQL4 and bracket highlighting works in it.