Learning and writing together in MQL5 - page 43

 
Good afternoon! Tell me, I understand that in the tester you can't see the graphical constructions? Not at all? I mean graphics like
вывод на экран названия советника
ObjectCreate(0,"Name",OBJ_LABEL,0,0,0);
ObjectSetInteger(0,"Name",OBJPROP_CORNER,0);
ObjectSetInteger(0,"Name", OBJPROP_XDISTANCE,DC_X);
ObjectSetInteger(0,"Name", OBJPROP_YDISTANCE, DC_Y);
And so on.
 
Dimka-novitsek:
Good afternoon! Tell me, I understand that in the tester you can't see the graphical constructions? No? I mean graphics like And so on.
So far the possibilities of drawing graphical objects in visual test mode are limited.
 
Got it, thanks.
 

Look how the compiler swears at the bracket... I fell out! Where do you look at the error anyway?

P.s. There's essentially nothing else in it, just variable declaration!!!! There are only six brackets, three paired... I wanted to put it all into oninit, so I could debug it for the weekend. Or ignore the compiler?

 
Dimka-novitsek:
See how the compiler scolds the bracket... I fell out! Where to look for the error anyway?

The compiler correctly pointed out 2 errors.

The errors have a fairly accurate description on the same line.

 
Yes, of course there is no function yet. But the bracket? It must be because there is no function? Thank you. Am I stupid? I'm sorry. Oh. I'll cross out the line with the error and compile!
 
This is bullshit... I'm going to create an advisor again and pyrenece in a line.
 
Dimka-novitsek:
Yes, of course, there is no function yet. But a parenthesis? This is probably caused by the fact that there is no function. Thank you. Maybe I'm just dumb? I'm sorry. Oh. I'll cross out the line with the error and compile!

No. That's because OnInit() is supposed to return something of int type, but it doesn't. There are two options:

  • You can put return(0) at the end of the function's body;
  • You can declare OnInit() with void type.
Документация по MQL5: Основы языка / Функции
Документация по MQL5: Основы языка / Функции
  • www.mql5.com
Основы языка / Функции - Документация по MQL5
 

You know, he missed the return(0); Wow!!! That's OK. I have moved the piece of text in the function (OnInit ) of a newly created EA, all that has been written in the OnTick function of a long-written EA. It will compile deliberately. Typed '}' - not all control paths return a value Output yu.mq5 2686 3 !!!!

Needless to say, brackets are paired there. I don't know what to do now.

Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
Основы языка / Функции / Функции обработки событий - Документация по MQL5
 
tol64:

No. That's because OnInit() is supposed to return something of int type, but it doesn't. There are two options:

  • You can put return(0) at the end of the function body;
  • You can declare OnInit() with void type.
Thank you!!! Didn't see the message. THANK YOU!!!