私が試行錯誤しているアドバイザーの組み立て方 - ページ 20

削除済み  

こちらは素晴らしいインジケーターです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
//+------------------------------------------------------------------+

オブジェクトのリスト]に移動して名前をコピーします。

または、これらのアイコンをBUYとSTOPの下に設定することで、インジケータを削除する必要がありません。

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 に名前付きオブジェクトを移動させました。

これを自動的に設定する必要があります。

私はオブジェクトを動かさないが、Expert Advisorは名前の付いたオブジェクトを動かしてしまうのだ。

スナップショット3

下に移動 - 118.811の売り 終値にオブジェクト

下

引越し

スナップショット7

見せたいけど、見せられない~ラインの近くに移動させた

写真8

入力中 - 指定したオブジェクトを閉じる

ショット9

ショット10


削除済み  

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

ありがとうございました。ウラジミール・カルプトフ あなたとあなたの大切な人に、健康を。

Expert Advisorにあなたの機能を追加しました。

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 советника...
ファイル:
削除済み  

ユーティリティの1つに2つ

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

ウラジーミル・カルプトフ

2つのオブジェクトを移動させる -水平線


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:

ユーティリティの1つに2つ

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

ウラジーミル・カルプトフ

2つのオブジェクトを移動させる -水平線


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

また、4本の横線を追加して、どの方向にも開閉できるようにしました。まあ、トロールもですけどね。

水平線 - トローリング用。それ以外の場合は、任意の名前付きオブジェクトを使用することができます。

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:

さらに、4本の水平線を追加して、任意の方向に開閉できるようにし、トローリングもできるようにしました。

水平線はトローリング用です。それ以外の場合は、任意の名前のオブジェクトを使用できます。

アップデート - 次ページへ
削除済み  

マニュアル取引に 便利になりました。

//+------------------------------------------------------------------+
input string   t0="------ Parameters --------";         //
input datetime HoursFrom               = D'1970.01.01'; // Время старта Эксперта
input datetime HoursTo                 = D'2030.12.31'; // Время закрытия всех позиций
input double   TargetProfit            = 200000.00;     // Целевая прибыль
input double   InpVolumeLotOrRisk      = 0.01;          // The value for "Money management"
input double   InStopLoss              = 250.0;         // Stop Loss
input double   InTakeProfit            = 460.0;         // Take Profit
input string   t1="------ Obj:Line Open ------";        //
input string   InpObjDownName0         = "TOP";         // Obj: TOP (Horizontal Line) ВВЕРХУ
input ENUM_TRADE_COMMAND InpTradeCommand=open_sell;     // Obj:  command:
input string   InpObjUpName0           = "LOWER";       // Obj: LOWER (Horizontal Line) ВНИЗУ
input ENUM_TRADE_COMMAND InpTradeCommand0=open_buy;     // Obj:  command:
input string   t2="------ Obj:Line Close ------";       //
input string   InpObjDownName02        = "TOP DELL";    // Obj: TOP (Horizontal Line) ВВЕРХУ
input ENUM_TRADE_COMMAND InpTradeCommand2=close_sells;  // Obj:  command:
input string   InpObjUpName02          = "LOWER DELL";  // Obj: LOWER (Horizontal Line) ВНИЗУ
input ENUM_TRADE_COMMAND InpTradeCommand02=close_buys;  // Obj:  command:
input string   t3="------ Trailing Obj:Line ------";    //
input string   InpObjUpName            = "TOP DELL";    // Obj: TOP (Horizontal Line) ВВЕРХУ
input string   InpObjDownName          = "LOWER DELL";  // Obj: LOWER (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)
input string   t4="------ Indicator Delete ------";     //
input string   short_name              = "INDICATOR 1"; // INDICATOR_SHORTNAME 1
input string   short_name0             = "INDICATOR 2"; // INDICATOR_SHORTNAME 2
input bool     Inpres                  = false;         // Delete All Indicators
//+------------------------------------------------------------------+
ファイル: