Can not create a decimal fraction

 

The following MQL4 code results in the "a" value of zero:

double a=1;


for (int i=0; i<4; i++)

{

a=a*0.1;

}

Print ("a is ",a);


Output: "a is 0".


Should I make "a" equal to 100000 initially, then the output is "10".


How can I get "0.0001" (The pip value :))?


Thank you in advance :).

 
double a=1.0;
 
PVA wrote >>

The following MQL4 code results in the "a" value of zero:

double a=1;

for (int i=0; i<4; i++)

{

a=a*0.1;

}

Print ("a is ",a);

Output: "a is 0".

Should I make "a" equal to 100000 initially, then the output is "10".

How can I get "0.0001" (The pip value :))?

Thank you in advance :).

if it is pip value why not use Point; What is Poiint -> from the help file of MetaEditor

double Point
The current symbol point value in the quote currency.
Sample:
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point);

Reason: