飞狐指标实例(一)
-
相关简介:示例一: {多空密码主图} STICKLINE(CLOSE0,h*9.0,l*0.01,8,0),color7d7f0f;{设置背景,可以将这句源码复制粘贴到任意主图指标的头条位置上} Var1:=(3*CLOSE+LOW+OPEN+HIGH)/6; Var3:=(20*Var1+19*REF(Var1,1)+18*REF(Var1,2)+17*REF(Var1,3)+16*REF(Var1,4)+15*REF (Var1,5)+14*REF(Var1,6)+13*REF(Var1,7)+12*
-
文章来源:股海网作者:股海网发布时间:2016-02-24浏览次数:
示例一:
{多空密码主图}
STICKLINE(CLOSE>0,h*9.0,l*0.01,8,0),color7d7f0f;{设置背景,可以将这句源码复制粘贴到任意主图指标的头条位置上}
Var1:=(3*CLOSE+LOW+OPEN+HIGH)/6;
Var3:=(20*Var1+19*REF(Var1,1)+18*REF(Var1,2)+17*REF(Var1,3)+16*REF(Var1,4)+15*REF
(Var1,5)+14*REF(Var1,6)+13*REF(Var1,7)+12*REF(Var1,8)+11*REF(Var1,9)+10*REF
(Var1,10)+9*REF(Var1,11)+8*REF(Var1,12)+7*REF(Var1,13)+6*REF(Var1,14)+5*REF
(Var1,15)+4*REF(Var1,16)+3*REF(Var1,17)+2*REF(Var1,18)+REF(Var1,20))/221;
Var4:=MA(Var3,78),LINETHICK2;
Var5:=EMA(MA(CLOSE,3),34);
Var6:=MA(Var3,5);
Var7:=MA(Var3,9);
M60:MA(C,60),COLOREEFFFF,CIRCLEDOT;
STICKLINE(Var3>1.005*Var4,Var3,Var4,4,1),COLORYELLOW;
STICKLINE(IF(Var3<Var5,Var3<=1.015*Var4,Var3<=1.005*Var4),Var7,Var4,2,1),COLORffff88;
STICKLINE(Var3>Var6,Var3,Var7,4,1),COLORff88ff;
STICKLINE(IF(Var3<Var6,Var3<=1.015*Var6,Var3<=1.005*Var6),Var3,Var7,3,1),COLORFF6633;
STICKLINE(Var3>Var6,Var3,Var7,4,1),COLOR0000ff;
{下面是柱形K线,如果喜欢这样的K线,你可以复制粘贴到任意主图指标里面}
STICKLINE(C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=O,C,O,4,0),COLOR7070ff;
STICKLINE(C>=O,C,O,2,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
STICKLINE(C<=O,C,O,4,0),COLORFF6600;
STICKLINE(C<=O,C,O,2,0),colorffcc66;
STICKLINE(C<=O,H,L,0,0),colorffcc66;
M9:MA(C,9),COLORYELLOW;
生命线: MA(CLOSE,13),COLORYELLOW,LINETHICK2;
牛熊线: (EMA(CLOSE,5)*7+EMA(CLOSE,5)*3)/10,COLORFF00CC,LINETHICK2;
箱顶:MA(REF(HHV(CLOSE,30),1),2);
箱底:MA(REF(LLV(CLOSE,30),1),2);
AAMA(C,13)+MA(C,21)+MA(C,34)+MA(C,55))/4,COLORFF00FF;
半年线:ma(close,125),colorffcc66;
指标示例二:
{财出水面副图}
VAR2:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
VAR3:=SMA(SMA(VAR2,3,1),3,1)/28.57;
VAR4:=EMA(VAR3,5);
操盘:=3*VAR3-2*VAR4;
A1:=CROSS(操盘,VAR3) AND VAR3<2.1 and c>o;
40,colorred,pointdot;
STICKLINE(c>0,40,22,8,0),colorff8080;{设置背景,CLOSE>0条件满足时,在坐标40至坐标22处设置宽度为8的兰色背景}
STICKLINE(c>0,22,4,8,0),color916f87;{设置背景,CLOSE>0条件满足时,在坐标22至坐标4处设置宽度为8的深紫色背景}
stickline(a1,18,15,28,0),colorred;
stickline(a1,18,18,18,0),colorblue;
stickline(a1,8,8,9,0),colorffff00;
stickline(a1,6,6,4,0),colorffff00;
stickline(a1,10,10,12,0),colorffff00;
stickline(a1,12,12,20,0),colorffff00;
stickline(a1,14,14,24,0),colorffff00;
stickline(a1,16,34,0.1,0),colorc0c0c0;
stickline(a1,33,18,9,0),colorwhite;
drawtext(a1,36,'财出水面'),COLORWHITE;
VarE:=30+(REF(CLOSE,1)-REF(OPEN,1))/REF(OPEN,1)*100/1.5;
VarF:=30+(REF(CLOSE,2)-REF(OPEN,2))/REF(OPEN,2)*100/1.5;
Var10:=CROSS("KDJ.K"(9,3,3),"KDJ.J"(9,3,3)) AND "KDJ.D"(9,3,3)>13;
Var11:=CROSS(REF("KDJ.K"(9,3,3),1),REF("KDJ.J"(9,3,3),1)) AND REF("KDJ.D"(9,3,3),1)>13;
Var12:=CROSS(REF("KDJ.K"(9,3,3),2),REF("KDJ.J"(9,3,3),2)) AND REF("KDJ.D"(9,3,3),2)>12;
Var13:=Var10 OR Var11 OR Var12;
Var14:=REF("BIAS.BIAS2"(6,12,24),1)>2;
Var15:=REF("RSI.RSI1"(6,12,24),1)>(VarE+VarF)/1.8 AND REF("ROC.ROC"(12,6),1)-"ROC.ROC"(12,6)>0 AND Var13 AND Var14;
卖出:=Var15*100/15,color00ff00;
stickline(卖出,18,15,28,0),coloryellow;
stickline(卖出,18,18,18,0),colorblue;
stickline(卖出,8,8,9,0),colorffff00;
stickline(卖出,6,6,4,0),colorffff00;
stickline(卖出,10,10,12,0),colorffff00;
stickline(卖出,12,12,20,0),colorffff00;
stickline(卖出,14,14,24,0),colorffff00;
stickline(卖出,16,28,0.1,0),colorc0c0c0;
stickline(卖出,28,18,9,0),color00ff00;
drawtext(卖出,31,'落袋为安'),COLOR00FF00;
指标示例三:
{金叉死叉}
STICKLINE(100,0,100,8,0),colorff0098;{设置背景,100条件满足时,在坐标100至坐标0处设置宽度为8的紫兰色背景}
Var1:=EMA(HHV(HIGH,500),21);
Var2:=EMA(HHV(HIGH,250),21);
Var3:=EMA(HHV(HIGH,90),21);
Var4:=EMA(LLV(LOW,500),21);
Var5:=EMA(LLV(LOW,250),21);
Var6:=EMA(LLV(LOW,90),21);
Var7:=EMA((Var4*0.96+Var5*0.96+Var6*0.96+Var1*0.558+Var2*0.558+Var3*0.558)/6,21); Var8:=EMA((Var4*1.25+Var5*1.23+Var6*1.2+Var1*0.55+Var2*0.55+Var3*0.65)/6,21);
Var9:=EMA((Var4*1.3+Var5*1.3+Var6*1.3+Var1*0.68+Var2*0.68+Var3*0.68)/6,21);
VarA:=EMA((Var7*3+Var8*2+Var9)/6*1.738,21);
VarB:=REF(LOW,1);
VarC:=SMA(ABS(LOW-VarB),3,1)/SMA(MAX(LOW-VarB,0),3,1)*100;
VarD:=EMA(IF(CLOSE*1.35<=VarA,VarC*10,VarC/10),3);
VarE:=LLV(LOW,30);
VarF:=HHV(VarD,30);
Var10:=IF(MA(CLOSE,58),1,0);
Var11:=EMA(IF(LOW<=VarE,(VarD+VarF*2)/2,0),3)/618*Var10;
Var12:=IF(Var11>40,10,Var11);
STICKLINE(Var12>8,0,Var12,4,1), , COLORFF00FF;
Var13:=HHV(HIGH,30);
Var14:=LLV(LOW,30);
能量K:EMA((CLOSE-Var14)/(Var13-Var14)*97,5),COLORRED,linethick2;
能量D:EMA((CLOSE-Var14)/(Var13-Var14)*100,15),linethick2,colorff9933;
底部峰:5,pointdot,linethick2,COLORFF00FF;
DRAWTEXT(CROSS(底部峰,能量K),能量d,'●'),COLORWHITE;
DRAWTEXT(CROSS(底部峰,能量K),能量K+15,'底部形成'),COLORWHITE;
大智慧:100,,pointdot,linethick2,color00ccff;
强弱分界:50,pointdot,COLORWHITE;
DRAWTEXT(CROSS(90,能量K),80,'●'),COLOR00FF00;
DRAWTEXT(CROSS(90,能量K),90,'有风险'),COLOR00FF00;
DRAWTEXT(CROSS(90,能量K),能量K+13,'●'),COLOR00FF00;
DRAWTEXT(CROSS(能量D,能量K),98,'死叉'),COLORFFCC66;
DRAWTEXT(CROSS(能量D,能量K),90,'●'),COLORFFCC66;
DRAWTEXT(CROSS(能量K,能量D),8,'金叉'),COLORYELLOW;
DRAWTEXT(CROSS(能量K,能量D),15,'●'),COLORYELLOW;
0,pointdot,linethick2,COLORFF00FF;
渐变色源码供参考:
STICKLINE(0 ,0,-1,15,0) ,COLORFF0098;
STICKLINE(10 ,10,0,15,0) ,COLORFF009A;
STICKLINE(20 ,20,10,15,0),COLORFF009C;
STICKLINE(30 ,30,20,15,0),COLORFF009E;
STICKLINE(40 ,40,30,15,0),COLORFF00A0;
STICKLINE(50 ,50,40,15,0),COLORFF00A2;
STICKLINE(60 ,60,50,15,0),COLORFF00A4;
STICKLINE(70 ,70,60,15,0),COLORFF00A6;
STICKLINE(80 ,80,70,15,0),COLORFF00A8;
STICKLINE(90 ,90,80,15,0),COLORFF00AA;
STICKLINE(100 ,100,90,15,0),COLORFF00AC;
STICKLINE(110 ,110,100,15,0),COLORFF00AF;
单色源码供参考:
STICKLINE(CLOSE>0,h*9.0,l*0.01,8,0),color7d7f0f;
K线
STICKLINE(C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=O,C,O,4,0),COLOR7070ff;
STICKLINE(C>=O,C,O,2,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
STICKLINE(C<=O,C,O,4,0),COLORFF6600;
STICKLINE(C<=O,C,O,2,0),colorffcc66;
STICKLINE(C<=O,H,L,0,0),colorffcc66;
副图背景色源码供参考:
STICKLINE(100,0,100,8,0),color7d7f0f;{注意指标的坐标,按不同的坐标做相应的调整,本例是100的坐标