我如何通过试验和错误组装我的顾问 - 页 20

 

我今天将在一个真实账户上测试这个功能

关于指标线FiboPivot_V2

有必要输入指标的短名称 - 删除它

- 如果你不删除指标--它将重新设置线并重新开仓

取

附加的文件:
 

这里有一个很好的指标https://www.mql5.com/ru/code/26585

价格密度

用于我的EA

横向将工作买和数字SL

input string   t8="------ NAME Open ------";          //
input string   InpHLineBUY          = "(- ВНИЗУ -)";  // Name open buy (- ВНИЗУ -)
input string   InpHLineSELL         = "(- ВВЕРХУ -)"; // Name open sell (- ВВЕРХУ -)
input bool     InpReverse01         = false;          // Reverse Open - переворот торгового сигнала
input string   short_name           = "INDICATOR";    // INDICATOR_SHORTNAME Delete
input string   t9="------ NAME Close ------";         //
input string   InpHLineCloseBUY     = "(- ВНИЗУ -)";  // Name Close buy (- ВНИЗУ -)
input string   InpHLineCloseSELL    = "(- ВВЕРХУ -)"; // Name Close sell (- ВВЕРХУ -)
input bool     InpReverse10         = false;          // Reverse Close - переворот торгового сигнала
input string   short_name0          = "INDICATOR";    // INDICATOR_SHORTNAME Delete
input bool     Inpres               = false;          // Delete All Indicators
//+------------------------------------------------------------------+

转到 "对象列表 "并复制名称,任何一行或数字

或者你可以将这些图标设置在 "买入 "和 "停止 "下面--这样你就不必删除指标了。

IMEI

Price density
Price density
  • www.mql5.com
Работа индикатора идёт с барами, которые видимы в окне графика.  График разбивается на зоны ("Zone") и в каждой зоне пдсчитывается количество попаданий цен. Принцип расчёта: если цена High или Low попадает в зону, считается, что в этой зоне счётчик попаданий...
 
调整了声音。当它打开--当它关闭--当它达到平衡目标。
 
input bool     InpOnlyLimit         = false;          // Выставить отложенный ордер
input bool     InpOnlystart         = true;           // Вкл. Buy\Sell

所有的行动都可以联合或单独地改为待定订单

挂单像拖网一样跟着价格

sinput string  t3="------ Варианты ордеров ------";   //
input uint     maxLimits            = 1;              // Кол-во отложенных.ордеров в сетке в одну сторону
input int      InpPenStep           = 25;             // Шаг сетки, пунктов
input string   t4="------ Trailing ордеров ------";   //
input bool     InpStopTrailing      = true;           // ВКЛ.Trailing отлож.ордеров(ВЫКЛ.если больше 1 в сетке)
input ushort   InpTrailingPenStop   = 25;             // Trailing Stop of a Orders. "0" --> off and Trailing Step is not important
input ushort   InpTrailingPenStep   = 5;              // Trailing Step of a Orders
input string   t5="------ в ту же сторону ------";    //
input bool     ReverseOne           = false;          // BUYLIMIT SELLLIMIT
input bool     ReverseOny           = true;           // BUYSTOP SELLSTOP
input string   t6="------ на оборот ------";          //
input bool     ReverseOne1          = false;          // SELLLIMIT BUYLIMIT
input bool     ReverseOny1          = false;          // SELLSTOP BUYSTOP

对象名称已经触发,挂单 显示在以下图片中

墨守成规EURJPYH2_LI

圈出的对象还没有达到--它要等到当前价格低于该对象时才会出现。

图片来源

现在,如果SELLSTOP被触发--上面我已经设置了对象名称来关闭SELL

如果没有SELLSTOP,并且价格走高,那么收盘对象将被删除。

而挂单将 跟随价格

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

这个EA缺少的是一个对象的名称Trawl。

我们需要改进这一功能

 

我在这里把声音放在了错误的地方。

//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void CloseAllProfit0()
  {
//---
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(Extposition.SelectByIndex(i)) // selects the position by index for further access to its properties
        {
         if((PositionGetDouble(POSITION_PROFIT)/PositionGetDouble(POSITION_VOLUME)/
             SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE))/n>InTakeProfit)
            ClosePosition(Extposition.Symbol()); // close a position by the specified symbo
         if(UseSound)
            PlaySound("ok.wav");
        }
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void CloseAllLoss0()
  {
//---
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(Extposition.SelectByIndex(i)) // selects the position by index for further access to its properties
        {
         if((PositionGetDouble(POSITION_PROFIT)/PositionGetDouble(POSITION_VOLUME)/
             SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE))/n<-InStopLoss)
            ClosePosition(Extposition.Symbol());  // close a position by the specified symbo
         if(UseSound)
            PlaySound("ok.wav");
        }
  }
//+------------------------------------------------------------------+

我把它修好并附上文件。

谁能告诉我该把它放在哪里?

         if(UseSound)
            PlaySound("ok.wav");

我已经知道了。

在这里,它是。

//+------------------------------------------------------------------+
//| Close selected position                                          |
//+------------------------------------------------------------------+
void ClosePosition(const string symbol)
  {
   if(InitTrade(symbol))
      ExtTrade.PositionClose(Extposition.Ticket()); // close a position by the specified symbo
   if(UseSound)
      PlaySound("ok.wav");
  }
//+------------------------------------------------------------------+
附加的文件:
 
Aleksandr Klapatyuk:

所有的行动都可以联合或单独地改为待定订单

挂单像拖网一样跟着价格

对象名称已经触发,挂单 显示在以下图片中

圈出的对象还没有达到--它要等到当前价格低于该对象时才会出现。

现在,如果SELLSTOP被触发--上面我已经设置了对象名称来关闭SELL

如果没有SELLSTOP,并且价格走高,那么收盘对象将被删除。

而挂单将 跟随价格

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

这个EA缺少的是一个对象的名称Trawl。

这个功能需要改进

我已经就位了--期待我们什么?

图片来源

移动命名的对象--关闭SELL

快照2

将一个命名的对象移到SELL。

我们需要自动设置这一点。

我不会移动该对象,但专家顾问会移动指定的对象。

快照3

跌破--对象为118.811的卖出 收盘价

以下是

更多

快照7

我想展示它,但没办法--我把它移到了线附近

图片8

在打字时--在命名的对象上关闭

镜头9

射击10


 

https://www.mql5.com/ru/forum/233860/page43#comment_13219147

非常感谢!弗拉基米尔-卡尔普托夫 祝你和你的亲人身体健康。

在我的专家顾问中加入了你的功能

input string   t8="------ NAME Open ------";          //
input string   InpHLineBUY          = "(- ВНИЗУ -)";  // Name open buy (- ВНИЗУ -)
input string   InpHLineSELL         = "(- ВВЕРХУ -)"; // Name open sell (- ВВЕРХУ -)
input bool     InpReverse01         = false;          // Reverse Open - переворот торгового сигнала
input string   short_name           = "INDICATOR";    // INDICATOR_SHORTNAME Delete
input string   t9="------ NAME Close ------";         //
input string   InpHLineCloseBUY     = "(- ВНИЗУ -)";  // Name Close buy (- ВНИЗУ -)
input string   InpHLineCloseSELL    = "(- ВВЕРХУ -)"; // Name Close sell (- ВВЕРХУ -)
input bool     InpReverse10         = false;          // Reverse Close - переворот торгового сигнала
input string   short_name0          = "INDICATOR";    // INDICATOR_SHORTNAME Delete
input bool     Inpres               = false;          // Delete All Indicators
input string   t10="------ Trailing Obj:Line ------"; //
input string   InpObjDownName       = "(- ВНИЗУ -)";  // Obj: Follows the price up (Horizontal Line)
input string   InpObjUpName         = "(- ВВЕРХУ -)"; // Obj: Follows the price down (Horizontal Line)
input ushort   InpObjTrailingStop   = 15;             // 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)
//+------------------------------------------------------------------+
Вечер выходного дня
Вечер выходного дня
  • 2019.09.14
  • www.mql5.com
В этой теме исключительно на выходных принимаются заявки на "быстро забацать MQL5 советника...
附加的文件:
 

其中一个公用设施中的两个

https://www.mql5.com/ru/code/26353

弗拉基米尔-卡尔普托夫

移动两个物体--水平线


https://c.mql5.com/3/291/Trailing_Objects.mq5

input string   t0="------ Obj:Line ------";           //
input string   InpObjDownName0         = "BUY";       // Obj: Follows the price down (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand=close_sells; // Obj:  command: ВВЕРХУ
input string   InpObjUpName0           = "SELL";      // Obj: Follows the price up (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand0=close_buys; // Obj:  command: ВНИЗУ
input string   t1="------ Trailing Obj:Line ------";  //
input string   InpObjUpName            = "BUY";       // Obj: Follows the price down (Horizontal Line)
input string   InpObjDownName          = "SELL";      // Obj: Follows the price up (Horizontal Line)
input ushort   InpObjTrailingFrequency = 10;          // Obj: Trailing, in seconds (< "10" -> only on a new bar)
input ushort   InpObjTrailingStop      = 15;          // 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)
//---
Trade command
Trade command
  • www.mql5.com
Советник во входных параметрах имеет шесть команд: Close All Buy's - закрыть все позиции BUY по текущему символу, magic number позиций не учитывается Close All Sell's - закрыть все позиции SELL по текущему символу, magic number позиций не учитывается Close All Buy's and Sell's - закрыть все позиции BUY и SELL по текущему символу, magic number...
附加的文件:
 
Aleksandr Klapatyuk:

其中一个公用设施中的两个

https://www.mql5.com/ru/code/26353

弗拉基米尔-卡尔普托夫

移动两个物体--水平线


https://c.mql5.com/3/291/Trailing_Objects.mq5

我还添加了四条水平线,可用于向任何方向打开或关闭--好吧,还有拖网。

水平线 - 用于拖网。否则,你可以使用任何命名的对象。

input string   t0="------ Obj:Line Open ------";      //
input string   InpObjDownName0         = "TOP";       // Obj: Follows the price down (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand=open_sell;   // Obj:  command: ВВЕРХУ
input string   InpObjUpName0           = "LOWER";     // Obj: Follows the price up (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand0=open_buy;   // Obj:  command: ВНИЗУ
input string   t1="------ Obj:Line Close ------";     //
input string   InpObjDownName02        = "TOP DELL";  // Obj: Follows the price down (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand2=close_sells;// Obj:  command: ВВЕРХУ
input string   InpObjUpName02          = "LOWER DELL";// Obj: Follows the price up (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand02=close_buys;// Obj:  command: ВНИЗУ
input string   t2="------ Trailing Obj:Line ------";  //
input string   InpObjUpName            = "TOP DELL";  // Obj: Follows the price down (Horizontal Line)
input string   InpObjDownName          = "LOWER DELL";// Obj: Follows the price up (Horizontal Line)
input ushort   InpObjTrailingFrequency = 10;          // Obj: Trailing, in seconds (< "10" -> only on a new bar)
input ushort   InpObjTrailingStop      = 15;          // 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)
//---
附加的文件:
 
Aleksandr Klapatyuk:

我还添加了四条水平线,可以用来在任何方向上打开和关闭--也可以用来拖动。

水平线是用于拖网的.否则你可以使用任何命名的对象。

更新 - 在下一页