UniMagicNumber - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources
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
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •