Order Symbol Digits ?

To add comments, please log in or register
Brian Lillard
7231
Brian Lillard  

How is it possible to get the digits of the symbol from Order Select?

The order select will be selecting more than just the symbol.

I have one method I don't know if I can trust

The point is to use the order open price to find the digits.

for(int iOT=0; iOT<OrdersTotal(); iOT++){if(!OrderSelect(iOT,SELECT_BY_POS)){continue;} if(OrderType()>1){continue;}
int iOrderBase(double price)
 {
 string tmp=(string)price;
 int cnt=0;
 for(int x=(int)StringLen(tmp); x>1; x--)
  {
  tmp=(string)StringSubstr(tmp,0,1);
  if(tmp=="."){break;}
  cnt++;
  }
 switch(cnt){
  case 5: return(100000); break;
  case 4: return(10000); break;
  case 3: return(1000); break;
  case 2: return(100); break;
  case 1: return(10); break;
  default: break;
  }
 return(1);
 }
}
Mehrdad Jeddi
29403
Mehrdad Jeddi  
Brian Lillard:

How is it possible to get the digits of the symbol from Order Select?


I have one method I don't know if I can trust


Hi,

So it's easy to get digit of the symbol by OrderSymbol() function to be spent to MarketInfo() function between OrderSelect() loop:


int digits=(int)MarketInfo(OrderSymbol(),MODE_DIGITS);
To add comments, please log in or register