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

 

现在手动交易 很方便。

//+------------------------------------------------------------------+
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
//+------------------------------------------------------------------+
附加的文件:
 
我最初是用这种方法来学习编程的))))))))))
 
Darirunu:
我开始用这种方法先学习编程)))

进展如何?

 
Aleksandr Klapatyuk:

进展如何?

原来是一个构造函数。这很方便。

 

忘了警告 --

= 200000.00; // 目标利润--必须超过你设置中的余额(你的余额是10000--想赚500。)

= 250.0; // 止损 - 隐藏并在达到0点时关闭,如果它将立即关闭(1=10点。)250=2500点。

= 460.0; //获利- 隐藏并在达到点位时关闭 - 如果是0,它将立即关闭(1=10点位。)

nput 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
Общие принципы - Торговые операции - MetaTrader 5
Общие принципы - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Перед тем как приступить к изучению торговых функций платформы, необходимо создать четкое представление об основных терминах: ордер, сделка и позиция. — это распоряжение брокерской компании купить или продать финансовый инструмент. Различают два основных типа ордеров: рыночный и отложенный. Помимо них существуют специальные ордера Тейк Профит...
附加的文件:
 

我不知道该把什么放在这里。但它需要。- when to set = D'1970.01.01'; // Expert start time.

然后它在工作或等待中是可见的--开启的时间。

时间到了。 它不会打开--直到时机成熟。

时间 这意味着专家顾问已经开始工作。

附上日期和时间。
附加的文件:
 

一个新功能--或者我应该说是正确的。

现在从6个对象--其中两条水平线--我们自己画的,他们拖的--我们可以从中关闭和打开。

和4个命名的对象--也是手动设置的--也可以 既关闭又打开

input string   t1="------ Obj:Name 1-2 ------";         //
input string   InpObjDownName0         = "TOP 1";       // Obj: TOP (Name Obj) ВВЕРХУ 1
input ENUM_TRADE_COMMAND InpTradeCommand=open_sell;     // Obj:  command:
input string   InpObjUpName0           = "LOWER 2";     // Obj: LOWER (Name Obj) ВНИЗУ 2
input ENUM_TRADE_COMMAND InpTradeCommand0=open_buy;     // Obj:  command:
input string   t2="------ Obj:Name 3-4 ------";         //
input string   InpObjDownName02        = "TOP 3";       // Obj: TOP (Name Obj) ВВЕРХУ 3
input ENUM_TRADE_COMMAND InpTradeCommand2=open_sell;    // Obj:  command:
input string   InpObjUpName02          = "LOWER 4";     // Obj: LOWER (Name Obj) ВНИЗУ 4
input ENUM_TRADE_COMMAND InpTradeCommand02=open_buy;    // Obj:  command:
input string   t3="------ Trailing Obj:Line 5-6 ----";  //
input string   InpObjUpName            = "TOP 5";       // Obj: TOP (Horizontal Line) ВВЕРХУ 5
input ENUM_TRADE_COMMAND InpTradeCommand3=close_sells;  // Obj:  command:
input string   InpObjDownName          = "LOWER 6";     // Obj: LOWER (Horizontal Line) ВНИЗУ 6
input ENUM_TRADE_COMMAND InpTradeCommand03=close_buys;  // Obj:  command:
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)
附加的文件:
 

该指标移动2个命名的对象--需要手动设置。

通过指标=iFractals

//--- входные параметры 
input string   InpFont2              = "TOP";       // Obj: TOP (Obj:Name) ВВЕРХУ
input string   InpFont1              = "LOWER";     // Obj: LOWER (Obj:Name) ВНИЗУ
input int      InpFractal            = 0;           // Obj: Fractal (0-2)
附加的文件:
IgorM.mq5  17 kb
 
Aleksandr Klapatyuk:

该指标移动2个命名的对象--需要手动设置。

通过指标=iFractals


从这个指标,你可以为你的想法运行任何指标

改变这里

//---
#resource "\\Indicators\\Examples\\ZigzagColor.ex5"
//---

和这里

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   PlotIndexSetInteger(0,PLOT_ARROW,108);
   PlotIndexSetInteger(1,PLOT_ARROW,108);
//--- indicator buffers mapping
   SetIndexBuffer(0,FractalUpBuffer,INDICATOR_CALCULATIONS);
   SetIndexBuffer(1,FractalDownBuffer,INDICATOR_CALCULATIONS);
//--- create handle of the indicator iFractals
   handle_iFractals=iCustom(Symbol(),Period(),"Examples\\ZigzagColor");
//--- if the handle is not created
   if(handle_iFractals==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iFractals indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+

市场中的指标的路径

改变这里

//---
#resource "\\Indicators\\Market\\Automatic Trendlines.ex5"
//---

和这里

   handle_iFractals=iCustom(Symbol(),Period(),"Market\\Automatic Trendlines");
附加的文件:
 
Aleksandr Klapatyuk:

类似这样的东西--我在指示器中戳了一下。

在最底部--蓝线,越过50水平


这说明了什么,有什么信号?