MQL5 Poin to pip conversion

    int Digits = SymbolInfoInteger(_Symbol, SYMBOL_DIGITS);

double Point = SymbolInfoDouble(_Symbol, SYMBOL_POINT);


int MyDigits;

double MyPoint;


if (Digits == 5)

    MyDigits = 4;

else if (Digits == 3)

    MyDigits = 2;

else

    MyDigits = Digits;


if (Point == 0.00001)

    MyPoint = 0.0001; // 6 digits

else if (Point == 0.001)

    MyPoint = 0.01; // 3 digits (for Yen based pairs)

else

    MyPoint = Point; // Normal

Comments

Popular posts from this blog

MQL5 : Add time to current time in mins

MQL5 : Get current trading session