您现在的位置:程序化交易>> 股票公式>> 同花顺>> 同花顺公式>>正文内容

不同的颜色在K线上标识涨跌停公式源码[同花顺公式]

相关标签:

 

用不同的颜色把涨跌停板用不同的颜色在K线上标识。用法:在主图使用,自动添加均线5 10 20 30 60 120 240 360,后面3条均线不显示提醒顶底分型

 

原理解析:


 

 来源:程序化99( WWW.CXH99.COM )

源码:

 

VERLINE(HOUR<REF(HOUR,1),2),COLOR666666;C2:=REF(C,1);涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);STICKLINE(涨停,OPEN,CLOSE,10,0),coloryellow;STICKLINE(涨停,H,L,0,0),coloryellow;跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);STICKLINE(跌停,OPEN,CLOSE,10,0),colorgreen;STICKLINE(跌停,H,L,10,0),colorgreen;//MID : MA(CLOSE,26);//UPPER: MID + 2*STD(CLOSE,26);//LOWER: MID - 2*STD(CLOSE,26);//STICKLINE(1,H,L,1,0),colorliblue;//{笔底分型 选股预警 确保向下笔成立后的底分型}V00:= HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);V01:= HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);V02:= HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);V03:= HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);V04:= REF(HIGH,2) < HIGH AND REF(LOW,2) < LOWAND REF(HIGH,2) > REF(HIGH,1) AND REF(LOW,2) < REF(LOW,1);V1:= COUNT(V00,6)>=3 AND COUNT(V01 OR V02,5)=0 AND LLVBARS(LOW,6) = 1 AND HHVBARS(HIGH,6) >= 5 AND V03;V2:= COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7) = 2 AND HHVBARS(HIGH,7) >= 6 AND V04;V3:= COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7) = 1 AND HHVBARS(HIGH,7) >= 6 AND V03;V4:= COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8) = 2 AND HHVBARS(HIGH,8) >= 7 AND V04;V5:= COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8) = 1 AND HHVBARS(HIGH,8) >= 7 AND V03;V6:= COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9) = 2 AND HHVBARS(HIGH,9) >= 8 AND V04;V7:= COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9) = 1 AND HHVBARS(HIGH,9) >= 8 AND V03;V8:= COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10) = 2 AND HHVBARS (HIGH,10) >= 9 AND V04;V9:= COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10) = 1 AND HHVBARS (HIGH,10) >= 9 AND V03;V10:= COUNT(V00,11)>=3 AND COUNT(V01 OR V02,10)<=5 AND LLVBARS(LOW,11) = 2 AND HHVBARS (HIGH,11) >= 10 AND V04;XG:= V1 OR V2 OR V3 OR V4 OR V5 OR V6 OR V7 OR V8 OR V9 OR V10;DRAWTEXT(FILTER(XG=1,5),L*0.998,'底分型'),coloryellow;//{笔顶分型 选股 预警 确保向上笔成立后的顶分型}HV00:= HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);HV01:= HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);HV02:= HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);HV03:= HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);HV04:= REF(HIGH,2) > HIGH AND REF(LOW,2) > LOW AND REF(HIGH,2) > REF(HIGH,1) AND REF(LOW,2) < REF(LOW,1);HV1:= COUNT(HV00,6)>=3 AND COUNT(HV01 OR HV02,5)=0 AND HHVBARS(HIGH,6) = 1 AND LLVBARS (LOW,6) >= 5 AND HV03;HV2:= COUNT(HV00,7)>=3 AND COUNT(HV01 OR HV02,6)=1 AND HHVBARS(HIGH,7) = 2 AND LLVBARS (LOW,7) >= 6 AND HV04;HV3:= COUNT(HV00,7)>=3 AND COUNT(HV01 OR HV02,6)=1 AND HHVBARS(HIGH,7) = 1 AND LLVBARS (LOW,7) >= 6 AND HV03;HV4:= COUNT(HV00,8)>=3 AND COUNT(HV01 OR HV02,7)<=2 AND HHVBARS(HIGH,8) = 2 AND LLVBARS (LOW,8) >= 7 AND HV04;HV5:= COUNT(HV00,8)>=3 AND COUNT(HV01 OR HV02,7)<=2 AND HHVBARS(HIGH,8) = 1 AND LLVBARS (LOW,8) >= 7 AND HV03;HV6:= COUNT(HV00,9)>=3 AND COUNT(HV01 OR HV02,8)<=3 AND HHVBARS(HIGH,9) = 2 AND LLVBARS (LOW,9) >= 8 AND HV04;HV7:= COUNT(HV00,9)>=3 AND COUNT(HV01 OR HV02,8)<=3 AND HHVBARS(HIGH,9) = 1 AND LLVBARS (LOW,9) >= 8 AND HV03;HV8:= COUNT(HV00,10)>=3 AND COUNT(HV01 OR HV02,9)<=4 AND HHVBARS(HIGH,10) = 2 AND LLVBARS (LOW,10) >= 9 AND HV04;HV9:= COUNT(HV00,10)>=3 AND COUNT(HV01 OR HV02,9)<=4 AND HHVBARS(HIGH,10) = 1 AND LLVBARS (LOW,10) >= 9 AND HV03;HV10:= COUNT(HV00,11)>=3 AND COUNT(HV01 OR HV02,10)<=5 AND HHVBARS(HIGH,11) = 2 AND LLVBARS (LOW,11) >= 10 AND HV04;HXG:=HV1 OR HV2 OR HV3 OR HV4 OR HV5 OR HV6 OR HV7 OR HV8 OR HV9 OR HV10;DRAWTEXT(FILTER(HXG=1,3),H*1.01,'顶分型'),colorgreen;IF (k<=0)RETURN 0;MA$1:MA(CLOSE, N1),colorwhite;IF (k<=1)RETURN 0;MA$2:MA(CLOSE, N2),coloryellow;IF (k<=2)RETURN 0;MA$3:MA(CLOSE, N3),colormagenta;IF (k<=3)RETURN 0;MA$4:MA(CLOSE, N4),colorgreen;IF (k<=4)RETURN 0;MA$5:MA(CLOSE, N5),colorcyan;IF (k<=5)RETURN 0;MA$6:MA(CLOSE, N6),colorred;IF (k<=6)RETURN 0;MA$7:MA(CLOSE, N7);IF (k<=7)RETURN 0;MA$8:MA(CLOSE, N8);//基于k线买卖提醒,5日线突破13日线且收盘大于5日线购买点提醒:=IF(CROSS(REF(EMA(C,N1),1),REF(EMA(C,N2),1)) AND C>EMA(C,N1),1,0);//DRAWICON(购买点提醒,MA$5*0.95,"buy");DRAWTEXT(购买点提醒,L*0.998,'buy'),coloryellow;
TIPTEXT(ISNULL(REFX(&CLOSE,1)),0,' WWW.CXH99.COM '),colorred;
TIPTEXT(ISNULL(REF(CLOSE,1)),0,'同花顺程序化交易');

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 1145508240  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容