Filter digits x.xx85

 
i have problem programming


not get long on a trade above the last two numbers above 85 through 15 or short with the last two below 15 through 85.

Close = x.xx15
Close = x.xx85

how filter last two numbers in MQL ?
 
Alex,

Here is a quick and dirty way.
    double priceToCheck = Bid;
    string s = DoubleToStr(priceToCheck,MarketInfo(Symbol(), MODE_DIGITS) );
    Print( "Last two digits of " , priceToCheck, "=", StringSubstr(s, StringLen(s) - 2) );
  



Hope this help

Matias Romeo
Custom Metatrader Systems
matiasdotromeoatgmail.com

 
Yes
Thanks
Reason: