ggdpla1981 发表于 2020-7-26 23:03: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=iMA(NULL,0,ExtParam1,MODE_EMA,0,PRICE_CLOSE,i);
      {
      if(PriceMode == 0) ExtMapBuffer1=Close;
      if(PriceMode == 1) ExtMapBuffer1=Low;
      }
//----
   for(i=0; i<limit; i++)
      {
      if(PriceMode == 0) ExtMapBuffer2=Close;
      if(PriceMode == 1) ExtMapBuffer2=High;
      }
//---- done
   return(0);
}
//+------------------------------------------------------------------+

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

{:1_179:}

hqch88 发表于 2020-12-17 20:05:29

{:1_179:}

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

支持下
页: [1] 2 3 4 5
查看完整版本: 海龟交易源码