IBFX MODE "0" 5TH POINT

 

Hello, I have IBFX and its 5th decimal.

Why does MarketInfo(Symbol(),MODE_STOPLEVEL) = 0?

Why does MarketInfo(Symbol(),MODE_POINT) = 0?

Even when I am specifying point as 0.00001 with double it prints as 4 decimals. I was able to chat with IBFX and was told its because metaquotes defaults 4 decimals and not 5.

This doesn't really hurt my take profit and stop loss values but has anyone else seen this?

double UsePoint; //Expert Start Function/Decimal Point
double BuySL, BuyTP, SellSL, SellTP;
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  { 
   //---- Point Conversion
   if(Digits==2 || Digits==3) UsePoint = 0.01;
   else if(Digits==4 || Digits==5) UsePoint = 0.0001;
      //---- TP & SL prices
      //if(SL > 0) BuySL = Ask - (SL * UsePoint); //Buy Stoploss
      Print("Stoplevel:", MarketInfo(Symbol(),MODE_STOPLEVEL));
      //Buy Takeprofit
      //Sell Stoploss
      //Sell Takeprofit
   //---- Experts/Journal Print Out
   Print("DIGITS=", MarketInfo(Symbol(),MODE_DIGITS), ", SPREAD=", MarketInfo(Symbol(),MODE_SPREAD)/10);
   //----
   return(0);
  }
 

As for StopLevel=0. Thats because IBFX StopLevel=0. <-- Otherwise it'll give a value like 5, 10 or 20. In Points.

As for Point, it's because Doubles only print in 4-digits. If you want to print more than 4-digits use DoubleToString() or the shortcut provided below.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void start(){
    double UsePoint1=0.0001;
    double UsePoint2=0.00001;
    Print("Prints Points TypeCast Double______UsePoint1=",UsePoint1,"  UsePoint2=",UsePoint2);
    Print("Prints Points TypeCast String______UsePoint1="+UsePoint1,"  UsePoint2="+UsePoint2);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The + Sign changes the Type-Cast to match the String which comes before it.

2011.11.24 00:22:50     2011.01.02 23:00  Temporary EURUSD,M5: Prints Points TypeCast Double______UsePoint1=0.0001  UsePoint2=0

2011.11.24 00:22:50     2011.01.02 23:00  Temporary EURUSD,M5: Prints Points TypeCast String______UsePoint1=0.00010000  UsePoint2=0.00001000