Errors, bugs, questions - page 2426

 
Alexandr Gavrilin:

What the hell is wrong with the double type in the latest versions of metaeditor? In both mt4 and mt5 it writes some nonsense instead of -0.01. Where did these numbers come from, the variables are reset to zero in my case.

I have to change the memory. It was the same in older versions.

 

the compiler behaves differently in the same cases.

Downloaded 2 files from kodobase:https://www.mql5.com/en/code/15440

were made, obviously before iTime() appeared. One of them compiles, the other one swears:

Functions are identical:

calls too.

The reason for the scolding is obvious, understandable and easily fixed by auto-replacement, but the different behaviour in similar situations is alarming.

PS:

The compiled indicator works correctly.

Volume Profile + Range v6.0
Volume Profile + Range v6.0
  • www.mql5.com
Volume Profile + Range v6.0 (former TPO). Distribution of deals by price levels at a given time interval. Displayed as a histogram. The width of the histogram at the level means the number of transactions carried out on it. If a broker provides data on a real volume, the indicator is able to display distribution on it as well. VP: display...
 
Alexey Viktorov:

You have to replace the memory. It was exactly the same in the old versions.

What memory? What's memory got to do with it?

 

I ran the following code :

 Temp.ask=0; Temp.bid=0; Temp.time=0;
 Print("Старт Ask=",Temp.ask," Bid=",Temp.bid," Time=",Temp.time);
 Print("Ответ SymbolInfoTick=", SymbolInfoTick("",Temp) );
 Print("Ask=",Temp.ask," Bid=",Temp.bid," Time=",Temp.time);

And got a strange result:

Старт Ask=0.0 Bid=0.0 Time=1970.01.01 00:00:00
Ответ SymbolInfoTick=true
Ask=69.75 Bid=69.33 Time=2019.04.08 21:21:12

I.e. SymbolInfoTick with the first parameter equal to "" for some reason returns the last tick by the chart symbol instead of false and a tick from zeros. Although it should not be so according to definition in documentation.

bool  SymbolInfoTick( 
   string    symbol,     // символ 
   MqlTick&  tick        // ссылка на структуру 
   );
 
Igor Zakharov:

property strict?

 
Alexandr Gavrilin:

What the hell is going on with the double type in the latest versions of metaeditor? In both mt4 and mt5 it writes some nonsense instead of -0.01. Where do these numbers come from? I set the variables to zero.

This is the build from 2007.

It has always been 0.01, but now I don't understand it:


 
Andrei Trukhanovich:

property strict?

in both are the same:

I haven't checked up to the symbol (as pointed out above - the code isn't mine), but on a cursory glance they are 95% identical. And the difference is not in the places where the error pops up. But, for some reason one compiles, the other doesn't. I have already fixed it for myself, but I am informing the developers about the strangeness.

 

This bug seems to have appeared in recent builds of MT5.

Bug in CryptEncode() and CryptDecode() functions. Problem with the CRYPT_AES256 conversion method

You may reproduce the bug in the latest (2009) build with this script:

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
   string Txt = "The quick brown fox jumps over the lazy dog. A0 A1 A2 A3 A4 A5 A6 A7 A8 A9"; 

//---Key
   uchar Key[32];
   ArrayInitialize(Key, 3);

//---encode
   uchar SourceArr[], EncodedArr[];
   
   StringToCharArray(Txt, SourceArr); 
   
   int EncodeRes = CryptEncode(CRYPT_AES256, SourceArr, Key, EncodedArr);
   
//---decode
   uchar DecodedArr[];
   
   int DecodeRes = CryptDecode(CRYPT_AES256, EncodedArr, Key, DecodedArr);
   
   string DecodedTxt = CharArrayToString(DecodedArr);

//---res
   Print("Txt: ",Txt);
   Print("EncodeRes: ",EncodeRes);
   
   Print("DecodedTxt: ",DecodedTxt);
   Print("DecodeRes: ",DecodeRes);
   
//---
   return;
}
 
Marat Sultanov:

This bug seems to have appeared in recent builds of MT5.

The bug is in CryptEncode() and CryptDecode() functions. Problem with the CRYPT_AES256 conversion method

You may reproduce the bug in the last (2009) build with this script:

The fix will most likely only appear when upgrading to a new build.
 
Vitaly Muzichenko:

Here in the build since 2007

It was always 0.01 and now it's not clear:


Show output code
Reason: