MQL4参考 图表操作 Symbol

Symbol

Returns a text string with the name of the current financial instrument.

string  Symbol();

Parameters

None.

Returned value

A text string with the name of the current financial instrument.

Example:

   int total=OrdersTotal();
   for(int pos=0;pos<total;pos++)
     {
      // check selection result because the order may be closed or deleted at this time!
      if(OrderSelect(pos, SELECT_BY_POS)==falsecontinue;
      if(OrderType()>OP_SELL || OrderSymbol()!=Symbol()) continue;
      // performs some processing...
     }