Comment j'ai assemblé mon conseiller par essais et erreurs - page 51

 
Alexsandr San:

Oui ! Vous devriez également ajouter ceci à l'Utilitairehttps://www.mql5.com/ru/code/23939.


#propriété version "1.009"

Ajout de cette fonction

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

sous Indicateur, besoin d'un nom - LOW

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

#propriété version "1.009"

J'ai ajouté cette fonction

sous Indicateur, besoin d'un nom - LOW

J'ai oublié ! Désactiver cette fonction

#propriété version "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"
Dossiers :
 

Que peut faire cet utilitaire ? - oui ! pratiquement tout, tous vos fantasmes en un seul .

GBPUSDM30

 
Alexsandr San:

Que peut faire cet utilitaire ? - oui ! pratiquement tout, tous vos fantasmes en un seul .

Eh bien, si le prix arrive à un point d'équilibre, alors oui)))) pour sûr.

 
Alexsandr San:

Que peut faire cet utilitaire ? - Oui ! A peu près tout, tous vos fantasmes en un seul.

Je demande une autre fonction dans cette utilité - le chalutage, derrière la ligne bleue horizontale.

Demander cette utilité 1

Instantané2 2

Ici, je déplace manuellement la ligne horizontale jaune et un stop est déclenché.

Instantané3 3

 
Alexsandr San:

Cette utilité demande une autre fonction - le chalutage, derrière la ligne bleue horizontale.

1

2

Ici j'ai manuellement, déplacé la ligne horizontale jaune et déclenché un stop

3

Elle se trouve derrière la ligne horizontale - il reste à voir quel calcul est effectué dans l'indicateur Low_Macd_Line.mq5 pour traîner derrière la bleue.

Photo par

dans l'image - le bleu du haut, en touchant le jaune du haut, déclenche le signal

et le bleu inférieur, en touchant le jaune inférieur, déclenche le signal

 
Alexsandr San:

Il se trouve derrière les lignes horizontales - il reste à voir quel calcul est effectué dans l'indicateur Low_Macd_Line.mq5 pour traîner derrière la bleue.

dans l'image - le bleu du haut, en touchant le jaune du haut, déclenche le signal

et le bleu inférieur, en touchant le jaune inférieur, déclenche le signal

J'ai pu réparer le chalut dans la fenêtre de l'indicateurLow_Macd_Line.mq5 a fonctionné - maintenant, lundi, pour le mettre au point et mettre à jour l'utilitaire

Shot4

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

Voici le chalut lui-même

//+------------------------------------------------------------------+
//| 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:

J'ai réussi à faire fonctionner le chalut dans la fenêtre de l'indicateurLow_Macd_Line.mq5- maintenant, lundi, il faut le faire fonctionner correctement et mettre à jour l'utilitaire .

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

Voici le chalut lui-même

Peut-être que quelqu'un sera intéressé à jouer avec cette fonction dans le testeur - je colle l'utilitaire, il est purement pour le testeur, vous avez également besoin de cet indicateurLow_Macd_Line.mq5

la fonction elle-même Ici-

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"

quand, à partir de l'indicateurLow_Macd_Line.mq5, vous devez définir ces lignes horizontales, une nommée"LOW".

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

Une fonction supplémentaire devrait être ajoutée à cet utilitaire - le chalut, derrière la ligne bleue horizontale.

#propriété version "1.011"

Le bras suiveur doit être ajusté pour chaque paire (pour XAU/USD pour 1 heure) pour une minute 0.1001

Sur GBPUSD sous une minute 0.0001

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

La chose la plus importante - lorsque vous utilisez l'indicateurLow_Macd_Line.mq5

vous devez entrer correctement le nom de la ligne horizontale (il y en a deux) - c'est très important !!! Que serait l'indicateurLow_Macd_Line.mq5 dans 1 fenêtre de l'Indicateur sur le graphique

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

Il faut que ce soit comme ça !

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.

Dans les images - le chalut a fonctionné et a changé de direction - maintenant vous voulez manuellement, à nouveau définir la ligne horizontale de VENTE - au cas où il change à nouveau de direction.

Dossiers :
 
Alexsandr San:

#propriété version "1.011"

Le bras suiveur doit être ajusté pour chaque paire (pour XAU/USD pour 1 heure) pour une minute 0.1001

Sur GBPUSD sous une minute 0.0001

Le plus important - lorsque l'indicateurLow_Macd_Line.mq5

il faut entrer correctement le nom de la ligne horizontale (il y en a deux) - plus important !!! Que ferait l'indicateurLow_Macd_Line.mq5 était dans 1 fenêtre de l'indicateur sur le graphique

#propriété version "1.012"

Légèrement affiné la fonction

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)

Lorsqu'elle est déclenchée, la ligne horizontale SELL ouvre une position et affiche une ligne horizontale BUY et vice versa.

De même, la ligne est définie à partir de "0" et la distance est définiepar Obj : Trailing Step MACD

ou de la ligne horizontale"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" identique, seulela distance est définie (entrée 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"

Comment connaître la distance de la ligne horizontale dans l'indicateurLow_Macd_Line.mq5 à mettre dans le sentier (sur chaque paire, une distance différente)

Copier et coller dans les paramètres de l'Utilitaire

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

Photo par

dans l'image de "0" à Horizontal BUY 0.0064 et quand il touche Horizontal LOW, Horizontal SELL sera mis (seulement en dessous de"0"-0.0064)

IMPORTANT !!! ne mettez pas de moins ( - ) devant les chiffres que nous saisissons dans l'utilitaire.

Instantané2 Une des variantes de cette fonction

Dossiers :
Raison: