白开水 发表于 2015-7-21 12:23:12

求大神把这个指标改成三线指标 不胜感激

//+------------------------------------------------------------------+
//|                                                   slow-stich.mq4 |
//|                                     Copyright ?2005, Nick Bilak |
//|                                              beluckgmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, Nick Bilak"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Lime
#property indicator_color2 Aqua
//---- input parameters
extern int PK=14;
extern int PD=5;
extern int PS=5;
//---- buffers
double k[];
double d[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,k);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,d);
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int counted_bars=IndicatorCounted();
   int shift,limit;
   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;
   limit=Bars-PK-1;
   if(counted_bars>=PK) limit=Bars-counted_bars-1;

   for (shift=limit;shift>=0;shift--)   {
                d=(iStochastic(NULL,0,PK,PD,PS,MODE_SMA,1,MODE_SIGNAL,shift)+iStochastic(NULL,0,PK,PD,PS,MODE_SMA,1,MODE_SIGNAL,shift+1)+iStochastic(NULL,0,PK,PD,PS,MODE_SMA,1,MODE_SIGNAL,shift+2))/3.0;
                k=(iStochastic(NULL,0,PK,PD,PS,MODE_SMA,1,MODE_MAIN,shift)+iStochastic(NULL,0,PK,PD,PS,MODE_SMA,1,MODE_MAIN,shift+1)+iStochastic(NULL,0,PK,PD,PS,MODE_SMA,1,MODE_MAIN,shift+2))/3.0;
   }
   return(0);
}
//+------------------------------------------------------------------+

mdh62 发表于 2015-7-21 20:10:02

帮你顶顶

白开水 发表于 2015-7-22 09:41:42

{:132_131:}

白开水 发表于 2015-7-23 08:13:17

{:132_123:}

hellodou 发表于 2015-7-30 22:06:46

指标很不错 我手下了哈

teamo520 发表于 2016-4-25 17:52:59

thanks a lot !!!

ODL环球国际202 发表于 2020-6-9 11:40:23

看帖回帖是美德!:lol

靖雨仇 发表于 2020-6-18 18:36:07

没看完~~~~~~ 先顶,好同志

开户申请 发表于 2020-8-7 19:11:43

帮你顶下哈!!

4tyq857ew07 发表于 2020-8-15 19:45:48

帮你顶下哈!!
页: [1] 2
查看完整版本: 求大神把这个指标改成三线指标 不胜感激