Updated MQL4 and old code (sharing problem-solving experiences) - page 2

 

The code from this article has also stopped working. https://forum.mql4.com/ru/3481

Specifically, it won't write or read files from the C drive.

 
I have a 509 bild. Today I saw that the editor has changed. I needed to change the lot in EA's code, and during compilation I got errors related to stdlib.mqh and stderror. I have copied these files into /MQL4/Include and the Expert Advisor managed to copy .
 

Overnight updated ME on both Real on 509 and with positions open. Point turned out to be 0.0001 and Digits, respectively, 4! Had to make the variables urgently as stated in the Documentation, but the StopLoss is for some reason set with zero on the 5th digit. And the only indicator DailyPivotPoints, which I use to "calm my conscience", has disappeared. I had to recompile it.

On the demo, updated earlier Point and Digits were normal at once and DailyPivotPoints didn't fly off.

 
What horror stories you tell here, this should be told at bedtime, like we used to do in pioneer camp)))
 
evillive:
What horrors you tell here, it should be told at night, as it used to be in pioneer camp )))

So, we'll come to MT0 and only the whole lot. So far I've done as described in the Documentation, and Point and Digits, no matter how you colour them, are the same as for a 4-digit lot.

  double point = MarketInfo(Symbol(),MODE_POINT);
  int   digits = MarketInfo(Symbol(),MODE_DIGITS);
And the Demo is fine, relatively, of course.
 
borilunad:

So, we'll come to MT0 and only the whole lot. So far I've done as described in the Documentation, but Point and Digits, no matter how you colour them, are the same as for 4 digits.

And the demo is fine, relatively, of course.

Have you updated the reference? I went in and found the following - it wasn't there before.

-----------------------

int _Digits

The _Digits variable stores the number of decimal places after the decimal point which determines the accuracy of the price of the current chart symbol.

You can also use the Digits() function.

----------------------

Checked, this Print(_Digits, " ", Digits()); on AUDJPY and EURUSD outputs the following

2014.02.07 18:52:54.313 TestFileOpen EURUSD.e,M30: 5 5
2014.02.07 18:52:33.317 TestFileOpen AUDJPY.e,M15: 3 3

 
VDev:

Have you updated the help? I went in and found the following - it wasn't there before.

-----------------------

int _Digits

The _Digits variable stores the number of decimal places after the decimal point which determines the accuracy of the price of the current chart symbol.

You can also use the Digits() function.

This must be when switching to an updated language, and I don't, everything compiles! But very strange that on Demo with the same Expert Advisor on another terminal updated on Monday Point and Digits are normal, five digits, but here on Real should get five digits through MarketInfo() :(((

Here, there's a check in the comment on the chart:

  "\n\n                                  ",DoubleToStr(Point,Digits), //тут выводится 0.0001
  "\n                                  ",DoubleToStr(point,5),   //а тут с переменной 0.00001
Of course, I was "horrified" when SL was set at 10 times its value! Keeping this check for now with the hope that it will work properly, and I'll put it away.
 

There will be other problems, it's a start))) Now the compiler seems to require strict compliance with normal languages like C/C++, and MQL5, of course. That is, such nonsense cannot be compiled anymore.

switch(n)
{
case 1: double d=1; break;
case 2: d=2; break;
}
 
VDev:

There will be other problems, it's a start))) Now the compiler seems to require strict compliance with normal languages like C/C++, and MQL5, of course. That is, such nonsense cannot be compiled anymore.

I don't indulge in such nonsense! The main thing is if...else - it works and that's it! True, the switch is in the borrowed functions outside the start, and everything works. Maybe it will start normally on Monday after a rest! ;))
 
borilunad:
I don't dabble in that! The main thing is if...else works and that's it! True switch is in the borrowed functions outside the start, and everything works. Maybe it will start normally on Monday after a rest! ;))
I've only tried this version for an hour today, I'm not aware of it. An acquaintance of mine made me laugh today )))) He loves putting dots in variable names. Told him for a long time - change it to underscores. Today it didn't compile well. So he says to me - why, because now variables just have to become classes!
Reason: