半年线: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(\Var11:=CROSS(REF(\REF(\
Var12:=CROSS(REF(\REF(\Var13:=Var10 OR Var11 OR Var12; Var14:=REF(\
Var15:=REF(\
REF(\卖出:=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;
AND AND AND
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的坐标
第七讲:均线(选股)的基本形态
提示:K线的初步平均。(O+H+L+C*2)/5; 或 (H+L+C*2)/4;
一般认为:收盘价是最有说服力的和最有价值的,它是每天激烈争夺的最后妥协。但也有人认为:收盘价固然重要,其他价格也是争夺的产物。所以将全天的几种价格因素都考虑进去更能反映每天的真实情况。
1、最简单的指标线
(1)均价线 就是 移动平均线MA,“MA”表示的就是计算平均值。
MA1=MA(CLOSE,5);5日平均线=(今天收盘价+昨天收盘价+.....--5天前的收盘价)/5;
MA2=MA(CLOSE,10);10日平均线=(今天收盘价+昨天收盘价+......+10天前的收盘价)/10;
(2)均量线 均价线会了,照着葫芦画瓢,把收盘价CLOSE换成成交量VOL就行了!
例:MA1:MA(VOL,5); MA2:MA(VOL,10);
2、再次平均 指将已有的均线(多条均线)相加后进行再平均。 MA1=MA(CLOSE,5); MA2=MA(CLOSE,10); (MA1+MA2)/2;
3、N日均线向上 (本题反映均线波浪式延伸过程中某阶段的形态。) AA:=MA(C,N); BB:=REF(AA,1); AA>BB
均线向下呢? AA< BB 就可以了。 N日均线走平怎么表述?AA=BB
4、均线由下跌状态刚刚转为上升
AA:=MA(C,N);
COUNT(AAREF(AA,5);
5、年线拐头向上 A250:=MA(C,250);
REF(A250,1)REF(A250,1);
6、两条均线交叉
股软中专门设定了一条函数来描述两条线交叉:CROSS(X,Y) ,此函数通用。 假如两条均线一条名叫X,另外一条叫Y 且(X<Y) CROSS(X,Y)表示X向上穿过了Y 通称:金叉 CROSS(Y,X)表示Y向上穿过了X 通称:死叉
特别提示:交叉有两种,一种是向上交叉,另一种是向下交叉。如果要求向上交叉时,X线必须比前一天高,所以需要加上 X>REF(X,1) 。完整的表达式为:CROSS(X,Y)AND X>REF(X,1)