question about decima of marketinfo()

Back to topics list To post a new topic, please log in or register
avatar
26
faustf 2016.05.18 19:34
 

hi guy  i  notice  , my  broker  have 5  digit  before  dot  (example  bid or Ask  price 1.25636) ,  but  when i use marketinfo()  MarketInfo(OrderSymbol(),MODE_ASK)   return me only  4  digit ,  why ????

is possible required 5  digit  at  function ???  , exist some option or  trick  for have ???

thankz at all


avatar
13010
WHRoeder 2016.05.18 20:02 #
 
faustf: is possible required 5  digit  at  function ???
  1. If you do not use #property strict, Print output's 4 digits. With #property strict:
    Data of float type are output with 5 digits after a decimal point. To output real numbers with another accuracy or in a predefined format, use the PrintFormat() function
    Print - Common Functions - MQL4 Reference
  2. You don't want to output 5, you want to output what the pair uses. (USDJPY is 2 or 3) Don't assume:
    string price_as_string(double p){return DoubleToStr(p, Digits);  }

avatar
26
faustf 2016.05.18 21:05 #
 

hi @WHRoeder thanks  so much for reaply

i use  #property strict at top of  EA ,  but now i have  a little  bug    , sometime   print  4  digit  some time  5 digit  and  some time  17  digit

you have some idea??  thankz so mcuh



avatar
26
faustf 2016.05.18 22:18 #
 
i  answer me  is normal because  take  a  realtime  price  thankz  and  when  the  price  is  a  0  like  1.5240  the  0  not  consider 
Back to topics list  

To add comments, please log in or register