Errors, bugs, questions - page 831

 
Dimka-novitsek:

I mean, the compiler swears there is one. Or did I misunderstand it, the compiler?

Not in the sense that I didn't write it before. Yeah. Thought I was dumb. But what can it be?

:)

Try writing Print or Comment. Maybe you will succeed and the compiler will agree :)

 
Read more. I have added the following inside void OnTick() function
//закрытие всех ордеров в пятницу после
bool Cl_FT = false;
if(DayOfWeek()==5 && Hour()>=Friday_close_orders_hour)
Cl_FT = true;
 
Imagine, it compiles even though there is a reference to an undefined function! Not only that, but when I added the function below it, it started crashing!!! I don't get it. I can't just leave it as it is and remove the function below the tick!
 
I'll write everything in notepad and check again. But I didn't write functions of time before, I wouldn't have forgotten, I write through help all the more! Reading and writing.
 
Dimka-novitsek:
I'll write everything in notepad and check again. But I didn't write functions of time before, I wouldn't have forgotten, I write through help all the more! I read and write.
Have you connected any libraries via include, they may contain function with the same name.
 
No, I haven't connected it. I don't know much about it yet. Yes, it must be something like that!
 
Dimka-novitsek:
No, I haven't. I'm not very good at it yet. Yes, it's probably something like this!

Let's try it another way: put the cursor on DayOfWeek in the code

if(DayOfWeek()==5 && Hour()>=Friday_close_orders_hour)
and press Alt+G.
 
Dimka-novitsek:

I mean, the compiler swears there is one. Or did I misunderstand it, the compiler?

Not in the sense that I didn't write it before. Yeah. Thought I was dumb. But what can it be?

You have probably added the "MQL4 to MQL5.mqh" file and the function is already there.

I agree with the previous speaker :)

You highlight the function you want, press right mouse and go to definition (those Alt+G) and ME will find it in all the inludes even if they were not opened.

 
void OnStart()
{
double pr;
OrderCalcProfit(ORDER_TYPE_SELL, "USDCHF",1,1.25601,2,pr);
Print(DoubleToString(pr));

}

Why doesn't the code work "Offline" - without internet?

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
Koshi:
Arkadiy, when modelling in the strategy tester, does the time also "stray" from experiment to experiment?
Now the time simply rushes away by more than 10 seconds. Put Alpari on the left and MQ5 on the right and you'll see that the candlesticks on the right close considerably earlier. Why - because MT5 time is ahead of Alpari (always real time by the way, for which they get a big absentee plz).
 
Arkadiy:
It - the time - now just runs away by more than 10 seconds. Put - on the left side Alpari, on the right MQ5, you will see that the candles on the right close significantly earlier - and that's if you're a piper - that you entered in vain. Why - because MT5 time is ahead of Alpari (always real time by the way, for which they get a big absentee plz).
Calculated - such a mistake can ruin any model - i.e. make it unprofitable, even on hours and more.