{新版分水岭主图源码如下}
N:=10;
M:=30;
A:=MA(CLOSE,N)+ABS(MA(CLOSE,N)-REF(MA(CLOSE,N),1));
B:=MA(CLOSE,M)+ABS(MA(CLOSE,M)-REF(MA(CLOSE,M),1));
分水岭1:IF(MA(CLOSE,N)<A,A,MA(CLOSE,N))DOTLINE;
分水岭2:IF(MA(CLOSE,M)<B,B,MA(CLOSE,M))LINETHICK2;
操作线1:=分水岭1-(EMA(CLOSE,3)-分水岭1);
操作线2:=分水岭2-(EMA(CLOSE,3)-分水岭2);
DRAWTEXT(ISLASTBAR,分水岭1,'【分水岭1】'),COLORRED;
DRAWTEXT(ISLASTBAR,分水岭2,'【分水岭2】'),COLOR00FF00;
短线:=MA(CLOSE,5);
上轨:(1+8/100)*EMA(CLOSE,N);
下轨:(1-8/100)*EMA(CLOSE,N);
DIF:=EMA(CLOSE,9)-EMA(CLOSE,12);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
DD:=MACD>0;
买入笑脸:=CROSS(分水岭1,操作线1) AND CLOSE>OPEN AND (CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>1;
DRAWICON(买入笑脸 AND C>分水岭2,LOW*0.985,5);
STICKLINE(CLOSE>OPEN,OPEN,CLOSE,3,0),COLORRED;
STICKLINE(CLOSE<OPEN,OPEN,CLOSE,3,0),COLORGREEN;
{新版分水岭副图源码如下}
N:=10;
M:=30;
A:=MA(CLOSE,N)+ABS(MA(CLOSE,N)-REF(MA(CLOSE,N),1));
B:=MA(CLOSE,M)+ABS(MA(CLOSE,M)-REF(MA(CLOSE,M),1));
分水岭1:=IF(MA(CLOSE,N)<A,A,MA(CLOSE,N));
分水岭2:=IF(MA(CLOSE,M)<B,B,MA(CLOSE,M));
操作线1:=分水岭1-EMA(CLOSE,3)+分水岭1;
操作线2:=分水岭2-EMA(CLOSE,3)+分水岭2;
短线:=MA(CLOSE,5);
上轨:=(1+0.08)*EMA(CLOSE,N);
下轨:=(1-0.08)*EMA(CLOSE,N);
BUY1:=CROSS(分水岭1,操作线1) AND CLOSE>OPEN AND (CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>1;
STICKLINE(BUY1 AND C>分水岭2,0,10,2,0),COLORRED;
DRAWICON(BUY1 AND C>分水岭2,10,5);