Predefined variables Point is always zero

 

Hello everybody,

I guess I am missing something in MT4 or MQL4 configuration, but "Point" is always zero, so I cannot calculate pip value. Here is also some other values:

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_STOPLEVEL: 29

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_POINT: 0

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_DIGITS: 5

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_SPREAD: 50

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_LOTSIZE: 100000

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_TICKVALUE: 1

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_TICKSIZE: 0

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_MINLOT: 0.1

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_LOTSTEP: 0.01

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_MAXLOT: 10000

I am in demo mode.

Any help with this would be much appreciated.

 

Under what conditions is this output being generated. The values you are printing out are local values so without seeing the state of things in your code before hand it is impossible to give an opinion. Perhaps you are not initialising the values by using RefreshRates().

 
ypopov:

Hello everybody,

I guess I am missing something in MT4 or MQL4 configuration, but "Point" is always zero, so I cannot calculate pip value. Here is also some other values:

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_STOPLEVEL: 29

17:21:16 2009.12.22 14:31 My_First_EA GBPUSD,M1: MODE_POINT: 0


Hi

I suspect you are using the Print() function to output these values. The Print function will output variables of type double with only 4 digits after the decimal place. MODE_POINT and MODE_TICKSIZE are of type double and are typically 0.00001 for a 5-digit broker, so they will appear to be 0.

The solution is to convert them to strings with DoubleToStr( double value, int digits) in the Print() function. The full string is printed by Print().

Cheers

Jellybean

 
Jellybean:

Hi

I suspect you are using the Print() function to output these values. The Print function will output variables of type double with only 4 digits after the decimal place. MODE_POINT and MODE_TICKSIZE are of type double and are typically 0.00001 for a 5-digit broker, so they will appear to be 0.

The solution is to convert them to strings with DoubleToStr( double value, int digits) in the Print() function. The full string is printed by Print().

Cheers

Jellybean

Thanks for replay. That was indeed Print() function issue.

Reason: