Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2011.01.27 13:00

Hash functions library - library for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

votes: 18

General purpose hash functions:

  • adler32
  • CRC-32 (fast, table implementation)
  • MaHash8v64 (fast, table implementation)

All three functions are adapted for MQL5 Unicode strings. The results has been verified with Fsum Frontend

Radix Conversion:

  • from decimal (ulong) to Base radix
  • inverse transformation

The radix conversion is based on the following sequence of chars: 10 [0..9] + 26 [A..Z] + 26 [a..z] + 33 [А..Я] + 33 [а..я].  The "0-9" digits and "A-Z" english letters are used up to base 36.

The possible practical use of the other radix may be the compact form of string representation of a number in names of graphic objects. For example, 64-bit number generally has the following number of chars:

  • decimal: 20 chars (ULONG_MAX)
  • hexadecimal: 16 chars
  • base 36: 11 chars
  • base 128: 10 chars

the optimal is the base 36 radix.

Translated from Russian by MetaQuotes Software Corp.
Original code:

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

TP-SL_Removing TP-SL_Removing

Immediately deletes the SL/TP of all positions.

Closed_TOTAL Closed_TOTAL

Total closure of all positions (winners/losers). You can also select which are of a single instrument.