Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Libraries | stdlib.mq5

MetaTrader Experts, Indicators, Scripts and Libraries

Here I have modified the stdlib from MQL4 to MQL5 which was originally written by MetaQuotes Software Corp.

This function is changed:

MT4

//+------------------------------------------------------------------+  //| convert integer to string contained input's hexadecimal notation |  //+------------------------------------------------------------------+  string IntegerToHexString(int integer_number)    {     string hex_string="00000000";     int    value,shift=28;  //---     for(int i=0; i<8; i++)       {        value=(integer_number>>shift)&0x0F;        if(value<10)           hex_string=StringSetChar(hex_string,i,ushort(value+'0'));        else           hex_string=StringSetChar(hex_string,i,ushort((value-10)+'A'));        shift-=4;       }  //---     return(hex_string);    }

MT5

//+------------------------------------------------------------------+  //| convert integer to string contained input's hexadecimal notation |  //+------------------------------------------------------------------+  string IntegerToHexString(int integer_number)    {     string hex_string="00000000";     int    value,shift=28;  //---     for(int i=0; i<8; i++)       {        value=(integer_number>>shift)&0x0F;        if(value<10)           bool check=StringSetCharacter(hex_string,i,ushort(value+'0'));        else           bool check=StringSetCharacter(hex_string,i,ushort((value-10)+'A'));        shift-=4;       }  //---     return(hex_string);    }
27461