求大神把这个指标改成三线指标 不胜感激
//+------------------------------------------------------------------+//| 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);
}
//+------------------------------------------------------------------+
帮你顶顶 {:132_131:} {:132_123:} 指标很不错 我手下了哈 thanks a lot !!! 看帖回帖是美德!:lol 没看完~~~~~~ 先顶,好同志 帮你顶下哈!! 帮你顶下哈!!
页:
[1]
2