English Русский 中文 Deutsch 日本語 Português
preview
StringFormat(). Panorámica, ejemplos de uso listos para aplicar

StringFormat(). Panorámica, ejemplos de uso listos para aplicar

MetaTrader 5Ejemplos | 7 diciembre 2023, 12:14
475 0
Artyom Trishkin
Artyom Trishkin

Contenido


Introducción

Al enviar información estructurada y formateada al registro usando PrintFormat(), simplemente formatearemos los datos en un formato ordenado según el formato especificado y los enviaremos al registro del terminal. Esta información formateada ya no estará disponible para su uso posterior. Para generarla nuevamente, deberemos recurrir al formateo nuevamente usando PrintFormat(). Sería bueno poder reutilizar los datos una vez formateados en el tipo deseado. Esta posibilidad existe: hablamos de la función StringFormat(). A diferencia de su "hermana" PrintFormat(), que simplemente imprime los datos en el registro, esta función retornará una línea formateada, y esto nos permitirá utilizar dicha línea más adelante en el programa, es decir, la información formateada en el formato requerido no se perderá. Y esto resulta mucho más cómodo: podemos guardar líneas formateadas en variables o en un array y tomarlas desde allí para reutilizarlas. Es mucho más flexible y cómodo.

El presente artículo supondrá más una ampliación del material de referencia con énfasis en plantillas de funciones listas para usar, que algo educativo.


StringFormat(). Breve panorámica

La función StringFormat() formatea los parámetros recibidos y devuelve la línea formateada. Las reglas para formatear una línea son exactamente las mismas que las reglas de la función PrintFormat(). Estas reglas se analizan en detalle en el artículo "Analizamos PrintFormat() y tomamos ejemplos listos para usar". En primer lugar, transmitiremos una línea con el texto y los especificadores de formato, y luego, separados por comas, los datos necesarios que deberán estar en lugar de los especificadores en la línea. Cada especificador deberá tener sus propios datos en un orden estricto.

La función permite reutilizar en un programa una línea una vez formateada. Hoy aprovecharemos esta oportunidad al crear plantillas para enviar propiedades de símbolos al registro. Así, crearemos dos funciones para cada propiedad: la primera formateará y retornará una línea, mientras que la segunda imprimirá la línea resultante en el registro.


Formateo de líneas

Para familiarizarse con las reglas del formateo de líneas, podrá leer la sección sobre todos los especificadores en el artículo sobre PrintFormat(). Para aclarar el funcionamiento de los especificadores que indican el tamaño de los datos (h | l | ll | I32 | I64), podrá utilizar el siguiente script, que muestra claramente la diferencia entre la salida de datos de diferentes tamaños:

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   long x = (long)0xFFFFFFFF * 1000;

   Print("\nDEC: ",  typename(x)," x=",x,"\n---------");
   Print("%hu: ",  StringFormat("%hu",x));
   Print("%u: ",   StringFormat("%u",x));
   Print("%I64u: ",StringFormat("%I64u",x));
   Print("%llu: ", StringFormat("%llu",x));
   Print("\nHEX: ",  typename(x)," x=",StringFormat("%llx",x),"\n---------");
   Print("%hx: ",  StringFormat("%hx",x));
   Print("%x: ",   StringFormat("%x",x));
   Print("%I64x: ",StringFormat("%I64x",x));
   Print("%llx: ", StringFormat("%llx",x));

  }

Resultados

2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  DEC: long x=4294967295000
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  ---------
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %hu: 64536
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %u: 4294966296
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %I64u: 4294967295000
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %llu: 4294967295000
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  HEX: long x=3e7fffffc18
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  ---------
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %hx: fc18
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %x: fffffc18
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %I64x: 3e7fffffc18
2023.07.12 17:48:12.920 PrinFormat (EURUSD,H1)  %llx: 3e7fffffc18

Este es probablemente el único especificador que no hemos abarcado completamente en el artículo sobre PrintFormat().


Salida formateada de las propiedades de un símbolo

Para cumplir los objetivos de este artículo, necesitaremos escribir dos funciones para cada propiedad de símbolo. La primera función formateará la línea para lograr el formato requerido para imprimir, mientras que la segunda imprimirá la línea recibida por la primera función en el registro. Para seguir el mismo principio de formato de línea que adoptamos en el artículo sobre PrintFormat(), también transmitiremos a cada función la separación de la línea respecto al borde izquierdo y la anchura del campo del encabezado. De esta forma mantendremos un formato uniforme para registrar las propiedades de la cuenta y las propiedades de los símbolos.

Para obtener el tiempo en milisegundos, crearemos una función que retornará una línea con la fecha y la hora en el formato Date Time.Msc basada en la función analizada en el artículo anterior sobre PrintFormat():

//+------------------------------------------------------------------+
//| Accept a date in ms, return time in Date Time.Msc format         |
//+------------------------------------------------------------------+
string TimeMSC(const long time_msc)
  {
   return StringFormat("%s.%.3hu",string((datetime)time_msc / 1000),time_msc % 1000);
   /* Sample output:
   2023.07.13 09:31:58.177
   */
  }

A diferencia de la función anteriormente creada, aquí retornaremos solo la fecha y la hora en milisegundos en una línea. El resto del formato se realizará en funciones que generen datos en este formato de fecha y hora.

Entonces, comenzaremos por orden: propiedades enteras, reales y string de un símbolo. Escribiremos las funciones en el orden de las propiedades en la sección de la guía de ayuda "Información sobre la herramienta".


Obtención y muestra de las propiedades enteras del símbolo ENUM_SYMBOL_INFO_INTEGER

Retraso de datos (SYMBOL_SUBSCRIPTION_DELAY)

Señal de que los datos del símbolo están retrasados. La propiedad solo se puede consultar para los símbolos seleccionados en la Observación de Mercado (SYMBOL_SELECT = true). Para símbolos no seleccionados se generará el error ERR_MARKET_NOT_SELECTED (4302)

Devuelve el valor string de la propiedad con encabezado. Para la línea formateada, podremos especificar la separación respecto al borde izquierdo y la anchura del campo del encabezado:

//+------------------------------------------------------------------+
//| Return the flag                                                  |
//} of symbol data latency as a string                               |
//+------------------------------------------------------------------+
string SymbolSubscriptionDelay(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Create a variable to store the error text
   //string error_str;
//--- If symbol does not exist, return the error text
   if(!SymbolInfoInteger(symbol,SYMBOL_EXIST))
      return StringFormat("%s: Error. Symbol '%s' is not exist",__FUNCTION__,symbol);
//--- If a symbol is not selected in MarketWatch, try to select it
   if(!SymbolInfoInteger(symbol,SYMBOL_SELECT))
     {
      //--- If unable to select a symbol in MarketWatch, return the error text
      if(!SymbolSelect(symbol,true))
         return StringFormat("%s: Failed to select '%s' symbol in MarketWatch. Error %lu",__FUNCTION__,symbol,GetLastError());
     }
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Subscription Delay:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_SUBSCRIPTION_DELAY) ? "Yes" : "No");
   /* Sample output:
      Subscription Delay: No
   */
  }

Aquí, antes de solicitar datos, primero se verificará la presencia de dicho símbolo y luego, si la verificación sobre su existencia tiene éxito, se seleccionará el símbolo en la ventana de Observación de Mercado. Si no existe tal símbolo, o no ha sido posible seleccionarlo, la función retornará un texto con la descripción del error en lugar del valor de la propiedad.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the flag                                                 |
//| of the symbol data latency in the journal                        |
//+------------------------------------------------------------------+
void SymbolSubscriptionDelayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSubscriptionDelay(symbol,header_width,indent));
  }


Sector económico (SYMBOL_SECTOR)

Sector de la economía al que pertenece el símbolo.

//+------------------------------------------------------------------+
//| Return the economic sector as a string                           |
//| a symbol belongs to                                              |
//+------------------------------------------------------------------+
string SymbolSector(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the value of the economic sector
   ENUM_SYMBOL_SECTOR symbol_sector=(ENUM_SYMBOL_SECTOR)SymbolInfoInteger(symbol,SYMBOL_SECTOR);
//--- "Cut out" the sector name from the string obtained from enum
   string sector=StringSubstr(EnumToString(symbol_sector),7);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(sector.Lower())
      sector.SetChar(0,ushort(sector.GetChar(0)-0x20));
//--- Replace all underscore characters with space in the resulting line
   StringReplace(sector,"_"," ");
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Sector:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,sector);
   /* Sample output:
      Sector: Currency
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the Economy sector the symbol belongs to in the journal  |
//+------------------------------------------------------------------+
void SymbolSectorPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSector(symbol,header_width,indent));
  }


Tipo de industria (SYMBOL_INDUSTRY)

Tipo de industria o sector de la economía al que se refiere el símbolo.

//+------------------------------------------------------------------+
//| Return the industry type or economic sector as a string          |
//| the symbol belongs to                                            |
//+------------------------------------------------------------------+
string SymbolIndustry(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get industry type value
   ENUM_SYMBOL_INDUSTRY symbol_industry=(ENUM_SYMBOL_INDUSTRY)SymbolInfoInteger(symbol,SYMBOL_INDUSTRY);
//--- "Cut out" the industry type from the string obtained from enum
   string industry=StringSubstr(EnumToString(symbol_industry),9);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(industry.Lower())
      industry.SetChar(0,ushort(industry.GetChar(0)-0x20));
//--- Replace all underscore characters with space in the resulting line
   StringReplace(industry,"_"," ");
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Industry:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,industry);
   /* Sample output:
      Industry: Undefined
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the industry type or economic sector                     |
//| the symbol belongs to                                            |
//+------------------------------------------------------------------+
void SymbolIndustryPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolIndustry(symbol,header_width,indent));
  }


Símbolo personalizado (SYMBOL_CUSTOM)

Señal de que el símbolo es personalizado, es decir, creado artificialmente usando como base otros símbolos de la Observación de Mercado y/o fuentes de datos externas.

//+------------------------------------------------------------------+
//| Return the flag                                                  |
//| of a custom symbol                                               |
//+------------------------------------------------------------------+
string SymbolCustom(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Custom symbol:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_CUSTOM) ? "Yes" : "No");
   /* Sample output:
   Custom symbol: No
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the flag                                                 |
//| of a custom symbol                                               |
//+------------------------------------------------------------------+
void SymbolCustomPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolCustom(symbol,header_width,indent));
  }


Color de fondo en la Observación de Mercado (SYMBOL_BACKGROUND_COLOR)

Color de fondo utilizado para resaltar el símbolo en la Observación de Mercado.

//+------------------------------------------------------------------+
//| Return the background color                                      |
//| used to highlight the Market Watch symbol as a string            |
//+------------------------------------------------------------------+
string SymbolBackgroundColor(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Background color:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the symbol background color in Market Watch
   color back_color=(color)SymbolInfoInteger(symbol,SYMBOL_BACKGROUND_COLOR);
//--- Return the property value with a header having the required width and indentation
//--- If a default color is set for a symbol (0xFF000000), return 'Default', otherwise - return its string description
   return StringFormat("%*s%-*s%-s",indent,"",w,header,back_color==0xFF000000 ? "Default" : ColorToString(back_color,true));
   /* Sample output:
   Background color: Default
   */
  }

El color de fondo se puede establecer en un color completamente transparente, que ColorToString() retornará como negro (0, 0, 0). Pero eso no es así. Este es el llamado color predeterminado: 0xFF000000 — CLR_DEFAULT. Tiene un RGB igual a cero, que se corresponderá con el negro, pero es completamente transparente. El color predeterminado tiene un canal alfa, lo cual le da al fondo una transparencia total de 0xFF000000. Por lo tanto, antes de mostrar el nombre del color usando ColorToString(), verificaremos su igualdad con CLR_DEFAULT.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Displays the background color                                    |
//| used to highlight the Market Watch symbol as a string            |
//+------------------------------------------------------------------+
void SymbolBackgroundColorPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolBackgroundColor(symbol,header_width,indent));
  }


Precio para la construcción de las barras (SYMBOL_CHART_MODE)

El tipo de precio para la construcción de barras es Bid o Last.

//+------------------------------------------------------------------+
//| Return the price type for building bars as a string              |
//+------------------------------------------------------------------+
string SymbolChartMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get price type used for generating bars
   ENUM_SYMBOL_CHART_MODE symbol_chart_mode=(ENUM_SYMBOL_CHART_MODE)SymbolInfoInteger(symbol,SYMBOL_CHART_MODE);
//--- "Cut out" price type from the string obtained from enum
   string chart_mode=StringSubstr(EnumToString(symbol_chart_mode),18);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(chart_mode.Lower())
      chart_mode.SetChar(0,ushort(chart_mode.GetChar(0)-0x20));
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Chart mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,chart_mode);
   /* Sample output:
      Chart mode: Bid
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Log the price type for building bars                             |
//+------------------------------------------------------------------+
void SymbolChartModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolChartMode(symbol,header_width,indent));
  }


Existencia de un símbolo (SYMBOL_EXIST)

Señal de que existe un símbolo con el mismo nombre.

//+------------------------------------------------------------------+
//| Return the flag                                                  |
//| indicating that a symbol with this name exists                   |
//+------------------------------------------------------------------+
string SymbolExists(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Exists:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_EXIST) ? "Yes" : "No");
   /* Sample output:
   Exists: Yes
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the flag                                                 |
//| indicating that a symbol with this name exists                   |
//+------------------------------------------------------------------+
void SymbolExistsPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolExists(symbol,header_width,indent));
  }


Seleccionado en la Observación de Mercado (SYMBOL_SELECT)

Señal de que el símbolo está seleccionado en la Observación de Mercado.

//+------------------------------------------------------------------+
//| Return the flag                                                  |
//| indicating that the symbol is selected in Market Watch           |
//+------------------------------------------------------------------+
string SymbolSelected(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Selected:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_SELECT) ? "Yes" : "No");
   /* Sample output:
   Selected: Yes
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+--------------------------------------------------------------------------------+
//| Display the flag, that the symbol is selected in Market Watch, in the journal  |
//+--------------------------------------------------------------------------------+
void SymbolSelectedPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSelected(symbol,header_width,indent));
  }


Se representa en la Observación de Mercado (SYMBOL_VISIBLE)

Señal de que el símbolo seleccionado se muestra en la Observación de Mercado.
Algunos símbolos (normalmente los tipos de cambio cruzado, necesarios para calcular los requisitos de margen y los beneficios en la divisa del depósito) se seleccionan automáticamente, pero es posible que no se muestren en la Observación de Mercado. Dichos símbolos deberán seleccionarse explícitamente para que se muestren.

//+------------------------------------------------------------------+
//| Return the flag                                                  |
//| indicating that the symbol is visible in Market Watch            |
//+------------------------------------------------------------------+
string SymbolVisible(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Visible:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_VISIBLE) ? "Yes" : "No");
   /* Sample output:
   Visible: Yes
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the flag                                                 |
//| indicating that the symbol is visible in Market Watch            |
//+------------------------------------------------------------------+
void SymbolVisiblePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVisible(symbol,header_width,indent));
  }


Número de transacciones en la sesión actual (SYMBOL_SESSION_DEALS)

//+------------------------------------------------------------------+
//| Return the number of deals in the current session as a string    |
//+------------------------------------------------------------------+
string SymbolSessionDeals(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session deals:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-llu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_SESSION_DEALS));
   /* Sample output:
      Session deals: 0
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the number of deals in the current session in the journal|
//+------------------------------------------------------------------+
void SymbolSessionDealsPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionDeals(symbol,header_width,indent));
  }


Número de órdenes de compra (SYMBOL_SESSION_BUY_ORDERS)

Número total de órdenes de compra en el momento actual

//+------------------------------------------------------------------+
//| Return the total number                                          |
//| of current buy orders as a string                                |
//+------------------------------------------------------------------+
string SymbolSessionBuyOrders(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session Buy orders:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-llu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_SESSION_BUY_ORDERS));
   /* Sample output:
      Session Buy orders: 0
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the total number of Buy orders at the moment             |
//+------------------------------------------------------------------+
void SymbolSessionBuyOrdersPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionBuyOrders(symbol,header_width,indent));
  }


Número de órdenes de venta (SYMBOL_SESSION_SELL_ORDERS)

El número total de órdenes de venta en el momento actual.

//+------------------------------------------------------------------+
//| Return the total number                                          |
//| of current sell orders as a string                               |
//+------------------------------------------------------------------+
string SymbolSessionSellOrders(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session Sell orders:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-llu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_SESSION_BUY_ORDERS));
   /* Sample output:
      Session Sell orders: 0
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the total number of Sell orders at the moment            |
//+------------------------------------------------------------------+
void SymbolSessionSellOrdersPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionSellOrders(symbol,header_width,indent));
  }


Volumen en la última transacción (SYMBOL_VOLUME)

Volume — volumen en la última transacción.

//+------------------------------------------------------------------+
//| Return the last trade volume as a string                         |
//+------------------------------------------------------------------+
string SymbolVolume(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-llu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_VOLUME));
   /* Sample output:
      Volume: 0
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the last trade volume in the journal                     |
//+------------------------------------------------------------------+
void SymbolVolumePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolume(symbol,header_width,indent));
  }


Volumen máximo en el día (SYMBOL_VOLUMEHIGH)

//+------------------------------------------------------------------+
//| Return the maximum volume per day as a string                    |
//+------------------------------------------------------------------+
string SymbolVolumeHigh(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume high:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-llu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_VOLUMEHIGH));
   /* Sample output:
      Volume high: 0
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum volume per day in the journal                |
//+------------------------------------------------------------------+
void SymbolVolumeHighPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeHigh(symbol,header_width,indent));
  }


Volumen mínimo en el día (SYMBOL_VOLUMELOW)

//+------------------------------------------------------------------+
//| Return the minimum volume per day as a string                    |
//+------------------------------------------------------------------+
string SymbolVolumeLow(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume low:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-llu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_VOLUMELOW));
   /* Sample output:
      Volume low: 0
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum volume per day in the journal                |
//+------------------------------------------------------------------+
void SymbolVolumeLowPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeLow(symbol,header_width,indent));
  }


Fecha y hora de la última cotización (SYMBOL_TIME)

//+------------------------------------------------------------------+
//| Return the last quote time as a string                           |
//+------------------------------------------------------------------+
string SymbolTime(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Time:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(string)(datetime)SymbolInfoInteger(symbol,SYMBOL_TIME));
   /* Sample output:
      Time: 2023.07.13 21:05:12
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the last quote time in the journal                       |
//+------------------------------------------------------------------+
void SymbolTimePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTime(symbol,header_width,indent));
  }


Fecha y hora de la última cotización en ms (SYMBOL_TIME_MSC)

Fecha y hora de la última cotización en milisegundos desde 1970.01.01.

//+------------------------------------------------------------------+
//| Return the last quote time as a string in milliseconds           |
//+------------------------------------------------------------------+
string SymbolTimeMSC(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Time msc:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,TimeMSC(SymbolInfoInteger(symbol,SYMBOL_TIME_MSC)));
   /* Sample output:
      Time msc: 2023.07.13 21:09:24.327
   */
  }

Aquí, para obtener una línea de fecha y hora con milisegundos, usaremos la función TimeMSC() escrita al principio del todo.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the last quote time in milliseconds in the journal       |
//+------------------------------------------------------------------+
void SymbolTimeMSCPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTimeMSC(symbol,header_width,indent));
  }


Dígitos (SYMBOL_DIGITS)

Varios dígitos después de la coma.

//+------------------------------------------------------------------+
//| Return the number of decimal places as a string                  |
//+------------------------------------------------------------------+
string SymbolDigits(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Digits:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-lu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_DIGITS));
   /* Sample output:
      Digits: 5
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the number of decimal places in the journal              |
//+------------------------------------------------------------------+
void SymbolDigitsPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolDigits(symbol,header_width,indent));
  }


Spread (SYMBOL_SPREAD)

Tamaño del spread en puntos.

//+------------------------------------------------------------------+
//| Return the spread size in points as a string                     |
//+------------------------------------------------------------------+
string SymbolSpread(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Spread:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-lu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_SPREAD));
   /* Sample output:
      Spread: 7
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the spread size in points in the journal                 |
//+------------------------------------------------------------------+
void SymbolSpreadPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSpread(symbol,header_width,indent));
  }


Spread flotante (SYMBOL_SPREAD_FLOAT)

Señal de spread flotante

//+------------------------------------------------------------------+
//| Return the floating spread flag as a string                      |
//+------------------------------------------------------------------+
string SymbolSpreadFloat(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Floating Spread:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_SPREAD_FLOAT) ? "Yes" : "No");
   /* Sample output:
   Spread float: Yes
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the floating spread flag in the journal                  |
//+------------------------------------------------------------------+
void SymbolSpreadFloatPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSpreadFloat(symbol,header_width,indent));
  }


Número de solicitudes en la profundad de mercado (SYMBOL_TICKS_BOOKDEPTH)

Número máximo de solicitudes mostradas en la profundad de mercado. Para instrumentos que no tienen cola de solicitudes, el valor será 0.

//+------------------------------------------------------------------+
//| Return the maximum number of                                     |
//| displayed market depth requests in the journal                   |
//+------------------------------------------------------------------+
string SymbolTicksBookDepth(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Ticks book depth:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-lu",indent,"",w,header,SymbolInfoInteger(symbol,SYMBOL_TICKS_BOOKDEPTH));
   /* Sample output:
      Ticks book depth: 10
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum number of                                    |
//| displayed market depth requests in the journal                   |
//+------------------------------------------------------------------+
void SymbolTicksBookDepthPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTicksBookDepth(symbol,header_width,indent));
  }


Método de cálculo del valor del contrato (SYMBOL_TRADE_CALC_MODE)

Método de cálculo del valor del contrato.

//+------------------------------------------------------------------+
//| Return the contract price calculation mode as a string           |
//+------------------------------------------------------------------+
string SymbolTradeCalcMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the contract price calculation mode value
   ENUM_SYMBOL_CALC_MODE symbol_trade_calc_mode=(ENUM_SYMBOL_CALC_MODE)SymbolInfoInteger(symbol,SYMBOL_TRADE_CALC_MODE);
//--- "Cut out" the contract price calculation mode from the string obtained from enum
   string trade_calc_mode=StringSubstr(EnumToString(symbol_trade_calc_mode),17);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(trade_calc_mode.Lower())
      trade_calc_mode.SetChar(0,ushort(trade_calc_mode.GetChar(0)-0x20));
//--- Replace all underscore characters with space in the resulting line
   StringReplace(trade_calc_mode,"_"," ");
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Trade calculation mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,trade_calc_mode);
   /* Sample output:
      Trade calculation mode: Forex
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the contract price calculation mode in the journal       |
//+------------------------------------------------------------------+
void SymbolTradeCalcModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeCalcMode(symbol,header_width,indent));
  }


Tipo de ejecución de las órdenes (SYMBOL_TRADE_MODE)

Tipo de ejecución de las órdenes.

//+------------------------------------------------------------------+
//| Return the order execution type as a string                      |
//+------------------------------------------------------------------+
string SymbolTradeMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the contract price calculation mode value
   ENUM_SYMBOL_TRADE_MODE symbol_trade_mode=(ENUM_SYMBOL_TRADE_MODE)SymbolInfoInteger(symbol,SYMBOL_TRADE_MODE);
//--- "Cut out" the contract price calculation mode from the string obtained from enum
   string trade_mode=StringSubstr(EnumToString(symbol_trade_mode),18);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(trade_mode.Lower())
      trade_mode.SetChar(0,ushort(trade_mode.GetChar(0)-0x20));
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Trade mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,trade_mode);
   /* Sample output:
      Trade mode: Full
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the order execution type in the journal                  |
//+------------------------------------------------------------------+
void SymbolTradeModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeMode(symbol,header_width,indent));
  }


Fecha de inicio de las transacciones (SYMBOL_START_TIME)

Fecha de inicio de la negociación del instrumento (normalmente utilizada para contratos de futuros).

//+------------------------------------------------------------------+
//| Return the trading start date for an instrument as a string      |
//+------------------------------------------------------------------+
string SymbolStartTime(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Start time:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the property value and define its description
   long time=SymbolInfoInteger(symbol,SYMBOL_START_TIME);
   string descr=(time==0 ? " (Not used)" : "");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s%s",indent,"",w,header,(string)(datetime)time,descr);
   /* Sample output:
      Start time: 1970.01.01 00:00:00 (Not used)
   */
  }

Si no se especifica el valor (es igual a cero), se mostrará como una fecha y una hora en el formato 1970.01.01. 00:00:00. Es un poco confuso. Por lo tanto, en tal situación, se mostrará la aclaración "Not used" tras el valor de fecha y hora.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the trading start date for an instrument in the journal  |
//+------------------------------------------------------------------+
void SymbolSymbolStartTimePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolStartTime(symbol,header_width,indent));
  }


Fecha de finalización de las transacciones

Fecha de finalización de la negociación del instrumento (normalmente utilizada para contratos de futuros).

//+------------------------------------------------------------------+
//| Return the trading end date for an instrument as a string        |
//+------------------------------------------------------------------+
string SymbolExpirationTime(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Expiration time:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the property value and define its description
   long time=SymbolInfoInteger(symbol,SYMBOL_EXPIRATION_TIME);
   string descr=(time==0 ? " (Not used)" : "");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s%s",indent,"",w,header,(string)(datetime)time,descr);
   /* Sample output:
      Expiration time: 1970.01.01 00:00:00 (Not used)
   */
  }

Si no se especifica el valor (es igual a cero), se mostrará la aclaración "Not used" tras el valor de fecha y hora.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the trading end date for an instrument in the journal    |
//+------------------------------------------------------------------+
void SymbolSymbolExpirationTimePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolExpirationTime(symbol,header_width,indent));
  }


Nivel stop (SYMBOL_TRADE_STOPS_LEVEL)

Separación mínima en puntos respecto al precio de cierre actual para establecer órdenes Stop.

//+--------------------------------------------------------------------------+
//| Return the minimum indentation                                           |
//| from the current close price in points to place Stop orders as a string  |
//+--------------------------------------------------------------------------+
string SymbolTradeStopsLevel(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Stops level:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the property value and define its description
   int stops_level=(int)SymbolInfoInteger(symbol,SYMBOL_TRADE_STOPS_LEVEL);
   string descr=(stops_level==0 ? " (By Spread)" : "");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-lu%s",indent,"",w,header,stops_level,descr);
   /* Sample output:
      Stops level: 0 (By Spread)
   */
  }

