45评论

4收藏

海龟交易源码

avatar ggdpla1981 | 5980 人阅读 | 45 人评论 | 2020-07-26

//+------------------------------------------------------------------+
//|                                                       MrBean.mq4 |
//|                          Copyright ?2004, Fourway Software Corp. |
//|                                           http://www.fourway.com |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2004, Fourway Software Corp."
#property link      "http://www.fourway.com"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkSalmon
#property indicator_color2 CornflowerBlue
//---- input parameters
extern int       ExtParam1=21;
extern int       ExtParam2=21;
extern int       PriceMode=1;
extern int ATR_Period = 13;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ATR = iATR(NULL, 0, ATR_Period, 0);
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexDrawBegin(1,ExtParam1);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(1,ExtParam2);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   for(int i=0; i<limit; i++)
      //ExtMapBuffer1[i]=iMA(NULL,0,ExtParam1,MODE_EMA,0,PRICE_CLOSE,i);
      {
      if(PriceMode == 0) ExtMapBuffer1[i]=Close[iLowest(NULL,0,MODE_CLOSE,ExtParam1,i+1)];
      if(PriceMode == 1) ExtMapBuffer1[i]=Low[iLowest(NULL,0,MODE_LOW,ExtParam1,i+1)];
      }
//----
   for(i=0; i<limit; i++)
      {
      if(PriceMode == 0) ExtMapBuffer2[i]=Close[iHighest(NULL,0,MODE_CLOSE,ExtParam2,i+1)];
      if(PriceMode == 1) ExtMapBuffer2[i]=High[iHighest(NULL,0,MODE_HIGH,ExtParam2,i+1)];
      }
//---- done
   return(0);
  }
//+------------------------------------------------------------------+
""
还没有人打赏,支持一下

评论|共 45 个

sky

发表于 2020-7-31 17:09:27 | 显示全部楼层

谢谢楼主分享

最他妈不是人

发表于 2020-8-18 14:13:02 | 显示全部楼层

帮你顶下哈!!

黄金价格

发表于 2020-12-12 19:15:14 | 显示全部楼层

支持下

绝望的大叔

发表于 2020-12-14 17:32:40 | 显示全部楼层

hqch88

发表于 2020-12-17 20:05:29 | 显示全部楼层

frings0217

发表于 2020-12-27 19:14:39 | 显示全部楼层

顶下

metallica0005

发表于 2020-12-30 11:58:34 | 显示全部楼层

支持下

wocaoni928

发表于 2020-12-30 12:08:49 | 显示全部楼层

支持下

肖亚杰

发表于 2020-12-30 21:16:03 | 显示全部楼层

支持下

12345下一页
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则