What's wrong with that? - page 2

 
msl:

Kind people, and more importantly, smart ones, explain to a self-taught person what kind of error I get when I compile my code?

\end_of_program' - ending bracket '}' expected


Why did you get in here? Don't you see others are trying to get help? The error says the '}' thing is unnecessary but it may be a dot or comma.
 
sss2019:

What are you doing here? Can't you see others are trying to get help? The error says this '}' thing is missing, but it could be a full stop or a comma, you have to see the code.
and I thought it was missing. But I've gone through all the code, I can't find it. But I won't burden you with that, thank you very much.
 
Well, put out the code, it means there's another sign missing.
 

Comrades!!! Just tell me why the warrant doesn't open. I copied the code from the tutorial

OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
but it still won't open, and there are no errors. It only opens if I set the stop and profit value to 0.
 

Looks like your brokerage company only allows orders without TP and SL, followed by a modification of the order

 
Exactly, the manual order only opens without stops too. Thank you.
 
sss2019:
Well, put out the code, it means there's another sign missing.
Thanks for your concern, found the brackets backwards.
 
Help me decipher the following line
int CalculateCurrentOrders(string symbol)
I understand that CalculateCurrentOrders is a variable, but what do the parentheses and another variable in them mean?
 
sss2019:
Help decipher the line I understand that CalculateCurrentOrders is a variable, but what do the parentheses and another variable in them mean?
This is a user-defined function for calculating orders. Here is the full code.

int CalculateCurrentOrders(string symbol)
{
int buys=0,sells=0;
//----
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGICMA)
{
if(OrderType()==OP_BUY) buys++;
if(OrderType()==OP_SELL) sells++;
}
}
//---- return orders volume
if(buys>0) return(buys);
else return(-sells);
}
 

Thank you. Do you think it is worth buying visual editors? There are so many visual editors around these days that they promise to create an Expert Advisor with source code in a couple of clicks.

And why does it say here (minus) -sells?

if(buys>0) return(buys);
else return(-sells);
Reason: