Funkcje własne:   NameTypeTradeOperation()

Funkcja string NameTypeTradeOperation() zwraca nazwę operacji handlowej jako wartość tekstową.

f_typeOperation - typ operacji handlowej jako stała MQL4.

f_typeOperation - typ operacji handlowej jako stała MQL4.

string NameTypeTradeOperation(int f_typeOperation) // typ operacji handlowej
  {
   switch(f_typeOperation)
     {
      case OP_BUY:       return "Buy";
      case OP_SELL:      return "Sell";
      case OP_BUYLIMIT:  return "Buy limit";
      case OP_SELLLIMIT: return "Sell limit";
      case OP_BUYSTOP:   return "Buy stop";
      case OP_SELLSTOP:  return "Sell stop";
      default:           return "Unknown type of trade operation";
     }
  }

Przykład stosowania funkcji

1) Określić nazwę operacji na sprzedaż:

NameTypeTradeOperation(OP_SELL);