Si el valor es igual a cero, esto no significará que el nivel de establecimiento de paradas sea cero o que no exista. Esto significa que Stops Level dependerá del valor Spread. Normalmente 2 * Spread, por lo que se mostrará la entrada explicativa “By Spread”.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum indentation in points from the previous      |
//| close price for setting Stop orders in the journal               |
//+------------------------------------------------------------------+
void SymbolTradeStopsLevelPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeStopsLevel(symbol,header_width,indent));
  }


Nivel de congelación (SYMBOL_TRADE_FREEZE_LEVEL)

Distancia de congelación para las transacciones comerciales (en puntos).

//+------------------------------------------------------------------+
//| Return the distance of freezing                                  |
//| trading operations in points as a string                         |
//+------------------------------------------------------------------+
string SymbolTradeFreezeLevel(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Freeze level:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the property value and define its description
   int freeze_level=(int)SymbolInfoInteger(symbol,SYMBOL_TRADE_FREEZE_LEVEL);
   string descr=(freeze_level==0 ? " (Not used)" : "");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-lu%s",indent,"",w,header,freeze_level,descr);
   /* Sample output:
      Freeze level: 0 (Not used)
   */
  }

Si el valor es igual a cero, significa que no se utilizará el nivel de congelación, por lo que se mostrará la entrada explicativa “Not used”.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------------------+
//| Display the distance of freezing trading operations in points in the journal |
//+------------------------------------------------------------------------------+
void SymbolTradeFreezeLevelPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeFreezeLevel(symbol,header_width,indent));
  }


Modo de ejecución de transacciones (SYMBOL_TRADE_EXEMODE)

Modo de ejecución de transacciones.

//+------------------------------------------------------------------+
//| Return the trade execution mode as a string                      |
//+------------------------------------------------------------------+
string SymbolTradeExeMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the contract price calculation mode value
   ENUM_SYMBOL_TRADE_EXECUTION symbol_trade_exemode=(ENUM_SYMBOL_TRADE_EXECUTION)SymbolInfoInteger(symbol,SYMBOL_TRADE_EXEMODE);
//--- "Cut out" the contract price calculation mode from the string obtained from enum
   string trade_exemode=StringSubstr(EnumToString(symbol_trade_exemode),23);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(trade_exemode.Lower())
      trade_exemode.SetChar(0,ushort(trade_exemode.GetChar(0)-0x20));
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Trade Execution mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,trade_exemode);
   /* Sample output:
      Trade Execution mode: Instant
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the trade execution mode in the journal                  |
//+------------------------------------------------------------------+
void SymbolTradeExeModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeExeMode(symbol,header_width,indent));
  }


Modelo de cálculo del swap (SYMBOL_SWAP_MODE)

Modelo de cálculo del swap.

//+------------------------------------------------------------------+
//| Return the swap calculation model as a string                    |
//+------------------------------------------------------------------+
string SymbolSwapMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the value of the swap calculation model
   ENUM_SYMBOL_SWAP_MODE symbol_swap_mode=(ENUM_SYMBOL_SWAP_MODE)SymbolInfoInteger(symbol,SYMBOL_SWAP_MODE);
//--- "Cut out" the swap calculation model from the string obtained from enum
   string swap_mode=StringSubstr(EnumToString(symbol_swap_mode),17);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(swap_mode.Lower())
      swap_mode.SetChar(0,ushort(swap_mode.GetChar(0)-0x20));
//--- Replace all underscore characters with space in the resulting line
   StringReplace(swap_mode,"_"," ");
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,swap_mode);
   /* Sample output:
      Swap mode: Points
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap calculation model to the journal                |
//+------------------------------------------------------------------+
void SymbolSwapModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapMode(symbol,header_width,indent));
  }


Día de acumulación de swap triple (SYMBOL_SWAP_ROLLOVER3DAYS)

Día de la semana para el cobro del triple swap.

//+--------------------------------------------------------------------+
//| Return the day of the week for calculating triple swap as a string |
//+--------------------------------------------------------------------+
string SymbolSwapRollover3Days(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the value of the swap calculation model
   ENUM_DAY_OF_WEEK symbol_swap_rollover3days=(ENUM_DAY_OF_WEEK)SymbolInfoInteger(symbol,SYMBOL_SWAP_ROLLOVER3DAYS);
//--- Convert enum into a string with the name of the day
   string swap_rollover3days=EnumToString(symbol_swap_rollover3days);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(swap_rollover3days.Lower())
      swap_rollover3days.SetChar(0,ushort(swap_rollover3days.GetChar(0)-0x20));
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap Rollover 3 days:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,swap_rollover3days);
   /* Sample output:
      Swap Rollover 3 days: Wednesday
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+-------------------------------------------------------------------------+
//| Display the day of the week for calculating triple swap in the journal  |
//+-------------------------------------------------------------------------+
void SymbolSwapRollover3DaysPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapRollover3Days(symbol,header_width,indent));
  }


Modo de cálculo del margen cubierto (SYMBOL_MARGIN_HEDGED_USE_LEG)

Modalidad de cálculo del margen cubierto en el lado más alto (Buy o Sell).

//+------------------------------------------------------------------+
//| Return the calculation mode                                      |
//| of hedged margin using the larger leg as a string                |
//+------------------------------------------------------------------+
string SymbolMarginHedgedUseLeg(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Margin hedged use leg:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,(bool)SymbolInfoInteger(symbol,SYMBOL_MARGIN_HEDGED_USE_LEG) ? "Yes" : "No");
   /* Sample output:
   Margin hedged use leg: No
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the mode for calculating the hedged                      |
//| margin using the larger leg in the journal                       |
//+------------------------------------------------------------------+
void SymbolMarginHedgedUseLegPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolMarginHedgedUseLeg(symbol,header_width,indent));
  }


Banderas de los modos de vencimiento de las órdenes (SYMBOL_EXPIRATION_MODE)

Para cada instrumento financiero se podrán especificar varios modos de plazo de validez (vencimiento) de las órdenes pendientes. Cada modo tiene una bandera vinculada; las banderas se pueden combinar usando un OR lógico (|), por ejemplo, SYMBOL_EXPIRATION_GTC|SYMBOL_EXPIRATION_SPECIFIED. Para verificar si un modo particular está habilitado para un instrumento, el resultado de un AND lógico (&) deberá compararse con el indicador de modo.

Y si para el símbolo se ha especificado la bandera SYMBOL_EXPIRATION_SPECIFIED, al enviar una orden pendiente, se podrá indicar específicamente hasta qué momento esta orden pendiente es válida.

//+------------------------------------------------------------------+
//| Return the flags of allowed order expiration modes as a string   |
//+------------------------------------------------------------------+
string SymbolExpirationMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get order expiration modes
   int exp_mode=(int)SymbolInfoInteger(symbol,SYMBOL_EXPIRATION_MODE);
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Expiration mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);

//--- Parse mode flags into components
   string flags="";
   if((exp_mode&SYMBOL_EXPIRATION_GTC)==SYMBOL_EXPIRATION_GTC)
      flags+=(flags.Length()>0 ? "|" : "")+"GTC";
   if((exp_mode&SYMBOL_EXPIRATION_DAY)==SYMBOL_EXPIRATION_DAY)
      flags+=(flags.Length()>0 ? "|" : "")+"DAY";
   if((exp_mode&SYMBOL_EXPIRATION_SPECIFIED)==SYMBOL_EXPIRATION_SPECIFIED)
      flags+=(flags.Length()>0 ? "|" : "")+"SPECIFIED";
   if((exp_mode&SYMBOL_EXPIRATION_SPECIFIED_DAY)==SYMBOL_EXPIRATION_SPECIFIED_DAY)
      flags+=(flags.Length()>0 ? "|" : "")+"SPECIFIED_DAY";

//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,flags);
   /* Sample output:
   Expiration mode: GTC|DAY|SPECIFIED
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+--------------------------------------------------------------------+
//| Display the flags of allowed order expiration modes in the journal |
//+--------------------------------------------------------------------+
void SymbolExpirationModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolExpirationMode(symbol,header_width,indent));
  }


Banderas de modos de rellenado de órdenes (SYMBOL_FILLING_MODE)

Banderas de modos de rellenado de órdenes permitidos.

Al enviar una orden, podemos especificar la política para completar el volumen indicado en la orden comercial. Para cada instrumento, podemos configurar más de un modo usando una combinación de banderas. La combinación de banderas se expresa mediante la operación lógica OR (|), por ejemplo, SYMBOL_FILLING_FOK|SYMBOL_FILLING_IOC. El tipo de rellenado ORDER_FILLING_RETURN estará permitido en todos los modos de ejecución, salvo en el modo "Ejecución por mercado" (SYMBOL_TRADE_EXECUTION_MARKET).
//+------------------------------------------------------------------+
//| Return the flags of allowed order filling modes as a string      |
//+------------------------------------------------------------------+
string SymbolFillingMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get order filling modes
   int fill_mode=(int)SymbolInfoInteger(symbol,SYMBOL_FILLING_MODE);
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Filling mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);

//--- Parse mode flags into components
   string flags="";
   if((fill_mode&ORDER_FILLING_FOK)==ORDER_FILLING_FOK)
      flags+=(flags.Length()>0 ? "|" : "")+"FOK";
   if((fill_mode&ORDER_FILLING_IOC)==ORDER_FILLING_IOC)
      flags+=(flags.Length()>0 ? "|" : "")+"IOC";
   if((fill_mode&ORDER_FILLING_BOC)==ORDER_FILLING_BOC)
      flags+=(flags.Length()>0 ? "|" : "")+"BOC";
   if(SymbolInfoInteger(symbol,SYMBOL_TRADE_EXEMODE)!=SYMBOL_TRADE_EXECUTION_MARKET)
      flags+=(flags.Length()>0 ? "|" : "")+"RETURN";

//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,flags);
   /* Sample output:
   Filling mode: FOK|IOC|RETURN
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the flags of allowed order filling modes in the journal  |
//+------------------------------------------------------------------+
void SymbolFillingModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolFillingMode(symbol,header_width,indent));
  }


Banderas de tipos de órdenes permitidos (SYMBOL_ORDER_MODE)

//+------------------------------------------------------------------+
//| Return flags of allowed order types as a string                  |
//+------------------------------------------------------------------+
string SymbolOrderMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get order types
   int order_mode=(int)SymbolInfoInteger(symbol,SYMBOL_ORDER_MODE);
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Order mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);

//--- Parse type flags into components
   string flags="";
   if((order_mode&SYMBOL_ORDER_MARKET)==SYMBOL_ORDER_MARKET)
      flags+=(flags.Length()>0 ? "|" : "")+"MARKET";
   if((order_mode&SYMBOL_ORDER_LIMIT)==SYMBOL_ORDER_LIMIT)
      flags+=(flags.Length()>0 ? "|" : "")+"LIMIT";
   if((order_mode&SYMBOL_ORDER_STOP)==SYMBOL_ORDER_STOP)
      flags+=(flags.Length()>0 ? "|" : "")+"STOP";
   if((order_mode&SYMBOL_ORDER_STOP_LIMIT )==SYMBOL_ORDER_STOP_LIMIT )
      flags+=(flags.Length()>0 ? "|" : "")+"STOP_LIMIT";
   if((order_mode&SYMBOL_ORDER_SL)==SYMBOL_ORDER_SL)
      flags+=(flags.Length()>0 ? "|" : "")+"SL";
   if((order_mode&SYMBOL_ORDER_TP)==SYMBOL_ORDER_TP)
      flags+=(flags.Length()>0 ? "|" : "")+"TP";
   if((order_mode&SYMBOL_ORDER_CLOSEBY)==SYMBOL_ORDER_CLOSEBY)
      flags+=(flags.Length()>0 ? "|" : "")+"CLOSEBY";

//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,flags);
   /* Sample output:
   Order mode: MARKET|LIMIT|STOP|STOP_LIMIT|SL|TP|CLOSEBY
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the flags of allowed order types in the journal          |
//+------------------------------------------------------------------+
void SymbolOrderModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolOrderMode(symbol,header_width,indent));
  }


Periodo de validez de las órdenes StopLoss y TakeProfit (SYMBOL_ORDER_GTC_MODE)

Periodo de validez de las órdenes StopLoss y TakeProfit, si SYMBOL_EXPIRATION_MODE=SYMBOL_EXPIRATION_GTC (Good till cancelled).

//+------------------------------------------------------------------+
//| Return StopLoss and TakeProfit validity periods as a string      |
//+------------------------------------------------------------------+
string SymbolOrderGTCMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the value of the validity period of pending, StopLoss and TakeProfit orders
   ENUM_SYMBOL_ORDER_GTC_MODE symbol_order_gtc_mode=(ENUM_SYMBOL_ORDER_GTC_MODE)SymbolInfoInteger(symbol,SYMBOL_ORDER_GTC_MODE);
//--- Set the validity period description as 'GTC'
   string gtc_mode="GTC";
//--- If the validity period is not GTC
   if(symbol_order_gtc_mode!=SYMBOL_ORDERS_GTC)
     {
      //--- "Cut out" pending, StopLoss and TakeProfit order validity periods from the string obtained from enum
      StringSubstr(EnumToString(symbol_order_gtc_mode),14);
      //--- Convert all obtained symbols to lower case and replace the first letter from small to capital
      if(gtc_mode.Lower())
         gtc_mode.SetChar(0,ushort(gtc_mode.GetChar(0)-0x20));
      //--- Replace all underscore characters with space in the resulting line
      StringReplace(gtc_mode,"_"," ");
     }
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Order GTC mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,gtc_mode);
   /* Sample output:
      Order GTC mode: GTC
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display StopLoss and TakeProfit validity periods in the journal  |
//+------------------------------------------------------------------+
void SymbolOrderGTCModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolOrderGTCMode(symbol,header_width,indent));
  }


Tipo de opción (SYMBOL_OPTION_MODE)

Tipo de opción.

//+------------------------------------------------------------------+
//| Return option type as a string                                   |
//+------------------------------------------------------------------+
string SymbolOptionMode(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the value of the option type model
   ENUM_SYMBOL_OPTION_MODE symbol_option_mode=(ENUM_SYMBOL_OPTION_MODE)SymbolInfoInteger(symbol,SYMBOL_OPTION_MODE);
//--- "Cut out" the option type from the string obtained from enum
   string option_mode=StringSubstr(EnumToString(symbol_option_mode),19);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(option_mode.Lower())
      option_mode.SetChar(0,ushort(option_mode.GetChar(0)-0x20));
//--- Replace all underscore characters with space in the resulting line
   StringReplace(option_mode,"_"," ");
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Option mode:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,option_mode);
   /* Sample output:
      Option mode: European
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option type in the journal                           |
//+------------------------------------------------------------------+
void SymbolOptionModePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolOptionMode(symbol,header_width,indent));
  }


Derecho de la opción (SYMBOL_OPTION_RIGHT)

Derecho de la opción (Call/Put).

//+------------------------------------------------------------------+
//| Return the option right as a string                              |
//+------------------------------------------------------------------+
string SymbolOptionRight(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Get the option right value
   ENUM_SYMBOL_OPTION_RIGHT symbol_option_right=(ENUM_SYMBOL_OPTION_RIGHT)SymbolInfoInteger(symbol,SYMBOL_OPTION_RIGHT);
//--- "Cut out" the option right from the string obtained from enum
   string option_right=StringSubstr(EnumToString(symbol_option_right),20);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(option_right.Lower())
      option_right.SetChar(0,ushort(option_right.GetChar(0)-0x20));
//--- Replace all underscore characters with space in the resulting line
   StringReplace(option_right,"_"," ");
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Option right:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-s",indent,"",w,header,option_right);
   /* Sample output:
      Option right: Call
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option right in the journal                          |
//+------------------------------------------------------------------+
void SymbolOptionRightPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolOptionRight(symbol,header_width,indent));
  }


Obtener y mostrar las propiedades reales de un símbolo ENUM_SYMBOL_INFO_DOUBLE

Precio Bid (SYMBOL_BID)

Bid es la mejor oferta para la venta.

//+------------------------------------------------------------------+
//| Return the Bid price as a string                                 |
//+------------------------------------------------------------------+
string SymbolBid(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Bid:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_BID));
   /* Sample output:
   Bid: 1.31017
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the Bid price in the journal                             |
//+------------------------------------------------------------------+
void SymbolBidPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolBid(symbol,header_width,indent));
  }


Bid máximo en el día (SYMBOL_BIDHIGH)

//+------------------------------------------------------------------+
//| Return the maximum Bid per day as a string                       |
//+------------------------------------------------------------------+
string SymbolBidHigh(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Bid High:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_BIDHIGH));
   /* Sample output:
   Bid High: 1.31422
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum Bid per day in the journal                   |
//+------------------------------------------------------------------+
void SymbolBidHighPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolBidHigh(symbol,header_width,indent));
  }


Bid mínimo en el día (SYMBOL_BIDLOW)

//+------------------------------------------------------------------+
//| Return the minimum Bid per day as a string                       |
//+------------------------------------------------------------------+
string SymbolBidLow(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Bid Low:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_BIDLOW));
   /* Sample output:
   Bid Low: 1.30934
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum Bid per day in the journal                   |
//+------------------------------------------------------------------+
void SymbolBidLowPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolBidLow(symbol,header_width,indent));
  }


Precio Ask (SYMBOL_ASK)

Ask es la mejor oferta para la compra.

//+------------------------------------------------------------------+
//| Return the Ask price as a string                                 |
//+------------------------------------------------------------------+
string SymbolAsk(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Ask:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_ASK));
   /* Sample output:
   Ask: 1.31060
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the Ask price in the journal                             |
//+------------------------------------------------------------------+
void SymbolAskPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolAsk(symbol,header_width,indent));
  }


Ask máximo en el día (SYMBOL_ASKHIGH)

//+------------------------------------------------------------------+
//| Return the maximum Ask per day as a string                       |
//+------------------------------------------------------------------+
string SymbolAskHigh(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Ask High:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_ASKHIGH));
   /* Sample output:
   Ask High: 1.31427
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum Ask per day in the journal                   |
//+------------------------------------------------------------------+
void SymbolAskHighPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolAskHigh(symbol,header_width,indent));
  }


Ask mínimo en el día (SYMBOL_ASKLOW)

//+------------------------------------------------------------------+
//| Return the minimum Ask per day as a string                       |
//+------------------------------------------------------------------+
string SymbolAskLow(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Ask Low:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_ASKLOW));
   /* Sample output:
   Ask Low: 1.30938
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum Ask per day in the journal                   |
//+------------------------------------------------------------------+
void SymbolAskLowPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolAskLow(symbol,header_width,indent));
  }


Precio Last (SYMBOL_LAST)

Precio al que se ha realizado la última transacción.

//+------------------------------------------------------------------+
//| Return the Last price as a string                                |
//+------------------------------------------------------------------+
string SymbolLast(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Last:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_LAST));
   /* Sample output:
   Last: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the Last price in the journal                            |
//+------------------------------------------------------------------+
void SymbolLastPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolLast(symbol,header_width,indent));
  }


Last máximo en el día (SYMBOL_LASTHIGH)

//+------------------------------------------------------------------+
//| Return the maximum Last per day as a string                      |
//+------------------------------------------------------------------+
string SymbolLastHigh(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Last High:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_LASTHIGH));
   /* Sample output:
   Last High: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum Last per day in the journal                  |
//+------------------------------------------------------------------+
void SymbolLastHighPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolLastHigh(symbol,header_width,indent));
  }


Last mínimo en el día (SYMBOL_LASTLOW)

//+------------------------------------------------------------------+
//| Return the minimum Last per day as a string                      |
//+------------------------------------------------------------------+
string SymbolLastLow(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Last Low:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_LASTLOW));
   /* Sample output:
   Last Low: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum Last per day in the journal                  |
//+------------------------------------------------------------------+
void SymbolLastLowPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolLastLow(symbol,header_width,indent));
  }


Volumen de la última transacción (SYMBOL_VOLUME_REAL)

Volumen de la última transacción completada

//+------------------------------------------------------------------+
//| Return the last executed trade volume as a string                |
//+------------------------------------------------------------------+
string SymbolVolumeReal(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume real:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_VOLUME_REAL));
   /* Sample output:
   Volume real: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the last executed trade volume in the journal            |
//+------------------------------------------------------------------+
void SymbolVolumeRealPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeReal(symbol,header_width,indent));
  }


Volumen máximo en el día (SYMBOL_VOLUMEHIGH_REAL)

//+------------------------------------------------------------------+
//| Return the maximum volume per day as a string                    |
//+------------------------------------------------------------------+
string SymbolVolumeHighReal(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume High real:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_VOLUMEHIGH_REAL));
   /* Sample output:
   Volume High real: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum volume per day in the journal                |
//+------------------------------------------------------------------+
void SymbolVolumeHighRealPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeHighReal(symbol,header_width,indent));
  }


Volumen mínimo en el día (SYMBOL_VOLUMELOW_REAL)

//+------------------------------------------------------------------+
//| Return the minimum volume per day as a string                    |
//+------------------------------------------------------------------+
string SymbolVolumeLowReal(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume Low real:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_VOLUMELOW_REAL));
   /* Sample output:
   Volume Low real: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum volume per day in the journal                |
//+------------------------------------------------------------------+
void SymbolVolumeLowRealPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeLowReal(symbol,header_width,indent));
  }


Precio de ejecución de la opción (SYMBOL_OPTION_STRIKE)

Precio de ejecución de la opción. Este es el precio al que el comprador de una opción puede comprar (con una opción Call) o vender (con una opción Put) el activo básico; en consecuencia, el vendedor de la opción estará obligado a vender o comprar la cantidad correspondiente del activo básico.

//+------------------------------------------------------------------+
//| Return the strike price as a string                              |
//+------------------------------------------------------------------+
string SymbolOptionStrike(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Option strike:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_OPTION_STRIKE));
   /* Sample output:
   Option strike: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option strike price in the journal                   |
//+------------------------------------------------------------------+
void SymbolOptionStrikePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolOptionStrike(symbol,header_width,indent));
  }


Punto (SYMBOL_POINT)

Valor de un punto

//+------------------------------------------------------------------+
//| Return the point value as a string                               |
//+------------------------------------------------------------------+
string SymbolPoint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Point:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_POINT));
   /* Sample output:
   Point: 0.00001
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the point value in the journal                           |
//+------------------------------------------------------------------+
void SymbolPointPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPoint(symbol,header_width,indent));
  }


Valor de un tick (SYMBOL_TRADE_TICK_VALUE)

El valor SYMBOL_TRADE_TICK_VALUE_PROFIT será el valor de un tick calculado para una posición rentable.

//+------------------------------------------------------------------+
//| Return the tick price as a string                                |
//+------------------------------------------------------------------+
string SymbolTradeTickValue(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Tick value:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_VALUE));
   /* Sample output:
   Tick value: 1.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the tick price in the journal                            |
//+------------------------------------------------------------------+
void SymbolTradeTickValuePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeTickValue(symbol,header_width,indent));
  }


Valor de un tick para una posición rentable (SYMBOL_TRADE_TICK_VALUE_PROFIT)

Valor de un tick calculado para una posición rentable.

//+------------------------------------------------------------------+
//| Return the calculated tick price as a string                     |
//| for a profitable position                                        |
//+------------------------------------------------------------------+
string SymbolTradeTickValueProfit(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Tick value profit:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_VALUE_PROFIT));
   /* Sample output:
   Tick value profit: 1.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the calculated tick price in the journal                 |
//| for a profitable position                                        |
//+------------------------------------------------------------------+
void SymbolTradeTickValueProfitPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeTickValueProfit(symbol,header_width,indent));
  }


Valor de un tick para una posición perdedora (SYMBOL_TRADE_TICK_VALUE_LOSS)

Valor de un tick calculado para una posición perdedora.

//+------------------------------------------------------------------+
//| Return the calculated tick price as a string                     |
//| for a losing position                                            |
//+------------------------------------------------------------------+
string SymbolTradeTickValueLoss(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Tick value loss:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_VALUE_LOSS));
   /* Sample output:
   Tick value loss: 1.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the calculated tick price in the journal                 |
//| for a losing position                                            |
//+------------------------------------------------------------------+
void SymbolTradeTickValueLossPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeTickValueLoss(symbol,header_width,indent));
  }


Cambio de precio mínimo (SYMBOL_TRADE_TICK_SIZE)

//+------------------------------------------------------------------+
//| Return the minimum price change as a string                      |
//+------------------------------------------------------------------+
string SymbolTradeTickSize(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Tick size:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_SIZE));
   /* Sample output:
   Tick size: 0.00001
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum price change in the journal                  |
//+------------------------------------------------------------------+
void SymbolTradeTickSizePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeTickSize(symbol,header_width,indent));
  }


Tamaño del contrato comercial (SYMBOL_TRADE_CONTRACT_SIZE)

//+------------------------------------------------------------------+
//| Return the trading contract size as a string                     |
//+------------------------------------------------------------------+
string SymbolTradeContractSize(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Contract size:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f %s",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_TRADE_CONTRACT_SIZE),SymbolInfoString(symbol,SYMBOL_CURRENCY_BASE));
   /* Sample output:
   Contract size: 100000.00 GBP
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the trading contract size in the journal                 |
//+------------------------------------------------------------------+
void SymbolTradeContractSizePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeContractSize(symbol,header_width,indent));
  }


Interés acumulado (SYMBOL_TRADE_ACCRUED_INTEREST)

El interés acumulado es parte de los intereses de cupón calculados en proporción al número de días transcurridos desde la emisión del bono de cupón o el último pago de los intereses del cupón.

//+------------------------------------------------------------------+
//| Return accrued interest as a string                              |
//+------------------------------------------------------------------+
string SymbolTradeAccruedInterest(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Accrued interest:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_TRADE_ACCRUED_INTEREST));
   /* Sample output:
   Accrued interest: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display accrued interest in the journal                         |
//+------------------------------------------------------------------+
void SymbolTradeAccruedInterestPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeAccruedInterest(symbol,header_width,indent));
  }


Valor nominal (SYMBOL_TRADE_FACE_VALUE)

El valor nominal es el valor inicial del bono fijado por el emisor.

//+------------------------------------------------------------------+
//| Return the face value as a string                                |
//+------------------------------------------------------------------+
string SymbolTradeFaceValue(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Face value:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_TRADE_FACE_VALUE));
   /* Sample output:
   Face value: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the face value in the journal                            |
//+------------------------------------------------------------------+
void SymbolTradeFaceValuePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeFaceValue(symbol,header_width,indent));
  }


Índice de liquidez (SYMBOL_TRADE_LIQUIDITY_RATE)

El índice de liquidez es el porcentaje del valor de un activo que puede utilizarse como garantía.

//+------------------------------------------------------------------+
//| Return the liquidity rate as a string                            |
//+------------------------------------------------------------------+
string SymbolTradeLiquidityRate(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Liquidity rate:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_TRADE_LIQUIDITY_RATE));
   /* Sample output:
   Liquidity rate: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the rate liquidity in the journal                        |
//+------------------------------------------------------------------+
void SymbolTradeLiquidityRatePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolTradeLiquidityRate(symbol,header_width,indent));
  }


Volumen mínimo (SYMBOL_VOLUME_MIN)

Volumen mínimo para concluir una transacción.

//+------------------------------------------------------------------+
//| Return the minimum volume as a string                            |
//+------------------------------------------------------------------+
string SymbolVolumeMin(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume min:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places in the lot value
   int dg=(int)ceil(fabs(log10(SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP))));
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN));
   /* Sample output:
   Volume min: 0.01
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum volume in the journal                        |
//+------------------------------------------------------------------+
void SymbolVolumeMinPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeMin(symbol,header_width,indent));
  }


Volumen máximo (SYMBOL_VOLUME_MAX)

Volumen máximo para concluir una transacción.

//+------------------------------------------------------------------+
//| Return the maximum volume as a string                            |
//+------------------------------------------------------------------+
string SymbolVolumeMax(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume max:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places in the lot value
   int dg=(int)ceil(fabs(log10(SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP))));
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX));
   /* Sample output:
   Volume max: 500.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum volume in the journal                        |
//+------------------------------------------------------------------+
void SymbolVolumeMaxPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeMax(symbol,header_width,indent));
  }


Paso de cambio del volumen (SYMBOL_VOLUME_STEP)

Paso mínimo de cambio de volumen para concluir una transacción.

//+------------------------------------------------------------------+
//| Return the minimum volume change step as a string                |
//+------------------------------------------------------------------+
string SymbolVolumeStep(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume step:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places in the lot value
   int dg=(int)ceil(fabs(log10(SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP))));
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP));
   /* Sample output:
   Volume step: 0.01
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the minimum volume change step in the journal            |
//+------------------------------------------------------------------+
void SymbolVolumeStepPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeStep(symbol,header_width,indent));
  }


Volumen máximo de posiciones y órdenes en una dirección (SYMBOL_VOLUME_LIMIT)

Volumen total máximo permitido de una posición abierta y las órdenes pendientes para un símbolo determinado en una dirección (compra o venta). Por ejemplo, con un límite de 5 lotes, podremos tener una posición de compra abierta con un volumen de 5 lotes y colocar una orden pendiente Sell Limit con un volumen de 5 lotes. Sin embargo, al mismo tiempo, no podremos colocar una orden pendiente Buy Limit (ya que el volumen total en una dirección superará el límite) o colocar una orden Sell Limit con un volumen de más de 5 lotes.

//+----------------------------------------------------------------------------+
//| Return the maximum acceptable                                              |
//| total volume of open position and pending orders for a symbol as a string  |
//+----------------------------------------------------------------------------+
string SymbolVolumeLimit(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Volume limit:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places in the lot value
   int dg=(int)ceil(fabs(log10(SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP))));
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_VOLUME_LIMIT));
   /* Sample output:
   Volume limit: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+----------------------------------------------------------------------------+
//| Display the maximum acceptable                                             |
//| total volume of open position and pending orders for a symbol as a string  |
//+----------------------------------------------------------------------------+
void SymbolVolumeLimitPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolVolumeLimit(symbol,header_width,indent));
  }


Swap de compra (SYMBOL_SWAP_LONG)

//+------------------------------------------------------------------+
//| Return the Buy swap value as a string                            |
//+------------------------------------------------------------------+
string SymbolSwapLong(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap long:";
   uint w=(header_width==0 ? header.Length()+1 : header_width-1);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%- .2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SWAP_LONG));
   /* Sample output:
   Swap long: -0.20
   */
  }

Como el valor de una propiedad puede ser negativo, deberemos desplazar los valores de propiedad negativos un carácter hacia la izquierda para que el signo menos se encuentre a la izquierda de la columna de números de las propiedades restantes en la lista. Para hacer esto, reduciremos la anchura del campo transmitido en 1 y colocaremos un signo de "espacio" en los especificadores de formato, que para valores no negativos desplazará la línea un carácter hacia la derecha. Por lo tanto, reduciremos la anchura del campo en 1 y, para un valor no negativo, añadiremos un espacio, nivelando la anchura del campo reducido en un carácter.

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the Buy swap value in the journal                        |
//+------------------------------------------------------------------+
void SymbolSwapLongPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapLong(symbol,header_width,indent));
  }


Swap de venta (SYMBOL_SWAP_SHORT)

//+------------------------------------------------------------------+
//| Return the Sell swap value as a string                           |
//+------------------------------------------------------------------+
string SymbolSwapShort(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap short:";
   uint w=(header_width==0 ? header.Length()+1 : header_width-1);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%- .2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SWAP_SHORT));
   /* Sample output:
   Swap short: -2.20
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the Sell swap value in the journal                       |
//+------------------------------------------------------------------+
void SymbolSwapShortPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapShort(symbol,header_width,indent));
  }


Tasa de cobro de swaps (SYMBOL_SWAP_SUNDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al transferir una posición del día especificado (DOMINGO) al siguiente. Los posibles valores son:

    0 – los swaps no se cobran
    1 – cobro único de swaps
    3 – cobro del triple swap

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Sunday to Monday                   |
//+------------------------------------------------------------------+
string SymbolSwapSunday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap sunday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_SUNDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
   Swap sunday: 0 (no swap is charged)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Sunday to Monday                   |
//+------------------------------------------------------------------+
void SymbolSwapSundayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapSunday(symbol,header_width,indent));
  }


Tasa de cobro de swaps de lunes a martes (SYMBOL_SWAP_MONDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al desplazar una posición de lunes a martes.

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Monday to Tuesday                  |
//+------------------------------------------------------------------+
string SymbolSwapMonday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap monday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_MONDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
   Swap monday: 1 (single swap)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Monday to Tuesday                  |
//+------------------------------------------------------------------+
void SymbolSwapMondayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapMonday(symbol,header_width,indent));
  }


Tasa de cobro de swaps de martes a miércoles (SYMBOL_SWAP_TUESDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al desplazar una posición de martes a miércoles

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Tuesday to Wednesday               |
//+------------------------------------------------------------------+
string SymbolSwapTuesday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap Tuesday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_TUESDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
   Swap Tuesday: 1 (single swap)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Tuesday to Wednesday               |
//+------------------------------------------------------------------+
void SymbolSwapTuesdayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapTuesday(symbol,header_width,indent));
  }


Tasa de cobro de swaps de miércoles a jueves (SYMBOL_SWAP_WEDNESDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al desplazar una posición de miércoles a jueves

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Wednesday to Thursday              |
//+------------------------------------------------------------------+
string SymbolSwapWednesday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap Wednesday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_WEDNESDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
      Swap Wednesday: 3 (triple swap)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Wednesday to Thursday              |
//+------------------------------------------------------------------+
void SymbolSwapWednesdayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapWednesday(symbol,header_width,indent));
  }


Tasa de cobro de swaps de jueves a viernes (SYMBOL_SWAP_THURSDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al desplazar una posición de jueves a viernes.

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Thursday to Friday                 |
//+------------------------------------------------------------------+
string SymbolSwapThursday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap Thursday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_THURSDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
      Swap Thursday: 1 (single swap)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Thursday to Friday                 |
//+------------------------------------------------------------------+
void SymbolSwapThursdayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapThursday(symbol,header_width,indent));
  }


Tasa de cobro de swaps de viernes a sábado (SYMBOL_SWAP_FRIDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al desplazar una posición de viernes a sábado.

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Friday to Saturday                 |
//+------------------------------------------------------------------+
string SymbolSwapFriday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap Friday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_FRIDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
      Swap Friday: 1 (single swap)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Friday to Saturday                 |
//+------------------------------------------------------------------+
void SymbolSwapFridayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapFriday(symbol,header_width,indent));
  }


Tasa de cobro de swaps de sábado a domingo (SYMBOL_SWAP_SATURDAY)

Tasa de cobro de swaps (SYMBOL_SWAP_LONG o SYMBOL_SWAP_SHORT) al desplazar una posición de sábado a domingo.

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| when swapping a position from Saturday to Sunday                 |
//+------------------------------------------------------------------+
string SymbolSwapSaturday(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Swap Saturday:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the ratio and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,SYMBOL_SWAP_SATURDAY);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
      Swap Saturday: 0 (no swap is charged)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| when swapping a position from Saturday to Sunday                 |
//+------------------------------------------------------------------+
void SymbolSwapSaturdayPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapSaturday(symbol,header_width,indent));
  }

En total, para mostrar la tasa de cobro de swaps para cada día de la semana, hemos obtenido 7 * 2 funciones. Pero podemos crear una función universal que retorne una línea que describa la tasa de cobro para un día específico de la semana y una función para imprimir en el registro el resultado retornado por la primera función. Vamos a escribir:

//+------------------------------------------------------------------+
//| Return the swap accrual ratio as a string                        |
//| for a specified day of the week                                  |
//+------------------------------------------------------------------+
string SymbolSwapByDay(const string symbol,const ENUM_DAY_OF_WEEK day_week,const uint header_width=0,const uint indent=0)
  {
//--- Get a text description of a day of the week
   string day=EnumToString(day_week);
//--- Convert all obtained symbols to lower case and replace the first letter from small to capital
   if(day.Lower())
      day.SetChar(0,ushort(day.GetChar(0)-0x20));
//--- Create the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header=StringFormat("Swap %s:",day);
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Declare the property that needs to be requested in SymbolInfoDouble()
   int prop=SYMBOL_SWAP_SUNDAY;
//--- Depending on the day of the week, indicate the requested property
   switch(day_week)
     {
      case MONDAY       : prop=SYMBOL_SWAP_MONDAY;    break;
      case TUESDAY      : prop=SYMBOL_SWAP_TUESDAY;   break;
      case WEDNESDAY    : prop=SYMBOL_SWAP_WEDNESDAY; break;
      case THURSDAY     : prop=SYMBOL_SWAP_THURSDAY;  break;
      case FRIDAY       : prop=SYMBOL_SWAP_FRIDAY;    break;
      case SATURDAY     : prop=SYMBOL_SWAP_SATURDAY;  break;
      default/*SUNDAY*/ : prop=SYMBOL_SWAP_SUNDAY;    break;
     }
//--- Get the ratio by a selected property and define its description string
   double swap_coeff=SymbolInfoDouble(symbol,(ENUM_SYMBOL_INFO_DOUBLE)prop);
   string coeff_descr=(swap_coeff==1 ? "single swap" : swap_coeff==3 ? "triple swap" : "no swap is charged");
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%.0f (%s)",indent,"",w,header,swap_coeff,coeff_descr);
   /* Sample output:
      Swap Sunday: 0 (no swap is charged)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the swap accrual ratio in the journal                    |
//| for a specified day of the week                                  |
//+------------------------------------------------------------------+
void SymbolSwapByDayPrint(const string symbol,const ENUM_DAY_OF_WEEK day_week,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSwapByDay(symbol,day_week,header_width,indent));
  }


Margen inicial (SYMBOL_MARGIN_INITIAL)

El margen inicial indica la cantidad de garantía requerida en la divisa del margen para abrir una posición de un lote. Se utiliza para verificar los fondos de los clientes al entrar en el mercado. Para obtener información sobre el importe del margen cobrado según el tipo y la dirección de la orden, utilizaremos la función SymbolInfoMarginRate().

//+------------------------------------------------------------------+
//| Return the initial margin as a string                            |
//+------------------------------------------------------------------+
string SymbolMarginInitial(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Margin initial:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f %s",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_MARGIN_INITIAL),SymbolInfoString(symbol,SYMBOL_CURRENCY_MARGIN));
   /* Sample output:
      Margin initial: 0.00 GBP
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the initial margin in the journal                        |
//+------------------------------------------------------------------+
void SymbolMarginInitialPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolMarginInitial(symbol,header_width,indent));
  }


Margen de mantenimiento (SYMBOL_MARGIN_MAINTENANCE)

Margen de mantenimiento del instrumento. Si se especifica, indicará el tamaño del margen en la divisa de margen del instrumento retenido de un lote. Se usará al verificar los fondos del cliente cuando cambie el estado de la cuenta del mismo. Si el margen de mantenimiento es 0, entonces se utilizará el margen inicial. Para obtener información sobre el importe del margen cobrado según el tipo y la dirección de la orden, utilizaremos la función SymbolInfoMarginRate().

//+------------------------------------------------------------------+
//| Return the maintenance margin for an instrument as a string      |
//+------------------------------------------------------------------+
string SymbolMarginMaintenance(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Margin maintenance:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f %s",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_MARGIN_MAINTENANCE),SymbolInfoString(symbol,SYMBOL_CURRENCY_MARGIN));
   /* Sample output:
      Margin maintenance: 0.00 GBP
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maintenance margin for an instrument in the journal  |
//+------------------------------------------------------------------+
void SymbolMarginMaintenancePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolMarginMaintenance(symbol,header_width,indent));
  }


Volumen de transacciones en la sesión actual (SYMBOL_SESSION_VOLUME)

Volumen total de transacciones en la sesión actual.

//+------------------------------------------------------------------------+
//| Returns the total volume of trades in the current session as a string  |
//+------------------------------------------------------------------------+
string SymbolSessionVolume(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session volume:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SESSION_VOLUME));
   /* Sample output:
      Session volume: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+---------------------------------------------------------------------------+
//| Display the total volume of trades in the current session in the journal  |
//+---------------------------------------------------------------------------+
void SymbolSessionVolumePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionVolume(symbol,header_width,indent));
  }


Rotación en la sesión actual (SYMBOL_SESSION_TURNOVER)

Rotación total en la sesión actual.

//+------------------------------------------------------------------+
//| Return the total turnover in the current session as a string     |
//+------------------------------------------------------------------+
string SymbolSessionTurnover(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session turnover:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SESSION_TURNOVER));
   /* Sample output:
      Session turnover: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------------+
//| Displays the total turnover during the current session in the journal  |
//+------------------------------------------------------------------------+
void SymbolSessionTurnoverPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionTurnover(symbol,header_width,indent));
  }


Volumen de las posiciones abiertas (SYMBOL_SESSION_INTEREST)

Volumen total de las posiciones abiertas.

//+------------------------------------------------------------------+
//| Return the total volume of open positions as a string            |
//+------------------------------------------------------------------+
string SymbolSessionInterest(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session interest:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SESSION_INTEREST));
   /* Sample output:
      Session interest: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the total volume of open positions in the journal        |
//+------------------------------------------------------------------+
void SymbolSessionInterestPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionInterest(symbol,header_width,indent));
  }


Volumen de las órdenes de compra (SYMBOL_SESSION_BUY_ORDERS_VOLUME)

Volumen total de las órdenes de compra en el momento actual.

//+------------------------------------------------------------------+
//| Return the current total volume of buy orders                    |
//+------------------------------------------------------------------+
string SymbolSessionBuyOrdersVolume(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session Buy orders volume:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SESSION_BUY_ORDERS_VOLUME));
   /* Sample output:
      Session Buy orders volume: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the total volume of Buy orders at the moment             |
//+------------------------------------------------------------------+
void SymbolSessionBuyOrdersVolumePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionBuyOrdersVolume(symbol,header_width,indent));
  }


Volumen de las órdenes de venta (SYMBOL_SESSION_SELL_ORDERS_VOLUME)

Volumen total de las órdenes de venta en el momento actual.

//+------------------------------------------------------------------+
//| Return the current total volume of sell orders                   |
//+------------------------------------------------------------------+
string SymbolSessionSellOrdersVolume(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session Sell orders volume:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_SESSION_SELL_ORDERS_VOLUME));
   /* Sample output:
      Session Sell orders volume: 0.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the total volume of Sell orders at the moment            |
//+------------------------------------------------------------------+
void SymbolSessionSellOrdersVolumePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionSellOrdersVolume(symbol,header_width,indent));
  }


Precio de apertura de la sesión (SYMBOL_SESSION_OPEN)

//+------------------------------------------------------------------+
//| Return the session open price as a string                        |
//+------------------------------------------------------------------+
string SymbolSessionOpen(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session Open:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_SESSION_OPEN));
   /* Sample output:
      Session Open: 1.31314
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the session open price in the journal                    |
//+------------------------------------------------------------------+
void SymbolSessionOpenPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionOpen(symbol,header_width,indent));
  }


Precio de cierre de la sesión (SYMBOL_SESSION_CLOSE)

//+------------------------------------------------------------------+
//| Return the session close price as a string                       |
//+------------------------------------------------------------------+
string SymbolSessionClose(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session Close:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_SESSION_CLOSE));
   /* Sample output:
      Session Close: 1.31349
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the session close price in the journal                   |
//+------------------------------------------------------------------+
void SymbolSessionClosePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionClose(symbol,header_width,indent));
  }


Precio medio ponderado de la sesión (SYMBOL_SESSION_AW)

//+------------------------------------------------------------------+
//| Return the session average weighted price as a string            |
//+------------------------------------------------------------------+
string SymbolSessionAW(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session AW:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_SESSION_AW));
   /* Sample output:
      Session AW: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the weighted average session price in the journal        |
//+------------------------------------------------------------------+
void SymbolSessionAWPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionAW(symbol,header_width,indent));
  }


Precio de liquidación para la sesión actual (SYMBOL_SESSION_PRICE_SETTLEMENT)

//+------------------------------------------------------------------+
//| Return the settlement price of the current session as a string   |
//+------------------------------------------------------------------+
string SymbolSessionPriceSettlement(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session price settlement:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_SESSION_PRICE_SETTLEMENT));
   /* Sample output:
      Session price settlement: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+--------------------------------------------------------------------+
//| Display the settlement price of the current session in the journal |
//+--------------------------------------------------------------------+
void SymbolSessionPriceSettlementPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionPriceSettlement(symbol,header_width,indent));
  }


Precio mínimo en la sesión (SYMBOL_SESSION_PRICE_LIMIT_MIN)

Valor de precio mínimo permitido para una sesión.

//+------------------------------------------------------------------+
//| Return the minimum acceptable                                    |
//| price value per session as a string                              |
//+------------------------------------------------------------------+
string SymbolSessionPriceLimitMin(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session price limit min:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_SESSION_PRICE_LIMIT_MIN));
   /* Sample output:
      Session price limit min: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Displays the minimum acceptable                                  |
//| price value per session as a string                              |
//+------------------------------------------------------------------+
void SymbolSessionPriceLimitMinPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionPriceLimitMin(symbol,header_width,indent));
  }


Precio máximo en la sesión (SYMBOL_SESSION_PRICE_LIMIT_MAX)

Valor de precio máximo permitido para una sesión.

//+------------------------------------------------------------------+
//| Return the maximum acceptable                                    |
//| price value per session as a string                              |
//+------------------------------------------------------------------+
string SymbolSessionPriceLimitMax(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Session price limit max:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_SESSION_PRICE_LIMIT_MAX));
   /* Sample output:
      Session price limit max: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the maximum acceptable                                   |
//| price value per session as a string                              |
//+------------------------------------------------------------------+
void SymbolSessionPriceLimitMaxPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSessionPriceLimitMax(symbol,header_width,indent));
  }


Tamaño del contrato para un lote de posiciones cubiertas (SYMBOL_MARGIN_HEDGED)

Tamaño o margen del contrato para un lote de posiciones superpuestas (posiciones multidireccionales en el mismo símbolo). Existen dos formas de calcular el margen para posiciones cubiertas. El método de cálculo lo determinará el bróker.
 
Cálculo básico:

  • Si se especifica un margen inicial para un instrumento (SYMBOL_MARGIN_INITIAL), entonces el margen cubierto se especificará como un valor absoluto (en dinero).
  • Si no se especifica el margen inicial (igual a 0), entonces SYMBOL_MARGIN_HEDGED especificará el tamaño del contrato que se utilizará al calcular el margen utilizando la fórmula correspondiente al tipo de instrumento comercial (SYMBOL_TRADE_CALC_MODE).

Cálculo basado en la mayor posición:

  • El valor SYMBOL_MARGIN_HEDGED se ignorará,
  • y se calculará el volumen de todas las posiciones cortas y largas del instrumento.
  • Para cada lado se calculará el precio medio ponderado de apertura, así como el precio medio ponderado de conversión a la divisa de depósito.
  • A continuación, utilizando las fórmulas correspondientes al tipo de instrumento (SYMBOL_TRADE_CALC_MODE), se calculará el margen para los lados corto y largo.
  • El valor más alto se utilizará como valor final.
//+------------------------------------------------------------------+
//| Return the contract or margin size as a string                   |
//| for a single lot of covered positions                            |
//+------------------------------------------------------------------+
string SymbolMarginHedged(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Margin hedged:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_MARGIN_HEDGED));
   /* Sample output:
      Margin hedged: 100000.00
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the contract or margin size in the journal               |
//| for a single lot of covered positions                            |
//+------------------------------------------------------------------+
void SymbolMarginHedgedPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolMarginHedged(symbol,header_width,indent));
  }


Cambio en el precio actual como porcentaje (SYMBOL_PRICE_CHANGE)

Cambio en el precio actual con respecto al final del día comercial anterior, expresado como porcentaje.

//+------------------------------------------------------------------+
//| Return the change of the current price relative to               |
//| the end of the previous trading day in percentage as a string    |
//+------------------------------------------------------------------+
string SymbolPriceChange(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price change:";
   uint w=(header_width==0 ? header.Length()+1 : header_width-1);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%- .2f %%",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_PRICE_CHANGE));
   /* Sample output:
      Price change: -0.28 %
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display in the journal                                           |
//| the end of the previous trading day in percentage as a string    |
//+------------------------------------------------------------------+
void SymbolPriceChangePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceChange(symbol,header_width,indent));
  }


Volatilidad de los precios como porcentaje (SYMBOL_PRICE_VOLATILITY)

//+------------------------------------------------------------------+
//| Return the price volatility in percentage as a string            |
//+------------------------------------------------------------------+
string SymbolPriceVolatility(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price volatility:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.2f %%",indent,"",w,header,SymbolInfoDouble(symbol,SYMBOL_PRICE_VOLATILITY));
   /* Sample output:
      Price volatility: 0.00 %
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the price volatility in percentage in the journal        |
//+------------------------------------------------------------------+
void SymbolPriceVolatilityPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceVolatility(symbol,header_width,indent));
  }


Precio teórico de la opción (SYMBOL_PRICE_THEORETICAL)

//+------------------------------------------------------------------+
//| Return the theoretical price of an option as a string            |
//+------------------------------------------------------------------+
string SymbolPriceTheoretical(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price theoretical:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_THEORETICAL));
   /* Sample output:
      Price theoretical: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the theoretical price of an option in the journal        |
//+------------------------------------------------------------------+
void SymbolPriceTheoreticalPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceTheoretical(symbol,header_width,indent));
  }


Delta de la opción/warrant (SYMBOL_PRICE_DELTA)

Delta de la opción/warrant. Muestra cuántas unidades cambiará el precio de la opción cuando el precio del activo básico cambie en 1 unidad.

//+------------------------------------------------------------------+
//| Return as the option/warrant delta as a string                   |
//+------------------------------------------------------------------+
string SymbolPriceDelta(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price delta:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_DELTA));
   /* Sample output:
      Price delta: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant delta in the journal                  |
//+------------------------------------------------------------------+
void SymbolPriceDeltaPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceDelta(symbol,header_width,indent));
  }


Theta de la opción/warrant (SYMBOL_PRICE_THETA)

Theta de la opción/warrant. Número de puntos que el precio de la opción perderá cada día debido a una caída temporal, es decir cuando se acerque la fecha de vencimiento.

//+------------------------------------------------------------------+
//| Return as the option/warrant theta as a string                   |
//+------------------------------------------------------------------+
string SymbolPriceTheta(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price theta:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_THETA));
   /* Sample output:
      Price theta: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant theta in the journal                  |
//+------------------------------------------------------------------+
void SymbolPriceThetaPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceTheta(symbol,header_width,indent));
  }


Gamma de la opción/warrant (SYMBOL_PRICE_GAMMA)

Gamma de la opción/warrant. Muestra la tasa de cambio de delta: con qué rapidez o lentitud cambia la prima de la opción.

//+------------------------------------------------------------------+
//| Return as the option/warrant gamma as a string                   |
//+------------------------------------------------------------------+
string SymbolPriceGamma(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price gamma:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_GAMMA));
   /* Sample output:
      Price gamma: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant gamma in the journal                  |
//+------------------------------------------------------------------+
void SymbolPriceGammaPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceGamma(symbol,header_width,indent));
  }


Vega de la opción/warrant (SYMBOL_PRICE_VEGA)

Vega de la opción/warrant. Muestra el número de puntos en los que cambiará el precio de la opción si la volatilidad cambia un 1%.

//+------------------------------------------------------------------+
//| Return as the option/warrant vega as a string                    |
//+------------------------------------------------------------------+
string SymbolPriceVega(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price vega:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_VEGA));
   /* Sample output:
      Price vega: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant vega in the journal                   |
//+------------------------------------------------------------------+
void SymbolPriceVegaPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceVega(symbol,header_width,indent));
  }


Rho de la opción/warrant (SYMBOL_PRICE_RHO)

Rho de la opción/warrant. Representa la sensibilidad del precio teórico de la opción a un cambio del 1% en las tasas de interés.

//+------------------------------------------------------------------+
//| Return as the option/warrant rho as a string                     |
//+------------------------------------------------------------------+
string SymbolPriceRho(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price rho:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_RHO));
   /* Sample output:
      Price rho: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant rho in the journal                    |
//+------------------------------------------------------------------+
void SymbolPriceRhoPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceRho(symbol,header_width,indent));
  }


Omega de la opción/warrant (SYMBOL_PRICE_OMEGA)

Omega de la opción/warrant. La elasticidad de la opción es el cambio porcentual relativo en el precio de la opción respecto al cambio porcentual en el precio del activo básico.

//+------------------------------------------------------------------+
//| Return as the option/warrant omega as a string                   |
//+------------------------------------------------------------------+
string SymbolPriceOmega(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price omega:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_OMEGA));
   /* Sample output:
      Price omega: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant omega in the journal                  |
//+------------------------------------------------------------------+
void SymbolPriceOmegaPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceOmega(symbol,header_width,indent));
  }


Sensibilidad de la opción/warrant (SYMBOL_PRICE_SENSITIVITY)

Sensibilidad de la opción/warrant.  Muestra cuántos puntos debe cambiar el precio del activo básico de la opción para que el precio de la opción cambie en un punto.

//+------------------------------------------------------------------+
//| Return the option/warrant sensitivity as a string                |
//+------------------------------------------------------------------+
string SymbolPriceSensitivity(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Price sensitivity:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the number of decimal places
   int dg=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s%-.*f",indent,"",w,header,dg,SymbolInfoDouble(symbol,SYMBOL_PRICE_SENSITIVITY));
   /* Sample output:
      Price sensitivity: 0.00000
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the option/warrant sensitivity in the journal            |
//+------------------------------------------------------------------+
void SymbolPriceSensitivityPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPriceSensitivity(symbol,header_width,indent));
  }


Obtención y muestra de las propiedades string de un símbolo

Nombre del activo básico (SYMBOL_BASIS)

El nombre del activo básico del instrumento derivado.

//+------------------------------------------------------------------+
//| Return the base asset name for a derivative instrument           |
//+------------------------------------------------------------------+
string SymbolBasis(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Basis:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_BASIS);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Basis: '' (Not specified)
   */
  }

Si el parámetro no está especificado y retorna una línea vacía, introduciremos una explicación (Not specified) junto al parámetro vacío.

Muestra en el registro el valor retornado por la primera función:

//+----------------------------------------------------------------------+
//| Return the base asset name for a derivative instrument in the journal|
//+----------------------------------------------------------------------+
void SymbolBasisPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolBasis(symbol,header_width,indent));
  }


Categoría o sector del instrumento (SYMBOL_CATEGORY)

Nombre de la categoría o sector al que pertenece el instrumento financiero.

//+------------------------------------------------------------------+
//| Return the name of the financial instrument category or sector   |
//+------------------------------------------------------------------+
string SymbolCategory(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Category:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_CATEGORY);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Category: '' (Not specified)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the name of the financial instrument category or sector  |
//| in the journal                                                   |
//+------------------------------------------------------------------+
void SymbolCategoryPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolCategory(symbol,header_width,indent));
  }


País del instrumento financiero (SYMBOL_COUNTRY)

País al que pertenece el instrumento financiero.

//+------------------------------------------------------------------+
//| Return the country the trading instrument belongs to             |
//+------------------------------------------------------------------+
string SymbolCountry(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Country:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_COUNTRY);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Country: '' (Not specified)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+----------------------------------------------------------------------+
//| Display the country the trading instrument belongs to in the journal |
//+----------------------------------------------------------------------+
void SymbolCountryPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolCountry(symbol,header_width,indent));
  }


Sector de la economía (SYMBOL_SECTOR_NAME)

Sector de la economía al que pertenece el instrumento financiero.

//+------------------------------------------------------------------+
//| Return the economic sector                                       |
//| the financial instrument belongs to                              |
//+------------------------------------------------------------------+
string SymbolSectorName(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Sector name:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_SECTOR_NAME);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Sector name: 'Currency'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display in the journal the economic sector                       |
//| the financial instrument belongs to                              |
//+------------------------------------------------------------------+
void SymbolSectorNamePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolSectorName(symbol,header_width,indent));
  }


Industria de la economía (SYMBOL_INDUSTRY_NAME)

Sector de la economía o tipo de industria al que pertenece el instrumento financiero.

//+------------------------------------------------------------------+
//| Return the economy or industry branch                            |
//| the financial instrument belongs to                              |
//+------------------------------------------------------------------+
string SymbolIndustryName(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Industry name:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_INDUSTRY_NAME);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Industry name: 'Undefined'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display in the journal the economy or industry branch            |
//| the financial instrument belongs to                              |
//+------------------------------------------------------------------+
void SymbolIndustryNamePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolIndustryName(symbol,header_width,indent));
  }


Divisa básica (SYMBOL_CURRENCY_BASE)

Divisa básica del instrumento.

//+------------------------------------------------------------------+
//| Return the instrument base currency                              |
//+------------------------------------------------------------------+
string SymbolCurrencyBase(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Currency base:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_CURRENCY_BASE);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Currency base: 'GBP'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the instrument base currency in the journal              |
//+------------------------------------------------------------------+
void SymbolCurrencyBasePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolCurrencyBase(symbol,header_width,indent));
  }


Divisa de beneficio (SYMBOL_CURRENCY_PROFIT)

//+------------------------------------------------------------------+
//| Return the profit currency                                       |
//+------------------------------------------------------------------+
string SymbolCurrencyProfit(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Currency profit:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_CURRENCY_PROFIT);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Currency profit: 'USD'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the profit currency in the journal                       |
//+------------------------------------------------------------------+
void SymbolCurrencyProfitPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolCurrencyProfit(symbol,header_width,indent));
  }


Divisa de garantía (SYMBOL_CURRENCY_MARGIN)

Divisa en la que se calcula la garantía.

//+------------------------------------------------------------------+
//| Return margin currency                                           |
//+------------------------------------------------------------------+
string SymbolCurrencyMargin(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Currency margin:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_CURRENCY_MARGIN);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Currency margin: 'GBP'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the margin currency in the journal                       |
//+------------------------------------------------------------------+
void SymbolCurrencyMarginPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolCurrencyMargin(symbol,header_width,indent));
  }


Fuente de la cotización (SYMBOL_BANK)

Fuente de la cotización actual.

//+------------------------------------------------------------------+
//| Return the current quote source                                  |
//+------------------------------------------------------------------+
string SymbolBank(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Bank:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_BANK);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Bank: '' (Not specified)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the current quote source in the journal                  |
//+------------------------------------------------------------------+
void SymbolBankPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolBank(symbol,header_width,indent));
  }


Descripción del símbolo (SYMBOL_DESCRIPTION)

Descripción de línea del símbolo.

//+------------------------------------------------------------------+
//| Return the symbol string description                             |
//+------------------------------------------------------------------+
string SymbolDescription(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Description:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_DESCRIPTION);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Description: 'Pound Sterling vs US Dollar'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the symbol string description in the journal             |
//+------------------------------------------------------------------+
void SymbolDescriptionPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolDescription(symbol,header_width,indent));
  }


Nombre de la bolsa (SYMBOL_EXCHANGE)

El nombre de la bolsa o plataforma comercial en la que se comercializa el símbolo.

//+------------------------------------------------------------------+
//| Return the name of an exchange                                   |
//| a symbol is traded on                                            |
//+------------------------------------------------------------------+
string SymbolExchange(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Exchange:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_EXCHANGE);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Exchange: '' (Not specified)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display in the journal the name of an exchange                   |
//| a symbol is traded on                                            |
//+------------------------------------------------------------------+
void SymbolExchangePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolExchange(symbol,header_width,indent));
  }


Fórmula del símbolo personalizado (SYMBOL_FORMULA)

Fórmula para construir el precio de un símbolo personalizado. Si el nombre de un instrumento financiero incluido en la fórmula comienza con un número o contiene un carácter especial (" ", ".", "-", "&", "#", etc.), entonces el nombre de este instrumento deberá ir entre comillas.

  • Símbolo sintético: "@ESU19"/EURCAD
  • Spread del calendario: "Si-9.13"-"Si-6.13"
  • Índice del euro: 34.38805726 * pow(EURUSD,0.3155) * pow(EURGBP,0.3056) * pow(EURJPY,0.1891) * pow(EURCHF,0.1113) * pow(EURSEK,0.0785)
//+------------------------------------------------------------------+
//| Return a formula for constructing a custom symbol price          |
//+------------------------------------------------------------------+
string SymbolFormula(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Formula:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_FORMULA);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Formula: '' (Not specified)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the equation for constructing                            |
//| the custom symbol price in the journal                           |
//+------------------------------------------------------------------+
void SymbolFormulaPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolFormula(symbol,header_width,indent));
  }


Nombre en el sistema ISIN (SYMBOL_ISIN)

Nombre del símbolo comercial en el sistema de códigos internacionales de identificación de valores, el ISIN (International Securities Identification Number). El Código Internacional de Identificación de Valores es un código alfanumérico de 12 dígitos que identifica un valor de forma única. La presencia de esta propiedad de símbolo se determinará en el lado del servidor comercial.

//+------------------------------------------------------------------+
//| Return the trading symbol name in the                            |
//| ISIN system                                                      |
//+------------------------------------------------------------------+
string SymbolISIN(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="ISIN:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_ISIN);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      ISIN: '' (Not specified)
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display in the journal the trading symbol name in the            |
//| ISIN system                                                      |
//+------------------------------------------------------------------+
void SymbolISINPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolISIN(symbol,header_width,indent));
  }


Dirección de la página de Internet (SYMBOL_PAGE)

Dirección de la página de Internet con la información sobre el símbolo. Esta dirección se mostrará como un enlace al ver las propiedades del símbolo en el terminal.

//+------------------------------------------------------------------+
//| Return the address of a web page with a symbol data              |
//+------------------------------------------------------------------+
string SymbolPage(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Page:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_PAGE);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Page: 'https://www.mql5.com/en/quotes/currencies/gbpusd'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+--------------------------------------------------------------------+
//| Display the address of a web page with a symbol data in the journal|
//+--------------------------------------------------------------------+
void SymbolPagePrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPage(symbol,header_width,indent));
  }


Ruta en el árbol de símbolos (SYMBOL_PATH)

//+------------------------------------------------------------------+
//| Return the path in the symbol tree                               |
//+------------------------------------------------------------------+
string SymbolPath(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Define the header text and the width of the header field
//--- If the header width is passed to the function equal to zero, then the width will be the size of the header line + 1
   string header="Path:";
   uint w=(header_width==0 ? header.Length()+1 : header_width);
//--- Get the string parameter value
   string param=SymbolInfoString(symbol,SYMBOL_PATH);
//--- Return the property value with a header having the required width and indentation
   return StringFormat("%*s%-*s'%-s'%-s",indent,"",w,header,param,param=="" ? " (Not specified)" : "");
   /* Sample output:
      Path: 'Forex\GBPUSD'
   */
  }

Muestra en el registro el valor retornado por la primera función:

//+------------------------------------------------------------------+
//| Display the path in the symbol tree in the journal               |
//+------------------------------------------------------------------+
void SymbolPathPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Print the property value in the log with a header with the required width and indentation
   Print(SymbolPath(symbol,header_width,indent));
  }

Las funciones presentadas anteriormente son lógicamente idénticas entre sí. Cada uno de ellas se puede utilizar "tal cual" para generar un registro o para obtener la propiedad de carácter requerida como una línea. De forma predeterminada, la separación de la línea es cero y la anchura del campo del encabezado es igual a la anchura del texto del encabezado, es decir no hay separaciones ni alineaciones en el texto de descripción de la propiedad. Serán necesarias si necesitamos mostrar un grupo de propiedades de símbolos para alinear los campos de datos en el registro. Vamos a escribir una función así.


Función que imprime todos los datos del símbolo en el registro.

Usando como base las funciones creadas, implementaremos una función que registre todas las propiedades de un símbolo en el orden en que aparecen en ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE y

ENUM_SYMBOL_INFO_STRING.

//+------------------------------------------------------------------+
//| Send all symbol properties to the journal                        |
//+------------------------------------------------------------------+
void SymbolInfoPrint(const string symbol,const uint header_width=0,const uint indent=0)
  {
//--- Display descriptions of integer properties according to their location in ENUM_SYMBOL_INFO_INTEGER
   Print("SymbolInfoInteger properties:");
   SymbolSubscriptionDelayPrint(symbol,header_width,indent);
   SymbolSectorPrint(symbol,header_width,indent);
   SymbolIndustryPrint(symbol,header_width,indent);
   SymbolCustomPrint(symbol,header_width,indent);
   SymbolBackgroundColorPrint(symbol,header_width,indent);
   SymbolChartModePrint(symbol,header_width,indent);
   SymbolExistsPrint(symbol,header_width,indent);
   SymbolSelectedPrint(symbol,header_width,indent);
   SymbolVisiblePrint(symbol,header_width,indent);
   SymbolSessionDealsPrint(symbol,header_width,indent);
   SymbolSessionBuyOrdersPrint(symbol,header_width,indent);
   SymbolSessionSellOrdersPrint(symbol,header_width,indent);
   SymbolVolumePrint(symbol,header_width,indent);
   SymbolVolumeHighPrint(symbol,header_width,indent);
   SymbolVolumeLowPrint(symbol,header_width,indent);
   SymbolTimePrint(symbol,header_width,indent);
   SymbolTimeMSCPrint(symbol,header_width,indent);
   SymbolDigitsPrint(symbol,header_width,indent);
   SymbolSpreadPrint(symbol,header_width,indent);
   SymbolSpreadFloatPrint(symbol,header_width,indent);
   SymbolTicksBookDepthPrint(symbol,header_width,indent);
   SymbolTradeCalcModePrint(symbol,header_width,indent);
   SymbolTradeModePrint(symbol,header_width,indent);
   SymbolSymbolStartTimePrint(symbol,header_width,indent);
   SymbolSymbolExpirationTimePrint(symbol,header_width,indent);
   SymbolTradeStopsLevelPrint(symbol,header_width,indent);
   SymbolTradeFreezeLevelPrint(symbol,header_width,indent);
   SymbolTradeExeModePrint(symbol,header_width,indent);
   SymbolSwapModePrint(symbol,header_width,indent);
   SymbolSwapRollover3DaysPrint(symbol,header_width,indent);
   SymbolMarginHedgedUseLegPrint(symbol,header_width,indent);
   SymbolExpirationModePrint(symbol,header_width,indent);
   SymbolFillingModePrint(symbol,header_width,indent);
   SymbolOrderModePrint(symbol,header_width,indent);
   SymbolOrderGTCModePrint(symbol,header_width,indent);
   SymbolOptionModePrint(symbol,header_width,indent);
   SymbolOptionRightPrint(symbol,header_width,indent);

//--- Display descriptions of real properties according to their location in ENUM_SYMBOL_INFO_DOUBLE
   Print("SymbolInfoDouble properties:");
   SymbolBidPrint(symbol,header_width,indent);
   SymbolBidHighPrint(symbol,header_width,indent);
   SymbolBidLowPrint(symbol,header_width,indent);
   SymbolAskPrint(symbol,header_width,indent);
   SymbolAskHighPrint(symbol,header_width,indent);
   SymbolAskLowPrint(symbol,header_width,indent);
   SymbolLastPrint(symbol,header_width,indent);
   SymbolLastHighPrint(symbol,header_width,indent);
   SymbolLastLowPrint(symbol,header_width,indent);
   SymbolVolumeRealPrint(symbol,header_width,indent);
   SymbolVolumeHighRealPrint(symbol,header_width,indent);
   SymbolVolumeLowRealPrint(symbol,header_width,indent);
   SymbolOptionStrikePrint(symbol,header_width,indent);
   SymbolPointPrint(symbol,header_width,indent);
   SymbolTradeTickValuePrint(symbol,header_width,indent);
   SymbolTradeTickValueProfitPrint(symbol,header_width,indent);
   SymbolTradeTickValueLossPrint(symbol,header_width,indent);
   SymbolTradeTickSizePrint(symbol,header_width,indent);
   SymbolTradeContractSizePrint(symbol,header_width,indent);
   SymbolTradeAccruedInterestPrint(symbol,header_width,indent);
   SymbolTradeFaceValuePrint(symbol,header_width,indent);
   SymbolTradeLiquidityRatePrint(symbol,header_width,indent);
   SymbolVolumeMinPrint(symbol,header_width,indent);
   SymbolVolumeMaxPrint(symbol,header_width,indent);
   SymbolVolumeStepPrint(symbol,header_width,indent);
   SymbolVolumeLimitPrint(symbol,header_width,indent);
   SymbolSwapLongPrint(symbol,header_width,indent);
   SymbolSwapShortPrint(symbol,header_width,indent);
   SymbolSwapByDayPrint(symbol,SUNDAY,header_width,indent);
   SymbolSwapByDayPrint(symbol,MONDAY,header_width,indent);
   SymbolSwapByDayPrint(symbol,TUESDAY,header_width,indent);
   SymbolSwapByDayPrint(symbol,WEDNESDAY,header_width,indent);
   SymbolSwapByDayPrint(symbol,THURSDAY,header_width,indent);
   SymbolSwapByDayPrint(symbol,FRIDAY,header_width,indent);
   SymbolSwapByDayPrint(symbol,SATURDAY,header_width,indent);
   SymbolMarginInitialPrint(symbol,header_width,indent);
   SymbolMarginMaintenancePrint(symbol,header_width,indent);
   SymbolSessionVolumePrint(symbol,header_width,indent);
   SymbolSessionTurnoverPrint(symbol,header_width,indent);
   SymbolSessionInterestPrint(symbol,header_width,indent);
   SymbolSessionBuyOrdersVolumePrint(symbol,header_width,indent);
   SymbolSessionSellOrdersVolumePrint(symbol,header_width,indent);
   SymbolSessionOpenPrint(symbol,header_width,indent);
   SymbolSessionClosePrint(symbol,header_width,indent);
   SymbolSessionAWPrint(symbol,header_width,indent);
   SymbolSessionPriceSettlementPrint(symbol,header_width,indent);
   SymbolSessionPriceLimitMinPrint(symbol,header_width,indent);
   SymbolSessionPriceLimitMaxPrint(symbol,header_width,indent);
   SymbolMarginHedgedPrint(symbol,header_width,indent);
   SymbolPriceChangePrint(symbol,header_width,indent);
   SymbolPriceVolatilityPrint(symbol,header_width,indent);
   SymbolPriceTheoreticalPrint(symbol,header_width,indent);
   SymbolPriceDeltaPrint(symbol,header_width,indent);
   SymbolPriceThetaPrint(symbol,header_width,indent);
   SymbolPriceGammaPrint(symbol,header_width,indent);
   SymbolPriceVegaPrint(symbol,header_width,indent);
   SymbolPriceRhoPrint(symbol,header_width,indent);
   SymbolPriceOmegaPrint(symbol,header_width,indent);
   SymbolPriceSensitivityPrint(symbol,header_width,indent);
   
//--- Display descriptions of string properties according to their location in ENUM_SYMBOL_INFO_STRING
   Print("SymbolInfoString properties:");
   SymbolBasisPrint(symbol,header_width,indent);
   SymbolCategoryPrint(symbol,header_width,indent);
   SymbolCountryPrint(symbol,header_width,indent);
   SymbolSectorNamePrint(symbol,header_width,indent);
   SymbolIndustryNamePrint(symbol,header_width,indent);
   SymbolCurrencyBasePrint(symbol,header_width,indent);
   SymbolCurrencyProfitPrint(symbol,header_width,indent);
   SymbolCurrencyMarginPrint(symbol,header_width,indent);
   SymbolBankPrint(symbol,header_width,indent);
   SymbolDescriptionPrint(symbol,header_width,indent);
   SymbolExchangePrint(symbol,header_width,indent);
   SymbolFormulaPrint(symbol,header_width,indent);
   SymbolISINPrint(symbol,header_width,indent);
   SymbolPagePrint(symbol,header_width,indent);
   SymbolPathPrint(symbol,header_width,indent);
  }
//+------------------------------------------------------------------+

Aquí todas las propiedades del símbolo simplemente se imprimirán en el registro de forma secuencial. Los tipos de propiedad estarán precedidos por los encabezados que indican los tipos: entero, real y string.

Resultado de la llamada a una función desde un script con una anchura de campo del encabezado de 28 caracteres y una separación de 2 caracteres:

void OnStart()
  {
//---
   SymbolInfoPrint(Symbol(),28,2);
   /* Sample output:
      SymbolInfoInteger properties:
        Subscription Delay:         No
        Sector:                     Currency
        Industry:                   Undefined
        Custom symbol:              No
        Background color:           Default
        Chart mode:                 Bid
        Exists:                     Yes
        Selected:                   Yes
        Visible:                    Yes
        Session deals:              0
        Session Buy orders:         0
        Session Sell orders:        0
        Volume:                     0
        Volume high:                0
        Volume low:                 0
        Time:                       2023.07.14 22:07:01
        Time msc:                   2023.07.14 22:07:01.706
        Digits:                     5
        Spread:                     5
        Spread float:               Yes
        Ticks book depth:           10
        Trade calculation mode:     Forex
        Trade mode:                 Full
        Start time:                 1970.01.01 00:00:00 (Not used)
        Expiration time:            1970.01.01 00:00:00 (Not used)
        Stops level:                0 (By Spread)
        Freeze level:               0 (Not used)
        Trade Execution mode:       Instant
        Swap mode:                  Points
        Swap Rollover 3 days:       Wednesday
        Margin hedged use leg:      No
        Expiration mode:            GTC|DAY|SPECIFIED
        Filling mode:               FOK|IOC|RETURN
        Order mode:                 MARKET|LIMIT|STOP|STOP_LIMIT|SL|TP|CLOSEBY
        Order GTC mode:             GTC
        Option mode:                European
        Option right:               Call
      SymbolInfoDouble properties:
        Bid:                        1.30979
        Bid High:                   1.31422
        Bid Low:                    1.30934
        Ask:                        1.30984
        Ask High:                   1.31427
        Ask Low:                    1.30938
        Last:                       0.00000
        Last High:                  0.00000
        Last Low:                   0.00000
        Volume real:                0.00
        Volume High real:           0.00
        Volume Low real:            0.00
        Option strike:              0.00000
        Point:                      0.00001
        Tick value:                 1.00000
        Tick value profit:          1.00000
        Tick value loss:            1.00000
        Tick size:                  0.00001
        Contract size:              100000.00 GBP
        Accrued interest:           0.00
        Face value:                 0.00
        Liquidity rate:             0.00
        Volume min:                 0.01
        Volume max:                 500.00
        Volume step:                0.01
        Volume limit:               0.00
        Swap long:                 -0.20
        Swap short:                -2.20
        Swap Sunday:                0 (no swap is charged)
        Swap Monday:                1 (single swap)
        Swap Tuesday:               1 (single swap)
        Swap Wednesday:             3 (triple swap)
        Swap Thursday:              1 (single swap)
        Swap Friday:                1 (single swap)
        Swap Saturday:              0 (no swap is charged)
        Margin initial:             0.00 GBP
        Margin maintenance:         0.00 GBP
        Session volume:             0.00
        Session turnover:           0.00
        Session interest:           0.00
        Session Buy orders volume:  0.00
        Session Sell orders volume: 0.00
        Session Open:               1.31314
        Session Close:              1.31349
        Session AW:                 0.00000
        Session price settlement:   0.00000
        Session price limit min:    0.00000
        Session price limit max:    0.00000
        Margin hedged:              100000.00
        Price change:              -0.28 %
        Price volatility:           0.00 %
        Price theoretical:          0.00000
        Price delta:                0.00000
        Price theta:                0.00000
        Price gamma:                0.00000
        Price vega:                 0.00000
        Price rho:                  0.00000
        Price omega:                0.00000
        Price sensitivity:          0.00000
      SymbolInfoString properties:
        Basis:                      '' (Not specified)
        Category:                   '' (Not specified)
        Country:                    '' (Not specified)
        Sector name:                'Currency'
        Industry name:              'Undefined'
        Currency base:              'GBP'
        Currency profit:            'USD'
        Currency margin:            'GBP'
        Bank:                       '' (Not specified)
        Description:                'Pound Sterling vs US Dollar'
        Exchange:                   '' (Not specified)
        Formula:                    '' (Not specified)
        ISIN:                       '' (Not specified)
        Page:                       'https://www.mql5.com/en/quotes/currencies/gbpusd'
        Path:                       'Forex\GBPUSD'
   */
  }

Como podemos ver, todos los datos están ordenados en forma de tabla. Los valores negativos no destacan en el panorama general debido a su desplazamiento hacia la izquierda.

Este es solo un ejemplo de cómo se pueden utilizar las funciones escritas anteriormente. Podrá usarlas "tal cual" en sus programas, extraer de ellas el resultado de algunos grupos de propiedades de símbolos o modificarlas para adaptarlas a su visión y necesidades, usándolas más tarde.


Conclusión

Hoy hemos analizado las funciones para imprimir las propiedades de las cuentas y los símbolos utilizando líneas formateadas. El siguiente paso será registrar algunas estructuras implementadas en MQL5.


Traducción del ruso hecha por MetaQuotes Ltd.
Artículo original: https://www.mql5.com/ru/articles/12953

Funciones en las aplicaciones MQL5 Funciones en las aplicaciones MQL5
Las funciones son componentes de importancia crítica en cualquier lenguaje de programación. Entre otras cosas, ayudan a los desarrolladores a aplicar el principio DRY (don't repeat youself, no te repitas). El artículo analiza las funciones y su creación en MQL5 usando aplicaciones sencillas que enriquecen nuestros sistemas comerciales sin complicarlos.
Analizamos PrintFormat() y tomamos ejemplos listos para usar Analizamos PrintFormat() y tomamos ejemplos listos para usar
El presente artículo resultará útil tanto a principiantes como a desarrolladores experimentados. En él veremos el funcionamiento de la función PrintFormat(), analizaremos ejemplos de formato string y escribiremos plantillas para enviar información diversa al registro del terminal.
Transformada discreta de Hartley Transformada discreta de Hartley
En este artículo nos familiarizaremos con uno de los métodos de análisis espectral y de procesamiento de señales: la transformada discreta de Hartley. Con ella podremos filtrar señales, analizar su espectro y mucho más. Las capacidades de la DHT no son inferiores a las de la transformada discreta de Fourier. Sin embargo, a diferencia de este, la DHT utiliza solo números reales, lo cual la hace más cómoda de implementar en la práctica y los resultados de su aplicación resultan más visuales.
Teoría de categorías en MQL5 (Parte 13): Eventos del calendario con esquemas de bases de datos Teoría de categorías en MQL5 (Parte 13): Eventos del calendario con esquemas de bases de datos
El artículo analiza cómo se pueden incluir esquemas de bases de datos para la clasificación en MQL5. Vamos a repasar brevemente cómo los conceptos de esquema de base de datos pueden combinarse con la teoría de categorías para identificar información textual (cadenas) relevante para el comercio. La atención se centrará en los eventos del calendario.