Download MetaTrader 5

5 Digits Adjustment

To add comments, please log in or register
Teck Hua Chew
600
Teck Hua Chew 2015.11.13 10:29 

i am just wondering if a 5 digit adjustment is still needed today? or it's a thing for the past

Example:

int     vpoints;
double  vpips;   
if (Digits == 3 || Digits == 5)//Adjust for five (5) digit brokers.
{
   vpips = Point*10;
   vpoints = 10;
}
else
{
   vpips = points;
   vpoints = 1;
}

Thanks

Chew

Stuart Browne
5887
Stuart Browne 2015.11.13 10:50  
Hey Chew

Yes, if you plan to give your code to other people, it's still needed mate. There are still 4 digit brokers out there. And if it's just for you and you use a 5 digit broker, you will need it. But if it's just for you and you always use 4 digit broker, then no
Teck Hua Chew
600
Teck Hua Chew 2015.11.13 11:57  
Stuart Browne:
Hey Chew

Yes, if you plan to give your code to other people, it's still needed mate. There are still 4 digit brokers out there. And if it's just for you and you use a 5 digit broker, you will need it. But if it's just for you and you always use 4 digit broker, then no

How about I just use Point function? Will there be a 4 Digit broker that return me 5 decimal point, 0.00001 point?

Example:

extern int stoploss = 100
extern double takeprofit = 400

double SL = NormalizeDouble(stoploss*Point, Digits);
double TP = NormalizeDouble(takeprofit*Point, Digits);

Siti Latifah
6894
Siti Latifah 2015.11.13 12:46  
Teck Hua Chew:

How about I just use Point function? Will there be a 4 Digit broker that return me 5 decimal point, 0.00001 point?

Example:


 I usually use like below


extern double stoploss = 100; // same for 4digits or 5digits
extern double takeprofit = 400; // same for 4digits or 5digits

double poen;

if (Digits==3 || Digits==5) poen=10*Point; else poen=Point;


double SL = NormalizeDouble(stoploss*poen, Digits);
double TP = NormalizeDouble(takeprofit*poen, Digits);
To add comments, please log in or register