Point return 0 at EUR/USD and GBP/USD ?

 

I am running with a demo account which recently download / register from https://www.metaquotes.net// . V4 Build 220.

Point return incorrect value as 0 when play with EUR/USD and GBP/USD ? any clue?

 
it's the service provide's problem. redownload a ibfx version, working fine.
 

Dow2,

The Point value is correct, sort of, but MQ language only displays it to 4 decimal places. The real problem lies in the fact that it only contains one tenth of what is expected. I have run into this problem several times, and am now using the following:

// Global variable
double dblPoints = GetPoints();

// function GetPoints()

double GetPoints()
{
   if (Digits = 3 || Digits = 5) dblPoints = Point * 10;
   else dblPoints = Point;

return(dblPoints);
}
         

Use dblPoints in your code instead of Point.

Hope this helps.

Bob

 
Dow2:
it's the service provide's problem. redownload a ibfx version, working fine.


It isn't actually a problem with the provider. As Bob stated, some carry out to 5 dec, theoretically to get you better spreads, such as 2.6 instead of rounded up to 3, etc. Try something like:

Print(DoubleToStr(Point,5));

That should show you the value of Pt for one that uses 5 decimals, it will just show as ZERO otherwise. And, what Bob said is dead on, if you're using a service that goes to 5 decimals, and and EA/Indicator that uses Point in it's calculations and was coded for 4 decimals, splat, you've got a problem.


You can use his example and do a search/replace of all instances of Point with dblPoints

*Note, think he typed that in fast, try Digits == 3 || Digits == 5 and I think you'll have to set up dblPoints variable first, before calling the function.

So, closer to this:

double dblPoints; //global
double GetPoints()
{
if (Digits == 3 || Digits == 5) dblPoints = Point * 10;
else dblPoints = Point;
return(dblPoints);
}


in your init function:

dblPoints = GetPoints();

 
paranoidtruth wrote >>

... and I think you'll have to set up dblPoints variable first, before calling the function.

So, closer to this:

double dblPoints; //global
double GetPoints()
{
if (Digits == 3 || Digits == 5) dblPoints = Point * 10;
else dblPoints = Point;
return(dblPoints);
}

in your init function:

dblPoints = GetPoints();

You're absolutely right. Sorry for any confusion.

Bob

 
bbayles wrote >>

You're absolutely right. Sorry for any confusion.

Bob

Thanks bbayles and paranoidtruth 's help.

Reason: