Cómo armo mi asesor por ensayo y error - página 51

 
Alexsandr San:

Sí, también debería añadir esto a lapágina web https://www.mql5.com/ru/code/23939


#versión de la propiedad "1.009"

Se ha añadido esta función

input string   t10="----- Price Line:     -----";                //
input string   InpFont0                     = "BUY";             // Obj: BUY (Obj:Name) ВЕРХУ
input ENUM_TRADE_COMMAND InpCSCommand       = close_open_b;      // Obj:  command:
input string   InpFont1                     = "SELL";            // Obj: SELL (Obj:Name) ВНИЗУ
input ENUM_TRADE_COMMAND InCSCommand        = close_open_s;      // Obj:  command:
input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
input ushort   InpIndentUp                  = 5;                 // Indent up, in pips (1.00045-1.00055=1 pips)
input ushort   InpIndentDown                = 10;                // Indent down, in pips (1.00045-1.00055=1 pips)
input int      InpSeconds                   = 3;                 // Number of seconds

bajo Indicador, necesita un nombre - BAJO

input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
Archivos adjuntos:
 
Alexsandr San:

#versión de la propiedad "1.009"

He añadido esta función

bajo Indicador, necesita un nombre - BAJO

¡Lo olvidé! Desactivar esta función

#versión de la propiedad "1.010"

input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
input ushort   InpIndentUp                  = 5;                 // Indent up, in pips (1.00045-1.00055=1 pips)
input ushort   InpIndentDown                = 10;                // Indent down, in pips (1.00045-1.00055=1 pips)
input int      InpSeconds                   = 3;                 // Number of seconds
input bool     InpOnTimer                   = false;             // OnTimer "LOW Up" "LOW Down"
Archivos adjuntos:
 

¿Qué puede hacer esta utilidad? - ¡Sí! Prácticamente todo, todas tus fantasías en una.

GBPUSDM30

 
Alexsandr San:

¿Qué puede hacer esta utilidad? - ¡Sí! Prácticamente todo, todas tus fantasías en una.

Bueno, si el precio llega a un punto de cruce, entonces sí)))) seguro

 
Alexsandr San:

¿Qué puede hacer esta utilidad? - ¡Sí! Casi todo, todas tus fantasías en una.

Estoy pidiendo otra función en esta utilidad - arrastre, detrás de la línea azul horizontal

Pedir esta utilidad 1

Instantánea2 2

Aquí estoy, manualmente, moviendo la línea horizontal amarilla y se dispara una parada.

Instantánea3 3

 
Alexsandr San:

Esta utilidad está pidiendo otra función - arrastre, detrás de la línea azul horizontal

1

2

Aquí he movido manualmente la línea horizontal amarilla y he activado una parada

3

Está detrás de la línea horizontal - queda por ver qué cálculo se hace en el indicador Low_Macd_Line.mq5 para arrastrar detrás del azul

Foto de

en la imagen - el azul superior, tocando el amarillo superior, activa la señal

y el azul inferior, al tocar el amarillo inferior, activa la señal

 
Alexsandr San:

Está detrás de las líneas horizontales - queda por entender - qué cálculo se hace en el indicador Low_Macd_Line.mq5 para arrastrar detrás del azul

en la imagen - el azul superior, tocando el amarillo superior, activa la señal

y el azul inferior, al tocar el amarillo inferior, activa la señal

Pude arreglar el arrastre en la ventana del indicadorLow_Macd_Line.mq5 funcionó - ahora el lunes, para hacerlo bien y actualizar la utilidad

Tiro4

------------------------

aquí está la red de arrastre en sí

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTickObjTrailingCS(void)
  {
//---
   if(InpSignalsFrequency>=10) // trailing no more than once every 10 seconds
     {
      datetime time_current=TimeCurrent();
      if(time_current-m_obj_last_trailingCS>10)
        {
         if(RefreshRates())
            ObjTrailingCS();
         else
            return;
         m_obj_last_trailingCS=time_current;
        }
     }
//--- we work only at the time of the birth of new bar
   datetime time_0=iTime(m_symbol.Name(),Period(),0);
   if(time_0==m_prev_barsCS)
      return;
   m_prev_barsCS=time_0;
   if(InpSignalsFrequency<10) // trailing only at the time of the birth of new bar
     {
      if(RefreshRates())
         ObjTrailingCS();
     }
  }
//+------------------------------------------------------------------+
//| Object Trailing                                                  |
//|   InpObjTrailingStop: min distance from price to object          |
//+------------------------------------------------------------------+
void ObjTrailingCS(void)
  {
   double new_up_price        = -1;   //
   double new_down_price      = 1;   //
   double current_up_price    = ObjectGetDouble(0,InpFont0,OBJPROP_PRICE);
   double current_down_price  = ObjectGetDouble(0,InpFont1,OBJPROP_PRICE);
   double price_up            = ObjectGetDouble(0,InpFont2,OBJPROP_PRICE);
   double price_down          = ObjectGetDouble(0,InpFont3,OBJPROP_PRICE);

   if(current_up_price>new_up_price)
     {
      if(current_up_price>price_up+InpObjTrail)
        {
         m_obj_up_priceCS=price_up+InpObjTrail;
         HLineMove(0,InpFont0,m_obj_up_priceCS);
        }
     }
   if(current_down_price<new_down_price)
     {
      if(current_down_price<price_down-InpObjTrail)
        {
         m_obj_down_priceCS=price_down-InpObjTrail;
         HLineMove(0,InpFont1,m_obj_down_priceCS);
        }
     }
  }
//+------------------------------------------------------------------+
 
Alexsandr San:

He conseguido que funcione el arrastre en la ventana del indicadorLow_Macd_Line.mq5- ahora, el lunes, lo haré bien y actualizaré la Utilidad

------------------------

aquí está la red de arrastre en sí

Tal vez alguien estará interesado en jugar con esta función en el probador - Estoy pegando la utilidad, es puramente para el probador, también necesita este indicadorLow_Macd_Line.mq5

la propia función Aquí-

input string   t10="----- Price Line:     -----";                //
input string   InpFont0                     = "BUY";             // Obj: BUY (Obj:Name) ВЕРХУ
input ENUM_TRADE_COMMAND InpCSCommand       = close_open_b;      // Obj:  command:
input string   InpFont1                     = "SELL";            // Obj: SELL (Obj:Name) ВНИЗУ
input ENUM_TRADE_COMMAND InCSCommand        = close_open_s;      // Obj:  command:
input double   InpObjTrail                  = 0.0001;            // Obj: Trailing Stop MACD
input double   InpObjTrailStep              = 0.0001;            // Obj: Trailing Step MACD
input ushort   InpObjTrailingStopCS         = 15;                // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepCS         = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
input ushort   InpIndentUp                  = 5;                 // Indent up, in pips (1.00045-1.00055=1 pips)
input ushort   InpIndentDown                = 10;                // Indent down, in pips (1.00045-1.00055=1 pips)
input int      InpSeconds                   = 3;                 // Number of seconds
input bool     InpOnTimer                   = true;              // OnTimer "LOW Up" "LOW Down"

cuando desde el indicadorLow_Macd_Line.mq5 se necesita establecer estas líneas horizontales, una de ellas de nombre"LOW"

input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
Archivos adjuntos:
02_llliiiooo.mq5  255 kb
 
Alexsandr San:

Habría que añadir una función más a esta utilidad: el arrastre, detrás de la línea azul horizontal

#versión de la propiedad "1.011"

El brazo de arrastre debe ser ajustado para cada par (para XAU/USD para 1 hora) para un minuto 0.1001

En el GBPUSD por debajo de un minuto 0,0001

input double   InpObjTrail                  = 1.0001;            // Obj: Trailing Stop MACD ("0" -> Off)
input double   InpObjTrailStep              = 1.0001;            // Obj: Trailing Step MACD

Lo más importante - cuando se utiliza el indicadorLow_Macd_Line.mq5

¡¡¡tienes que introducir correctamente el nombre de la línea Horizontal (hay dos) - es muy importante!!! ¿Qué sería el indicadorLow_Macd_Line.mq5 en 1 ventana del indicador en el gráfico

input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL

¡Tiene que ser así!

input string   InpFont2                     = "LOW";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW";          // Obj: Name Price Line SELL

GBPUSDM1XX 1.

GBPUSDM1YY 2.

GBPUSDM1YY1 3.

GBPUSDM1YY2 4.

En las imágenes - la red de arrastre funcionó y cambió de dirección - ahora quiere manualmente, de nuevo establecer la línea horizontal de VENTA - en caso de que esta cambie de dirección de nuevo

Archivos adjuntos:
 
Alexsandr San:

#versión de la propiedad "1.011"

El brazo de arrastre debe ser ajustado para cada par (para XAU/USD para 1 hora) para un minuto 0.1001

En el GBPUSD por debajo de un minuto 0,0001

Lo más importante - cuando el indicadorLow_Macd_Line.mq5

necesita introducir correctamente el nombre de la línea horizontal (hay dos) - ¡¡¡más importante!!! ¿Qué haría el indicadorLow_Macd_Line.mq5 estaba en 1 ventana del indicador en el gráfico

#versión de la propiedad "1.012"

Refinamiento de la función

input string   t0="----- Price Line:        -----";              //
input string   InpFont0                     = "BUY";             // Obj: BUY (Obj:Name) ВЕРХУ
input ENUM_TRADE_COMMAND InpCSCommand       = close_open_b;      // Obj:  command:
input string   InpFont1                     = "SELL";            // Obj: SELL (Obj:Name) ВНИЗУ
input ENUM_TRADE_COMMAND InCSCommand        = close_open_s;      // Obj:  command:
input double   InpObjTrail                  = 1.0001;            // Obj: Trailing Stop MACD ("0" -> Off)
input double   InpObjTrailStep              = 1.0001;            // Obj: Trailing Step MACD
input bool     InpDub                       = false;             // "0.0":Price=false(Trail->Off) "LOW":Price=true(Trail->ON)
input bool     InpDubll                     = false;             // Duplicate "BUY""SELL" (ObjTrailStep)
input ushort   InpObjTrailingStopCS         = 15;                // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepCS         = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
input bool     InpOnTimer                   = false;             // OnTimer "LOW Up" "LOW Down"
input ushort   InpIndentUp                  = 5;                 // Indent up, in pips (1.00045-1.00055=1 pips)
input ushort   InpIndentDown                = 10;                // Indent down, in pips (1.00045-1.00055=1 pips)

Cuando se activa, la línea horizontal VENTA abre una posición y muestra una línea horizontal COMPRA y viceversa.

Además, la línea se establece desde "0" y la distancia se establecepor Obj: Trailing Step MACD

o desde la línea horizontal"LOW".


input double   InpObjTrailStep              = 1.0001;            // Obj: Trailing Step MACD
input bool     InpDub                       = false;             // "0.0":Price=false(Trail->Off) "LOW":Price=true(Trail->ON)
input bool     InpDubll                     = false;             // Duplicate "BUY""SELL" (ObjTrailStep)

FromTimer "LOW Up" "LOW Down" igual, sólose establece la distancia (entrada ushort InpObjTrailingStepCS = 5;// Obj: Trailing Step, en pips (1.00045-1.00055=1 pips)

input ushort   InpObjTrailingStepCS         = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string   InpFont2                     = "LOW Up";          // Obj: Name Price Line BUY
input string   InpFont3                     = "LOW Down";        // Obj: Name Price Line SELL
input bool     InpOnTimer                   = false;             // OnTimer "LOW Up" "LOW Down"

Cómo saber la distancia de la línea Horizontal en el IndicadorLow_Macd_Line.mq5 para establecer en la pista (en cada par, una distancia diferente)

Copiar y pegar en la configuración de la Utilidad

input double   InpObjTrailStep              = 1.0001;            // Obj: Trailing Step MACD

Foto de

en la imagen de "0" a la COMPRA horizontal 0.0064 y cuando toque la BAJA horizontal, se pondrá la VENTA horizontal (sólo por debajo de"0"-0.0064)

IMPORTANTE!!! no ponga el signo menos ( - ) delante de las cifras, que introducimos en la utilidad

Instantánea2 Una de las variantes de esta función

Archivos adjuntos: