Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 546

 
vobler63:

Dear GURU ! Help with the Expert, there are 2 compilation errors - 'MarketInfo' - syntax error and not all control paths return a value

I'm begging you - I don't have the brains for it.

int init() {
gd_348 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
switch MarketInfo(Symbol(), MODE_MINLOT) {
case 0.001:
gd_256 = 3;
break;
case 0.01:
gd_256 = 2;
break;
case 0.1:
gd_256 = 1;
break;
case 1.0:
gd_256 = 0;
}
return (0);
}

int deinit() {
return (0);
}



No one can help you with decompiling, but they can easily help you with banning...
 
vadynik:

Help

Timer doesn't work, returns fouls and error 4051

Or should it not work in the tester?


int OnInit()
{

   ResetLastError(); // добавил в код
   Print(GetLastError()); // = 0
   EventSetTimer(60);
   Print(GetLastError()); // 4051
   return(INIT_SUCCEEDED);
}
 
Guys, suggest a free indicator for open interest and volumes(not tick). Thanks in advance!
 
Vinin:


Thank you!
 

Can you please tell me if this condition would work?

  for (n=0;n<(total);n++) 
        {
         if(OrderSelect(n,SELECT_BY_POS,MODE_TRADES))
           {
            if (OrderSymbol()=="EURUSD") {priceEU1=OrderOpenPrice();}
            if (OrderSymbol()=="EURGBP") {priceEG1=OrderOpenPrice();}
            if (OrderSymbol()=="GBPUSD") {priceGU1=OrderOpenPrice();}
           }
         }
 
moskitman:

Can you please tell me if this condition would work?

It will if before the loop total = OrdersTotal();
 
AlexeyVik:
It will be if before the loop total = OrdersTotal();

Of course it is, however...

I strongly doubt the correctness of the construction

if (OrderSymbol()=="EURUSD") 
 
moskitman:

Of course it is, however...

I have serious doubts about the correctness of the design.

What doubts? Print Print(OrderSymbol(); and you get EURUSD


But!!! If the broker has a suffix in the instrument name, you have to write the symbol with the suffix.

 

Can you tell me. Where is the section on what settings. That is, the layout, checkboxes, arrows, etc.

 
moskitman:

Of course it is, however...

I strongly doubt the correctness of the design

Here https://www.mql5.com/ru/forum/119342 is a good function to get a list of available symbols in the terminal, in this case I don't see much point in comparing the order symbol with the broker symbol names in this account, but in other cases it is very useful.

And in this case to exclude suffixes

string smbl=StringSubstr(OrderSymbol(),0,6);
if (smbl=="EURUSD") priceEU1=OrderOpenPrice();
Reason: