创建EA和指标的模板 - 页 4

 

不知道它是否存在。 这里有一个一次性的解决方案。 用NotePad打开你的模板,然后滚动浏览并在一张纸上记下指标。

 

没有

这是人的解析器,但我有点懒....

 

比建议的更好的方法是将你的专家/指标列表复制并粘贴到记事本中,然后打开一个新的图表,并逐一张贴模板,在模板中使用的模板上打上勾。回到你的专家/指标文件夹,删除那些没有被使用的自定义指标。

做这个已经有18年了,我以前就是这样做的。只需不到10分钟就能完成。这也节省了大量的空间。

这些天,我为我测试的每个系统使用一个单独的MT4平台。我目前交易的交易系统需要80多个模板和大约25个自定义指标 来运行(是的,一个系统)。

 

解析器

我最后用pspad从所有模板中提取带有指标(name=)的行,然后用vim编辑,删除 未使用的模式(:g/pattern_toremove/d),然后用pspad重新编辑,插入Robocopy命令(可以用vim完成)。

我从我的mt4目录中删除所有的指标,然后用bat从备份中复制仅使用的指标。

一切都很好。

 

创建EA和指标的模板 - MT4

该论坛

  1. 一些好的模板--线程
  2. mql4代码 "的功能--线程

文章

  1. MetaEditor:模板是一个立足点
  2. 闲置是进步的动力。半自动标记模板
  3. 通用专家顾问模板

代码基础

  1. 带跟踪止损的专家顾问模板 v2- MetaTrader 4的专家
  2. 基于ATR的基本专家顾问- MetaTrader 4的专家
  3. 带移动止损的基本专家顾问- MetaTrader 4的专家
  4. 基本移动平均线模板- expert for MetaTrader 4
  5. 基本移动平均线模板- MetaTrader 4的专家
  6. 网格模板EA- MetaTrader 4的专家
  7. 基本Rsi模板EA- MetaTrader 4的专家
  8. 模板名称--适用于MetaTrader 4的指标
  9. 不含DLL的新闻EA模板- 专家级的MetaTrader 4
  10. 没有DLL的新闻EA 模板 - 专家级的MetaTrader 4
  11. EA 模板 - 适用于MetaTrader 4的专家
  12. 强大的EA 模板 - 专家适用于MetaTrader 4

============

Basic Moving Average template
Basic Moving Average template
  • www.mql5.com
PricerEA PricerEA is a utility to help any trader to place pending orders (stop or limit) at a specific price. SpreadWatch This indicator watches and displays the biggest spread the pair generated. It is recommended to run at least 5 days, from Monday to Friday, to get a big picture of the broker's spread. My Trailing Simple Trailing...
 

基本移动平均线模板- MetaTrader 4的专家

基本移动平均线模板 - MetaTrader 4的专家

基本移动平均线模板EA - 来自移动平均线指标的信号和相应的交易。这是一个用于进一步研究或开发的模板。这个模板有所有的基础知识,包括资金管理,可以在交易操作中充分发挥作用。

Basic Moving Average template
Basic Moving Average template
  • www.mql5.com
PricerEA PricerEA is a utility to help any trader to place pending orders (stop or limit) at a specific price. SpreadWatch This indicator watches and displays the biggest spread the pair generated. It is recommended to run at least 5 days, from Monday to Friday, to get a big picture of the broker's spread. My Trailing Simple Trailing...
 

基于ATR的基本采取和停止专家顾问 - MetaTrader 4的专家

基于ATR的基本采取和停止专家顾问 - MetaTrader 4的专家

With this template i'm demonstrating the use of Average True Range based take profit and stop loss levels. Take profit and stop loss levels are calculated using ATR factor multipliers.

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

其他模板。

Basic ATR based take and stop expert adviser
Basic ATR based take and stop expert adviser
  • www.mql5.com
Trend flex x 2 Multi Currency Template This is Multi Currency Expert Advisor Template that can trade according to symbol list (default 6 symbols). For Example, Ichimoku Chinkou Span is used for entry logic. // Main input parameters input double Lots = 0.01; // Basic lot size input int StopLoss= 50; //Stoploss (in Pips) input int...
 
Sergey Golubev:

创建EA和指标的模板 - MT4

该论坛

  1. 一些好的模板--线程
  2. mql4代码 "的功能--线程

文章

  1. MetaEditor:模板是一个立足点
  2. 闲置是进步的动力。半自动标记模板
  3. 通用专家顾问模板

代码基础

  1. 带跟踪止损的专家顾问模板 v2- MetaTrader 4的专家
  2. 基于ATR的基本专家顾问- MetaTrader 4的专家
  3. 带移动止损的基本专家顾问- MetaTrader 4的专家
  4. 基本移动平均线模板- expert for MetaTrader 4
  5. 基本移动平均线模板- MetaTrader 4的专家
  6. 网格模板EA- MetaTrader 4的专家
  7. 基本Rsi模板EA- MetaTrader 4的专家
  8. 模板名称--适用于MetaTrader 4的指标
  9. 不含DLL的新闻EA 模板 - 专家级的MetaTrader 4
  10. 没有DLL的新闻EA 模板 - 专家级的MetaTrader 4
  11. EA 模板 - 适用于MetaTrader 4的专家
  12. 强大的EA 模板 - 专家适用于MetaTrader 4

============

创建EA和指标的模板 - MT5

论坛

不适用

文章

  1. 使用伪模板作为C++模板的替代品
  2. MetaTrader的高级EA构造器 - botbrains.app- 文章 (MT5)
  3. 开发EA构造器的尝试- 文章 (MT5)
  4. 基于自定义指标的交易信号发生器
  5. 将指标从MQL4转移到MQL5
  6. 如何使用UML工具开发一个专家顾问
  7. 在MQL5中为初学者实际实现数字滤波器
  8. 使用面向对象的方法对EA的模式进行编程

代码库

  1. 一个专家顾问模板- MetaTrader 5的专家
  2. 交易引擎4- MetaTrader 5的专家
  3. 指标代码- MetaTrader 5的专家
  4. 应用模板- MetaTrader 5的脚本
  5. 市场分析的脚本和模板- MetaTrader 5的脚本
An attempt at developing an EA constructor
An attempt at developing an EA constructor
  • www.mql5.com
In this article, I offer my set of trading functions in the form of a ready-made EA. This method allows getting multiple trading strategies by simply adding indicators and changing inputs.
 

关于交易、自动交易系统和测试交易策略的论坛

如何开始使用MQL5

Vladimir Karputov, 2020.09.07 18:10

一个使用iCustom工作的例子--我们在EA[data folder]\MQL5\Indicators\Examples\MACD.mq5中获得指标数据

代码:iCustom iMACD在chart.mq5上的值

自定义MACD指标位于该文件夹中。

记住在MQL5中使用指标的规则:在OnInit中创建一个指标句柄。在未来,指标句柄,使用CopyBuffer,被用来接收来自指标的数据。

//+------------------------------------------------------------------+
//|                                 iCustom iMACD value on chart.mq5 |
//|                              Copyright © 2020, Vladimir Karputov |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2020, Vladimir Karputov"
#property version   "1.000"
#property tester_indicator "Examples\\MACD"
//--- input parameters
input int                  Inp_MACD_fast_ema_period= 8;           // MACD: period for Fast average calculation
input int                  Inp_MACD_slow_ema_period= 17;          // MACD: period for Slow average calculation
input int                  Inp_MACD_signal_period  = 9;           // MACD: period for their difference averaging
input ENUM_APPLIED_PRICE   Inp_MACD_applied_price  = PRICE_CLOSE; // MACD: type of price
//---
int      handle_iCustom;                     // variable for storing the handle of the iCustom indicator
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create handle of the indicator iMACD ([data folder]\MQL5\Indicators\Examples\MACD.mq5)
   handle_iCustom=iCustom(Symbol(),Period(),"Examples\\MACD",Inp_MACD_fast_ema_period,Inp_MACD_slow_ema_period,
                          Inp_MACD_signal_period,Inp_MACD_applied_price);
//--- if the handle is not created
   if(handle_iCustom==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iMACD indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   if(handle_iCustom!=INVALID_HANDLE)
      IndicatorRelease(handle_iCustom);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   double main[],signal[];
   ArraySetAsSeries(main,true);
   ArraySetAsSeries(signal,true);
   int start_pos=0,count=3;
   if(!iGetArray(handle_iCustom,MAIN_LINE,start_pos,count,main) ||
      !iGetArray(handle_iCustom,SIGNAL_LINE,start_pos,count,signal))
     {
      return;
     }
//---
   string text_main="Main |",text_signal="Signal |";
   for(int i=count-1; i>=0; i--)
     {
      text_main=text_main+" #"+IntegerToString(i)+" "+DoubleToString(main[i],Digits()+1)+" | ";
      text_signal=text_signal+" #"+IntegerToString(i)+" "+DoubleToString(signal[i],Digits()+1)+" | ";
     }
   Comment(text_main,"\n",text_signal);
  }
//+------------------------------------------------------------------+
//| Get value of buffers                                             |
//+------------------------------------------------------------------+
bool iGetArray(const int handle,const int buffer,const int start_pos,
               const int count,double &arr_buffer[])
  {
   bool result=true;
   if(!ArrayIsDynamic(arr_buffer))
     {
      PrintFormat("ERROR! EA: %s, FUNCTION: %s, this a no dynamic array!",__FILE__,__FUNCTION__);
      return(false);
     }
   ArrayFree(arr_buffer);
//--- reset error code
   ResetLastError();
//--- fill a part of the iBands array with values from the indicator buffer
   int copied=CopyBuffer(handle,buffer,start_pos,count,arr_buffer);
   if(copied!=count)
     {
      //--- if the copying fails, tell the error code
      PrintFormat("ERROR! EA: %s, FUNCTION: %s, amount to copy: %d, copied: %d, error code %d",
                  __FILE__,__FUNCTION__,count,copied,GetLastError());
      //--- quit with zero result - it means that the indicator is considered as not calculated
      return(false);
     }
   return(result);
  }
//+------------------------------------------------------------------+
代码附在#106 的帖子中
How to start with MQL5
How to start with MQL5
  • 2020.09.06
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
 

指标代码- MetaTrader 5的专家

基于《开发EA构造器的尝试》一文。

这个非交易的EA只是收集了一些现成的代码,用于与指标一起工作。包含指标的输入参数(写在专家顾问的 "头 "上),手柄 的声明 (写在专家顾问的 "头 "上) 和手柄的创建(写在OnInit上)。