[MQL4 Coding Suggestion] Get the Pips based on symbol digit

shanmugapradeep

Active Trader
Dec 18, 2020
119
5
34
39
Which one should i use.


With Point :

MQL4:
double Pips;
if(Digits == 3 || Digits == 5)
Pips = 10.0 * Point;
else
Pips = Point;

With Ticksize :

MQL4:
double Pips;
if(Digits == 3 || Digits == 5)
Pips = 10.0 * MarketInfo(Symbol(), MODE_TICKSIZE);
else
Pips = MarketInfo(Symbol(), MODE_TICKSIZE);
 

hayseed

Master Trader
Jul 27, 2010
1,166
275
149
usa
Code:
TP : 30; //In Pips
SL : 50; // In Pips

EURUSD : Smallest digit in point/pipet in 5 digit broker so we got Point * 10 to get Pips.
//------

in that situation, your with point example would work best...... again, keep in mind Point and TickSize are not always equal......

that's not how i would code but far more important is for you to adopt meanings for words that will not change.....

in other words, whatever Pips means today, it needs to mean forever..... one term..... one meaning......

similar to the saying a man with one watch always knows the time, but a man with two is never quite sure......h