以下是飛狐源碼:
1.{K-極限波段}
DIFF:=EMA(CLOSE,6) - EMA(CLOSE,13);
DEA:=EMA(DIFF,5);
DFA:=2.5*(DEA-DIFF);
MACD1:=2*(DIFF-DEA);
MACD2:=EMA(MACD1,3);
x1:=DIFF<=DEA and DFA>=0;
x2:=DIFF>=DEA and DFA<=0;
x3:=DIFF>=REF(DIFF,1) AND DEA<REF(DEA,1);
x4:=DIFF<REF(DIFF,1) AND DEA>REF(DEA,1);;
DRAWGBK(CLOSE,COLORRGB(50,100,50),COLORRGB(130,130,130),1);
{八周RSI}
LC := REF(CLOSE,1);
八周RSI:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;
T:=cross(84,八周RSI);
{K線}
STICKLINE(x1 and OPEN>CLOSE,HIGH,LOW,0,0),ColorFFA100;//跌陰
STICKLINE(x1 and OPEN>CLOSE,CLOSE,OPEN,7,0),ColorFFA100;
STICKLINE(x1 and OPEN<=CLOSE,HIGH,LOW,0,0),ColorFFA100;//跌陽(yáng)
STICKLINE(x1 and OPEN<=CLOSE,CLOSE,OPEN,7,1),ColorFFA100;
STICKLINE(x2 and OPEN>CLOSE,LOW,HIGH,0,0),Color5050FF;//漲陰
STICKLINE(x2 and OPEN>CLOSE,CLOSE,OPEN,7,0),Color5050FF;
STICKLINE(x2 and OPEN<=CLOSE,LOW,HIGH,0,0),Color5050FF;//漲陽(yáng)
STICKLINE(x2 and OPEN<=CLOSE,CLOSE,OPEN,7,1),Color5050FF;
STICKLINE(x3 and OPEN>CLOSE,HIGH,LOW,0,0),COLORMAGENTA;//低陰
STICKLINE(x3 and OPEN>CLOSE,CLOSE,OPEN,7,0),COLORMAGENTA;
STICKLINE(x3 and OPEN<=CLOSE,HIGH,LOW,0,0),COLORMAGENTA;//低陽(yáng)
STICKLINE(x3 and OPEN<=CLOSE,CLOSE,OPEN,7,1),COLORMAGENTA;
STICKLINE(x4 and T and OPEN>CLOSE,LOW,HIGH,0,0),COLORGREEN;//盤整陰
STICKLINE(x4 and T and OPEN>CLOSE,CLOSE,OPEN,7,0),COLORGREEN;
STICKLINE(x4 and T and OPEN<=CLOSE,LOW,HIGH,0,0),COLORGREEN;//盤整陽(yáng)
STICKLINE(x4 and T and OPEN<=CLOSE,CLOSE,OPEN,7,1),COLORGREEN;
{字}
DRAWTEXTEX(SYSPARAM(3)=BARPOS,0,10,2,'■粉啟動(dòng);'),COLORMAGENTA;
DRAWTEXTEX(SYSPARAM(3)=BARPOS,0,60,2,'■藍(lán)空倉(cāng);'),ColorFFA100;
DRAWTEXTEX(SYSPARAM(3)=BARPOS,0,110,2,'■紅持股;'),COLORRED;
DRAWTEXTEX(SYSPARAM(3)=BARPOS,0,160,2,'■綠逃頂'),COLORGREEN;