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

 
Alexsandr San:

Une autre fonction a été ajoutée. Il suffit de le vérifier en temps réel dans le terminal.

cette version est tellement - Dans le jeu du testeur

Pas une mauvaise fonction, je vous le dis. Elle va ici et là, prend ses bénéfices et n'en a rien à foutre.

Tir3.PNG

Shot4

Mais le code a besoin d'être modifié. Ça fonctionne bien.

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CloseLotBuy(void)
  {
   bool res=false;
   double level;
   double PROFIT_BUY=0.00;
   PROFIT_BUY=m_position.Commission()+m_position.Swap()+m_position.Profit();
//---
   if(m_position.Symbol()==m_symbol.Name())
     {
      if(m_position.PositionType()==POSITION_TYPE_BUY)
        {
         if(PROFIT_BUY<-TargetStopLoss || PROFIT_BUY>=TargetTakeProfit)
           {
            if(FreezeStopsLevels(level))
               ClosePositions(POSITION_TYPE_BUY,level);
           }
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CloseLotSell(void)
  {
   bool res=false;
   double level;
   double PROFIT_SELL=0.00;
   PROFIT_SELL=m_position.Commission()+m_position.Swap()+m_position.Profit();
//---
   if(m_position.Symbol()==m_symbol.Name())
     {
      if(m_position.PositionType()==POSITION_TYPE_SELL)
        {
         if(PROFIT_SELL<-TargetStopLoss || PROFIT_SELL>=TargetTakeProfit)
           {
            if(FreezeStopsLevels(level))
               ClosePositions(POSITION_TYPE_SELL,level);
           }
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotBuy(void)
  {
   bool res=false;
   double PROFIT_BUY=0.00;
   CloseTikB=iClose(NULL,Period(),0);
   OpenTikB=iOpen(NULL,Period(),0);
//---
   int total=PositionsTotal(); // количество открытых позиций
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(total>0)
              {
               ulong position_ticket=PositionGetTicket(total-1); // тикет позиции
              }
            if(total<limit_total_symbol)// количество открытых позиций
              {
               if(OpenTikB<CloseTikB)
                 {
                  if(m_position.PositionType()==POSITION_TYPE_BUY)
                    {
                     PROFIT_BUY=PROFIT_BUY+m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(PROFIT_BUY<-TargetOpenLot)
                       {
                        double price=m_symbol.Ask();
                        for(uint y=0; y<maxLimits; y++)
                          {
                           //--- open position
                           if(m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_BUY,InpLots,price,0.0,0.0))
                              printf("Position by %s to be opened",m_symbol.Name());
                           else
                             {
                              printf("Error opening BUY position by %s : '%s'",m_symbol.Name(),m_trade.ResultComment());
                              printf("Open parameters : price=%f,TP=%f",price,0.0);
                             }
                           res=true;
                          }
                       }
                    }
                 }
              }
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotSell(void)
  {
   bool res=false;
   double PROFIT_SELL=0.00;
   CloseTikS=iClose(NULL,Period(),0);
   OpenTikS=iOpen(NULL,Period(),0);
//---
   int total=PositionsTotal(); // количество открытых позиций
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(total>0)
              {
               ulong position_ticket=PositionGetTicket(total-1); // тикет позиции
              }
            if(total<limit_total_symbol)// количество открытых позиций
              {
               if(OpenTikS>CloseTikS)
                 {
                  if(m_position.PositionType()==POSITION_TYPE_SELL)
                    {
                     PROFIT_SELL=PROFIT_SELL+m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(PROFIT_SELL<-TargetOpenLot)
                       {
                        double price0=m_symbol.Bid();
                        for(uint y=0; y<maxLimits; y++)
                          {
                           if(m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_SELL,InpLots,price0,0.0,0.0))
                              printf("Position by %s to be opened",m_symbol.Name());
                           else
                             {
                              printf("Error opening SELL position by %s : '%s'",m_symbol.Name(),m_trade.ResultComment());
                              printf("Open parameters : price=%f,TP=%f",price0,0.0);
                             }
                           res=true;
                          }
                       }
                    }
                 }
              }
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
 
Alexsandr San:

J'ai essayé sur un compte réel, je voulais faire un petit profit sur deux positions ouvertes. J'avais entré 160 dans les paramètres, je pensais qu'il fermerait la plus grande position négative, mais non, il a fermé...

Je pensais qu'il fermerait la plus grosse position perdante mais il ne l'a pas fait. Il a fermé celle qui avait 160 de profit et a fermé les deux positions et je suis un imbécile. Il s'avère que je dois calculer à partir de la première position ouverte, en ajoutant le moins un.


#propriété version "1.017"

Ce n'est que le cinquième jour que j'ai découvert comment utiliser correctement cette fonction. Maintenant, il se ferme sur le profit total sur une paire de tous les Acheter ou Vendre.

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool ProfitOnTick(void)
  {
   bool res=false;
   double PROFIT_BUY=0.00;
   double PROFIT_SELL=0.00;

   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of open positions
     {
      string   position_GetSymbol=PositionGetSymbol(i); // GetSymbol позиции
      if(position_GetSymbol==m_symbol.Name())
        {
         if(m_position.PositionType()==POSITION_TYPE_BUY)
           {
            PROFIT_BUY=PROFIT_BUY+PositionGetDouble(POSITION_PROFIT);
           }
         else
           {
            PROFIT_SELL=PROFIT_SELL+PositionGetDouble(POSITION_PROFIT);
           }
        }
     }
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(m_position.PositionType()==POSITION_TYPE_BUY)
              {
               if(PROFIT_BUY<-TargetStopLoss || PROFIT_BUY>=TargetTakeProfit) // if the profit
                  ClosePosition(m_position.Symbol()); // close a position by the specified symbo
              }
            res=true;
           }
   for(int u=PositionsTotal()-1; u>=0; u--) // returns the number of current positions
      if(m_position.SelectByIndex(u)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name())
           {
            if(m_position.PositionType()==POSITION_TYPE_SELL)
              {
               if(PROFIT_SELL<-TargetStopLoss || PROFIT_SELL>=TargetTakeProfit) // if the profit
                  ClosePosition(m_position.Symbol()); // close a position by the specified symbo
              }
            res=true;
           }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
Dossiers :
 
Alexsandr San:

Pas une mauvaise fonction, je vous le dis. Ici et là, elle prend ses bénéfices et s'en fout.

Je dois modifier le code pour que cela fonctionne - tout semble fonctionner correctement.

Je n'arrive pas à créer un code pour que cette fonction fonctionne dans un seul terminal. Je veux l'essayer sur 4 bornes, je ne sais pas ce que ça donnera

4 nthvbyfkf

4 nthvbyfkf2

 
Alexsandr San:

Je ne peux pas créer de code pour faire fonctionner cette fonction dans un terminal. Je veux l'essayer sur 4 bornes, je ne sais pas ce qui en sortira.

Tous ces 4 terminaux - n'ont donné aucun résultat. Et en général, cette fonction de Loss - je ne peux pas écrire le code.

Mais il y a longtemps que j'ai créé une telle logique de travail, uniquement avec des lignes horizontales. Il reste à réfléchir à ce qui multiplierait le lot

Photo par Photo 1

Nous définissons une ligne horizontale en haut de l'écran.

input string   t3="----- Trailing Line: 1   -----";              //
input string   InpObjUpName                 = "ZTOP";            // Obj: TOP (Horizontal Line)
input int      InpStep1                     = 25;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommand    = Line2_sells;       // Obj:  command:

définir une ligne horizontale en bas

input string   t3="----- Trailing Line: 1   -----";              //
input string   InpObjDownName               = "ZLOWER";          // Obj: LOWER (Horizontal Line)
input int      InpStep2                     = 25;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommand     = Line1_buys;        // Obj:  command:

dès que le prix touche ces lignes, la position sera ouverte et les lignes horizontales seront fixées.

ces -

input string   t4="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 25;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = Line2_sells;       // Obj:  command:
input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 25;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = Line1_buys;        // Obj:  command:
input ushort   InpObjTrailingStopG          = 0;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepG          = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)

et à partir de ces lignes horizontales, on ouvrira une position et on mettra les premières lignes horizontales - et ainsi de suite jusqu'à ce que le prix soit capable de les atteindre
GBPUSDM5figure 2

Voici fermé - mis dans les paramètres, le Profit

GBPUSDM52figure 3

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

lorsqu'il atteint un profit de 200 sur la paire, il ferme la position.

GBPUSDM53figure 4

atteint 200 et fermé toutes les positions à l'achat ou à la vente - car vous pouvez ouvrir dans les deux sens et chaque côté a son propre profit ou sa propre perte.

- maintenant quand il atteint la ligne horizontale, il ouvre une position - mais vous pouvez les déplacer manuellement

GBPUSDM54figure 5

 

La fonction augmente le lot, d'une perte .

grâce à cet hommehttps://www.mql5.com/ru/forum/107406#comment_3018721

2732

Igor Kim

//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotBuy(void)
  {
   bool res=false;
//---
   double PROFIT_BUY=0.00;
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of open positions
     {
      string   position_GetSymbol=PositionGetSymbol(i); // GetSymbol позиции
      if(position_GetSymbol==m_symbol.Name())
        {
         if(m_position.PositionType()==POSITION_TYPE_BUY)
           {
            PROFIT_BUY=PROFIT_BUY+PositionGetDouble(POSITION_PROFIT);
           }
        }
     }
   double Lots=InpLots;
   double ab=PROFIT_BUY;
   if(ab<-200 && ab>=-400)
      Lots=0.01;
   if(ab<-400 && ab>=-800)
      Lots=0.02;
   if(ab<-800 && ab>=-1600)
      Lots=0.04;
   if(ab<-1600)
      Lots=0.08;
   double price=m_symbol.Ask();
   for(uint y=0; y<maxLimits; y++)
     {
      //--- open position
      if(m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_BUY,Lots,price,0.0,0.0))
         printf("Position by %s to be opened",m_symbol.Name());
      else
        {
         printf("Error opening BUY position by %s : '%s'",m_symbol.Name(),m_trade.ResultComment());
         printf("Open parameters : price=%f,TP=%f",price,0.0);
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool OpenLotSell(void)
  {
   bool res=false;
//---
   double PROFIT_SELL=0.00;
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of open positions
     {
      string   position_GetSymbol=PositionGetSymbol(i); // GetSymbol позиции
      if(position_GetSymbol==m_symbol.Name())
        {
         if(m_position.PositionType()==POSITION_TYPE_BUY)
           {
            PROFIT_SELL=PROFIT_SELL+PositionGetDouble(POSITION_PROFIT);
           }
        }
     }
   double Lots=InpLots;
   double ab=PROFIT_SELL;
   if(ab<-200 && ab>=-400)
      Lots=0.01;
   if(ab<-400 && ab>=-800)
      Lots=0.02;
   if(ab<-800 && ab>=-1600)
      Lots=0.04;
   if(ab<-1600)
      Lots=0.08;
   double price0=m_symbol.Bid();
   for(uint y=0; y<maxLimits; y++)
     {
      if(m_trade.PositionOpen(m_symbol.Name(),ORDER_TYPE_SELL,Lots,price0,0.0,0.0))
         printf("Position by %s to be opened",m_symbol.Name());
      else
        {
         printf("Error opening SELL position by %s : '%s'",m_symbol.Name(),m_trade.ResultComment());
         printf("Open parameters : price=%f,TP=%f",price0,0.0);
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
Увеличение размера ЛОТА. ПОМОГИТЕ!!!
Увеличение размера ЛОТА. ПОМОГИТЕ!!!
  • 2008.03.07
  • www.mql5.com
Скажите, можно ли как то увеличить размер лота с каждой сделки....??? К примеру, у меня депозит 100, торгую с лотом 0.50. депозит 200, торую 1...
 

#propriété version "1.018"

possibilité supplémentaire, d'augmenter la taille du lot de la perte en devise

input string   tL="----  Lots Parameters    -----";              //
input uint     maxLimits                    = 1;                 // Кол-во Позиции Открыть в одну сторону
input double   InpLots1                     = 0.01;              // Lots 1
input int      InpLots_01                   = 500;               // До убытка валюте Lots 0.01
input double   InpLots2                     = 0.02;              // Lots 2
input int      InpLots_02                   = 1000;              // До убытка валюте Lots 0.02
input double   InpLots3                     = 0.04;              // Lots 3
input int      InpLots_03                   = 2000;              // До убытка валюте Lots 0.04
input double   InpLots4                     = 0.08;              // Lots 4

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

augmentation du nombre d'actions. Il est seulement nécessaire de prendre un montant dans les paramètres, 4 niveaux - le dernier montant, plus de 2000 ouvrira le lot 0.08

GBPUSDM5h

dans l'image de ces lignes, position ouverte, et peut également être réglé dans les paramètres de chalutage de ces lignes

input string   t3="----- Trailing Line: 1   -----";              //
input string   InpObjUpName                 = "ZTOP";            // Obj: TOP (Horizontal Line)
input int      InpStep1                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommand    = Line2_sells;       // Obj:  command:
input string   InpObjDownName               = "ZLOWER";          // Obj: LOWER (Horizontal Line)
input int      InpStep2                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommand     = Line1_buys;        // Obj:  command:
input ushort   InpObjTrailingStop           = 0;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStep           = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string   t4="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = Line2_sells;       // Obj:  command:
input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = Line1_buys;        // Obj:  command:
input ushort   InpObjTrailingStopG          = 0;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepG          = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)

au lieu de 0 set distance= 0;// Obj : Trailing Stop (distance entre le prix et l'objet, en pips)

----------------------------ВАЖНО!

Le stop suiveur doit être défini de telle sorte que lorsque le signal se déclenche, la ligne s'éloigne de la barre, sinon le signal sera déclenché à plusieurs reprises.

Voici la situation - lorsque vous parcourez une ligne horizontale et que vous revenez à la même barre lorsque la commande est déclenchée.

XAUUSDM5

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

Pour que la ligne horizontale ne soit pas répétée, mettez 0 = 20;// Obj : Pas de la grille, points("0" -> false)

à zéro, il exécutera la commande et sera supprimé.

Dossiers :
 
Alexsandr San:

La fonction augmente le lot, d'une perte .

grâce à cet hommehttps://www.mql5.com/ru/forum/107406#comment_3018721

2732

J'ai testé cette fonction aujourd'hui avec une ligne horizontale pour une perte (lorsque le prix va dans une mauvaise direction, rencontre une ligne horizontale sur son chemin, à partir de là, ouvre une position et la ligne saute plus loin, d'une distance donnée, la perte augmente et la prochaine fois qu'il rencontre la ligne horizontale, le lot s'ouvrira avec une augmentation).

Je suis stupéfait. - Cette logique, fait tout pencher du côté positif. Je me demande à quel prix on peut vendre un tel miracle !

Instantané3

----------------------------------------- voici un autre exemple - le prix va contre moi. c'est la première image, je montrerai la deuxième au fur et à mesure qu'elle fonctionne.

USDJPYM5 figure 1

USDJPYM5z Figure 2

Photo par Figure 3

 

Pour comprendre comment tout cela fonctionne

Il y a des boutons dans l'utilitaire (BUY et SELL), ils font toutes les commandes que les lignes horizontales font - vous pouvez simplement regarder dans le testeur pour voir comment cela fonctionne .

Configuration des boutons ----------------

input string   t7="----- Button:            -----";              //
input ENUM_TRADE_COMMAND InpTradeCommandBut = Line1_buys;        // Obj(BUY):  command:Button: BUY
input ENUM_TRADE_COMMAND InTradeCommandBut  = Line2_sells;       // Obj(SELL):  command:Button: SELL
input int      TrailingStop_STOP_LEVEL      = 36;                // Button: Trailing Stop LEVEL

Configuration des lignes horizontales --------------------

input string   t3="----- Trailing Line: 1   -----";              //
input string   InpObjUpName                 = "ZTOP";            // Obj: TOP (Horizontal Line)
input int      InpStep1                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommand    = Line2_sells;       // Obj:  command:
input string   InpObjDownName               = "ZLOWER";          // Obj: LOWER (Horizontal Line)
input int      InpStep2                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommand     = Line1_buys;        // Obj:  command:
input ushort   InpObjTrailingStop           = 0;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStep           = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string   t4="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = Line2_sells;       // Obj:  command:
input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = Line1_buys;        // Obj:  command:
input ushort   InpObjTrailingStopG          = 0;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepG          = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)

Voici les commandes qui peuvent être exécutées --------------------------------.

//+------------------------------------------------------------------+
//| ENUM_TRADE_COMMAND                                                 |
//+------------------------------------------------------------------+
enum ENUM_TRADE_COMMAND
  {
   Turn_Off=0,       // TURN OFF
   Line1_Line1=1,    // Line: LOWER
   Line2_Line2=2,    // Line: TOP
   Line_Line=3,      // Line: LOWER+Line: TOP
   Line1_buys=4,     // Line: LOWER+Buy's
   Line2_sells=5,    // Line: TOP+Sell's
   sells_Line1=6,    // Line: LOWER+Sell's
   buys_Line2=7,     // Line: TOP+Buy's
   close_buys=8,     // Close All Buy's
   close_sells=9,    // Close All Sell's
   close_all=10,     // Close All Buy's and Sell's
   open_buy=11,      // Open Buy
   open_sell=12,     // Open Sell
   close_open_b=13,  // Close Sell+Open Buy
   close_open_s=14,  // Close Buy+Open Sell
   open_buy_sell=15, // Open Buy and Sell
  };
//+------------------------------------------------------------------+

Fonction de profit

------------ Le profit n'est pas commun - L'achat a son propre profit La vente a son propre profit (par exemple, vous avez deux positions ouvertes, l'une à l'achat et l'autre à lavente, dans les paramètres que vous voulez gagner 100, alors que chacun d'entre eux ne prendra pas 100).

input double   TargetTakeProfit             = 1000000;           // Прибыль на паре в валюте
Важно!!! правильно настроить , открытии лота (До убытка валюте)
input string   tL="----  Lots Parameters    -----";              //
input uint     maxLimits                    = 1;                 // Кол-во Позиции Открыть в одну сторону
input double   InpLots1                     = 0.01;              // Lots 1
input int      InpLots_01                   = 500;               // До убытка валюте Lots 0.01
input double   InpLots2                     = 0.02;              // Lots 2
input int      InpLots_02                   = 1000;              // До убытка валюте Lots 0.02
input double   InpLots3                     = 0.04;              // Lots 3
input int      InpLots_03                   = 2000;              // До убытка валюте Lots 0.04
input double   InpLots4                     = 0.08;              // Lots 4

Il y a deux pertes sur la paire - la perte totale et (achat et vente, chacun d'eux a sa propre perte)

Ici, le calcul est effectué dans la perte de l'achat de votre perte de lavente de votre.

 

Légère correction - pour que la ligne horizontale réagisse plus rapidement au signal.

Il y a eu une situation - le prix a touché, traversé la ligne horizontale, mais n'a pas déclenché.

n'a pas fonctionné

#propriété version "1.019"

Dossiers :
 

Essai d'une nouvelle fonction . Le calendrier donne un signal, une commande peut être sélectionnée à partir de ce signal.

input string   t10="---- CalendarValueLast  -----";              //
input bool     Inpndar                      = false;             // Сигнал Календаря Включить
input ENUM_TRADE_COMMAND InpCalendCommandS  = Line_Line;         // Trade command:

Je dois encore réfléchir aux autres commandes nécessaires pour le calendrier.

Je les ai déjà.

//+------------------------------------------------------------------+
//| ENUM_TRADE_COMMAND                                                 |
//+------------------------------------------------------------------+
enum ENUM_TRADE_COMMAND
  {
   Turn_Off=0,       // TURN OFF
   Line1_Line1=1,    // Line: LOWER
   Line2_Line2=2,    // Line: TOP
   Line_Line=3,      // Line: LOWER+Line: TOP
   Line1_buys=4,     // Line: LOWER+Buy's
   Line2_sells=5,    // Line: TOP+Sell's
   sells_Line1=6,    // Line: LOWER+Sell's
   buys_Line2=7,     // Line: TOP+Buy's
   close_buys=8,     // Close All Buy's
   close_sells=9,    // Close All Sell's
   close_all=10,     // Close All Buy's and Sell's
   open_buy=11,      // Open Buy
   open_sell=12,     // Open Sell
   close_open_b=13,  // Close Sell+Open Buy
   close_open_s=14,  // Close Buy+Open Sell
   open_buy_sell=15, // Open Buy and Sell
  };
//+------------------------------------------------------------------+

l'image définit l'Utilitaire, c'est l'image 1. la deuxième sera avec la commande exécutée (Lignes horizontales à une distance donnée)

Snapshot7Photo 1


Raison: