Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Visualizzazioni:
1848
Valutazioni:
(13)
Pubblicato:
2018.10.25 15:37
\MQL5\Libraries\
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

The library allows receiving a magic number bound to three elements:

  • Symbol (financial instrument) name;
  • Timeframe;
  • Prefix index;

All these three elements are to be encoded in 64 bits, of which:

  • Symbol name = 48 bits (the first 8 characters are taken from the name);
  • Timeframe = 5 bits;
  • Prefix index = 11 bits (may be a number from 0 to 2047, inclusive).

The prefix number is necessary for obtaining several unique magic numbers on a single chart. To do this, we need to call the appropriate function with different prefix indices. The number of prefix indices is limited and may vary from 0 to 2047, inclusive.

To obtain the magic number, just call the function:

ulong GetMagicNumber(ushort prefix,//prefix number
                     string symbol,//Symbol name
                     ENUM_TIMEFRAMES tf);//Timeframe


Example of use:

//+------------------------------------------------------------------+
//| Input params
//+------------------------------------------------------------------+
input ushort MagicPrefixNumber_ = 0;

//+------------------------------------------------------------------+
//| Import functions
//+------------------------------------------------------------------+
#import "cUniMagicNumber.ex5"
   ulong GetMagicNumber(ushort prefix,//prefix number
                        string symbol,//Symbol name
                        ENUM_TIMEFRAMES tf);//Timeframe
#import

//+------------------------------------------------------------------+
//| Global Vars
//+------------------------------------------------------------------+
ulong _MagicNumber;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   _MagicNumber = GetMagicNumber(MagicPrefixNumber_, Symbol(), Period());

   return (INIT_SUCCEEDED);
}


Tradotto dal russo da MetaQuotes Ltd.
Codice originale https://www.mql5.com/ru/code/22069

Money-Meter Money-Meter

The indicator measures money on a chart.

Exp_XDeMarker_Histogram_Vol Exp_XDeMarker_Histogram_Vol

The trading system based on XDeMarker_Histogram_Vol indicator signals

XDeMarker_Histogram_Vol_Direct XDeMarker_Histogram_Vol_Direct

XDeMarker_Histogram_Vol indicator shows direction of the histogram bars movement using colored icons on these bars

ASCV ASCV

The Expert Advisor based on BrainTrend1Sig indicator