Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

UniMagicNumber - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 3 reads | 0 comments |

This library allows receiving magic numbers bound to three elements:

All three elements will be encoded in 64 bits, where:

The prefix number is necessary to get multiple unique magic numbers on a single chart. To do this we need to call the appropriate function with a different prefix index. The number of prefix indexes is limited and may vary between 0 and 2047 (inclusive).

To get the magic number, just call this function:

 Oolong gets the magic number ( ultra short prefix, //Prefix number string symbol, //Symbol name ENUM_TIMEFRAMES tf); //Approximate time


//+------------------------------------------------------------------+
//|Input parameters
//+------------------------------------------------------------------+
Enter ultra-short MagicPrefixNumber_ = 0 ; //+------------------------------------------------------------------+
//|Import function
//+------------------------------------------------------------------+
#Import "cUniMagicNumber.ex5" Oolong to get magic numbers ( ultra short prefix, //Prefix number string symbol, //Symbol name ENUM_TIMEFRAMES tf); //Approximate time
#import //+------------------------------------------------------------------+
//|Global variables
//+------------------------------------------------------------------+
Oolong_MagicNumber ; //+--------------------------------------------------------------------------------+
//|Custom indicator initialization function |
//+------------------------------------------------------------------+
Integer initialization ()
{
  _MagicNumber = GetMagicNumber(MagicPrefixNumber_, symbol (), period ());

Return ( initialization successful );
}



Attachment download

📎 cunimagicnumber.mq5 (1.73 KB)

📎 cunimagicnumber.mqh (6.72 KB)

Source: MQL5 #22069

Verification code Refresh