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

 
Alexsandr San:

J'ai compris - j'ai essayé de ne pas être confus, si quelqu'un est intéressé, n'hésitez pas à demander, nous trouverons une solution ensemble.

Je cherche encore la bonne façon de les faire fonctionner.

//+------------------------------------------------------------------+
//| Enum Lor or Risk                                                 |
//+------------------------------------------------------------------+
enum ENUM_TRADE_COMMAND
  {
   Line_Line=0,      // Line
   Line_buy=1,       // Line+Open Buy
   Line_sell=2,      // Line+Open Sell
   close_buys=3,     // Close All Buy's
   close_sells=4,    // Close All Sell's
   close_all=5,      // Close All Buy's and Sell's
   open_buy=6,       // Open Buy
   open_sell=7,      // Open Sell
   open_buy_sell=8,  // Open Buy and Sell
  };
//+------------------------------------------------------------------+


C'est ici que vous effectuez l'action, dont vous devez définir la logique.

   if(main[1]>signal[1])
     {
      switch(InpTradeCommandY)
        {
         case Line_Line:
            ExtNeedLine=true;
            if(Obj_line())
               break;
         case Line_buy:
            ExtNeedOpenBuy=true;
            if(LongObjOpened())
               ExtNeedLine=true;
            if(Obj_line())
               break;
         case Line_sell:
            ExtNeedOpenSell=true;
            if(ShortObjOpened())
               ExtNeedLine=true;
            if(Obj_line())
               break;
         case  close_buys:
            ExtNeedCloseBuy=true;
            if(LongObjClosed())
               break;
         case  close_sells:
            ExtNeedCloseSell=true;
            if(ShortObjClosed())
               break;
         case close_all:
            ExtNeedCloseAll=true;
            if(LongShortObjClosed())
               break;
         case open_buy:
            ExtNeedOpenBuy=true;
            if(LongObjOpened())
               break;
         case open_sell:
            ExtNeedOpenSell=true;
            if(ShortObjOpened())
               break;
         default:
            ExtNeedOpenBuySell=true;
            if(LongShortObjOpened())
               break;
        }
      PlaySound("ok.wav");
     }
   if(main[1]<signal[1])
     {
      switch(InpTradeCommandU)
        {
         case Line_Line:
            ExtNeedLine=true;
            if(Obj_line())
               break;
         case Line_buy:
            ExtNeedOpenBuy=true;
            if(LongObjOpened())
               ExtNeedLine=true;
            if(Obj_line())
               break;
         case Line_sell:
            ExtNeedOpenSell=true;
            if(ShortObjOpened())
               ExtNeedLine=true;
            if(Obj_line())
               break;
         case  close_buys:
            ExtNeedCloseBuy=true;
            if(LongObjClosed())
               break;
         case  close_sells:
            ExtNeedCloseSell=true;
            if(ShortObjClosed())
               break;
         case close_all:
            ExtNeedCloseAll=true;
            if(LongShortObjClosed())
               break;
         case open_buy:
            ExtNeedOpenBuy=true;
            if(LongObjOpened())
               break;
         case open_sell:
            ExtNeedOpenSell=true;
            if(ShortObjOpened())
               break;
         default:
            ExtNeedOpenBuySell=true;
            if(LongShortObjOpened())
               break;
        }
      PlaySound("ok.wav");
     }
//---
 

Je n'arrive pas à comprendre - Ici, deux lignes Horizontales, lorsque le prix touche la première, elle serait supprimée, et ici, la deuxième ligne Horizontale, elle resterait.

- Je fais de l'humour, je fais de l'humour et je n'en fais pas ! Les deux sont supprimés.

Et ces lignes ont des noms différents.

1

input string   t0="----- Trailing Line: 1   -----";              //
input string   InpObjUpName                 = "TOP";             // Obj: TOP (Horizontal Line)
input int      InpStep1                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommand    = close_sells;       // Obj:  command:
input string   InpObjDownName               = "LOWER";           // Obj: LOWER (Horizontal Line)
input int      InpStep2                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommand     = close_buys;        // Obj:  command:
input ushort   InpObjTrailingStop           = 30;                // 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)

2

input string   t2="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "TOP G";           // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 30;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = close_sells;       // Obj:  command:
input string   InpObjDownNameG              = "LOWER G";         // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 30;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = close_buys;        // Obj:  command:
input ushort   InpObjTrailingStopG          = 50;                // 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)

Peut-être avons-nous besoin d'un commandement différent - celui-ci.

                           ObjectsDeleteAll(0,InpObjUpName);

Photo par

Dossiers :
 
Alexsandr San:

Je n'arrive pas à comprendre - Ici, deux lignes Horizontales, lorsque le prix touche la première, elle serait supprimée, et ici, la deuxième ligne Horizontale, elle resterait.

- Je fais de l'humour, je fais de l'humour et je n'en fais pas ! Les deux sont supprimés.

Et ces lignes ont des noms différents.

1

2

Peut-être que j'ai besoin d'une commande différente - celle-ci.


Je dessine manuellement une ligne horizontale, je lui donne le nom "TOP" et le robot la dessine avec le même nom - comment est-ce possible ?

2 Lignes horizontales portant le même nom

Photo par

ligne horizontale tracée manuellement - le robot n'a pas fonctionné, mais celui qu'il a défini a fonctionné et a supprimé les deux lignes horizontales portant le même nom"TOP".

 
Alexsandr San:

Je n'arrive pas à comprendre - Ici, deux lignes Horizontales, lorsque le prix touche la première, elle serait supprimée, et ici, la deuxième ligne Horizontale, elle resterait.

- Je fais de l'humour, je fais de l'humour et je n'en fais pas ! Les deux sont supprimés.

Et ces lignes ont des noms différents.

1

2

Peut-être que j'ai besoin d'une commande différente - celle-ci.


Il s'avère que les noms sont très similaires, c'est pourquoi"TOP" et"TOP G" ont été supprimés.

J'ai donné les autres noms dans les paramètres - maintenant il est supprimé comme il se doit.

Instantané2

 
Alexsandr San:

J'ai compris - il s'avère que les noms sont très similaires, c'est pourquoi"TOP" et"TOP G" ont été supprimés.

Je lui ai donné un nom différent dans les paramètres - maintenant il est supprimé comme il se doit !


Oui ! Ça a marché ! - Il s'avère que les noms des objets, vous avez besoin de définir que, de ne pas être proche de similaires

Instantané3

 

L'Expert exécutera toutes les commandes, vos fantasmes en un seul Expert.

PARAMÈTRES-

//+------------------------------------------------------------------+
//| Enum Lor or Risk                                                 |
//+------------------------------------------------------------------+
enum ENUM_TRADE_COMMAND
  {
   Line1_Line1=0,    // Line: LOWER
   Line2_Line2=1,    // Line: TOP
   Line_Line=2,      // Line: LOWER+Line: TOP
   close_buys=3,     // Close All Buy's
   close_sells=4,    // Close All Sell's
   close_all=5,      // Close All Buy's and Sell's
   open_buy=6,       // Open Buy
   open_sell=7,      // Open Sell
   open_buy_sell=8,  // Open Buy and Sell
  };
//+------------------------------------------------------------------+
input string   t="-----  Parameters         -----";              //
input string   Template                     = "ADX";             // Имя шаблона(without '.tpl')
input double   TargetProfit                 = 999999.99;         // Цель Баланса(Ваш Баланс + сумма)
input uint     maxLimits                    = 1;                 // Кол-во Позиции Открыть в одну сторону
input double   InpLots                      = 0.01;              // Lots
input int      InpTakeProfit                = 100;               // Take Profit ("0"-No. 5<100)
input string   t0="----- Trailing Line: 1   -----";              //
input string   InpObjUpName                 = "TOP";             // Obj: TOP (Horizontal Line)
input int      InpStep1                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommand    = open_sell;         // Obj:  command:
input string   InpObjDownName               = "LOWER";           // Obj: LOWER (Horizontal Line)
input int      InpStep2                     = 20;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommand     = open_buy;          // Obj:  command:
input ushort   InpObjTrailingStop           = 30;                // 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   t1="----- Line name: 1       -----";              //
input string   InpNameR                     = "LineR";           // Line name (Horizontal Line or Trend Line)
input ENUM_TRADE_COMMAND InpTradeCommandR   = open_buy;          // Trade command:
input string   t2="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 30;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = close_sells;       // Obj:  command:
input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 30;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = close_buys;        // Obj:  command:
input ushort   InpObjTrailingStopG          = 50;                // 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)
input string   t3="----- Line name: 2       -----";              //
input string   InpNameS                     = "LineS";           // Line name (Horizontal Line or Trend Line)
input ENUM_TRADE_COMMAND InpTradeCommandS   = open_sell;         // Trade command:
input string   t4="----- Indicators: SELL   -----";              //
input string   short_name                   = "LeMan_BrainTrend1Sig"; // Name Indicators "SELL"
input bool     InpIndicators                = true;              // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = Line2_Line2;       // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = Line1_Line1;       // Trade command: (SellBuffer Indicators)
input string   t5="----- Indicators: BUY    -----";              //
input string   short_name1                  = "LeMan_BrainTrend1Sig"; // Name Indicators "BUY"
input bool     InpIndicators1               = false;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;        // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = Line1_Line1;       // Trade command: (SellBuffer Indicators)
input string   t6="----- Button:            -----";              //
input ENUM_TRADE_COMMAND InpTradeCommandBut = Line1_Line1;       // Obj(BUY):  command:Button: BUY
input ENUM_TRADE_COMMAND InTradeCommandBut  = Line2_Line2;       // Obj(SELL):  command:Button: SELL
input int      TrailingStop_STOP_LEVEL      = 36;                // Button: Trailing Stop LEVEL

Instantané2

Dans le testeur a regardé à travers pour les erreurs - bien, aussi le résultat par défaut

Photo par

 

Ajout de commandes supplémentaires

//+------------------------------------------------------------------+
//| Enum Lor or Risk                                                 |
//+------------------------------------------------------------------+
enum ENUM_TRADE_COMMAND
  {
   Line1_Line1=0,    // Line: LOWER
   Line2_Line2=1,    // Line: TOP
   Line_Line=2,      // Line: LOWER+Line: TOP
   Line1_buys=3,     // Line: LOWER+Buy's
   Line2_sells=4,    // Line: TOP+Sell's
   close_buys=5,     // Close All Buy's
   close_sells=6,    // Close All Sell's
   close_all=7,      // Close All Buy's and Sell's
   open_buy=8,       // Open Buy
   open_sell=9,      // Open Sell
   open_buy_sell=10, // Open Buy and Sell
  };
//+------------------------------------------------------------------+

ajouté ceci

   Line1_buys=3,     // Line: LOWER+Buy's
   Line2_sells=4,    // Line: TOP+Sell's
Dossiers :
 

Expert Utilitaire -

Instructions - voici la chose la plus importante à retenir.

input string   t0="----- Trailing Line: 1   -----";              //
input string   InpObjUpName                 = "TOP";             // Obj: TOP (Horizontal Line)
input int      InpStep1                     = 25;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommand    = open_sell;         // Obj:  command:
input string   InpObjDownName               = "LOWER";           // Obj: LOWER (Horizontal Line)
input int      InpStep2                     = 25;                // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommand     = close_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   t1="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 0;                 // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = close_sells;       // Obj:  command:
input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 0;                 // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = close_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)

Ces lignes sont dessinées si vous définissez(grid step, points("0" -> false)) et également tracées (si 0 - ne le sera pas).

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

De même pour l'indicateur de signal - vous n'avez pas besoin de télécharger ces indicateurs, que j'ai joints, vous pouvez prendre les vôtres.

input string   t2="----- Indicators: SELL   -----";              //
input string   short_name                   = "LeMan_BrainTrend1Sig"; // Name Indicators "SELL"
input bool     InpIndicators                = false;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_sell;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = close_sells;       // Trade command: (SellBuffer Indicators)
input string   t3="----- Indicators: BUY    -----";              //
input string   short_name1                  = "LeMan_BrainTrend1Sig"; // Name Indicators "BUY"
input bool     InpIndicators1               = false;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;        // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = open_buy;          // Trade command: (SellBuffer Indicators)
 
Alexsandr San:

Expert Utilitaire -

Instructions - voici la chose la plus importante à retenir.

Ces lignes sont dessinées si vous définissez(grid step, points("0" -> false)) et également tracées (si 0 - ne le sera pas).

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

Aussi de l'indicateur de signal - vous ne pouvez pas télécharger ces indicateurs, que j'ai attaché, vous pouvez ramasser votre propre.


L'un des paramètres

Instantané3

Photo par

Instantané2

paramètres dans le fichier .set

Dossiers :
demo.set  4 kb
 
#property version     "1.001"

ajout de quelques commandes

//+------------------------------------------------------------------+
//| 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
  };
//+------------------------------------------------------------------+
Dossiers :
Raison: