不多说,直接上效果如图:
使用技巧 该指标信号比较多,汇集了试盘K线、区间压力线,起爆K、量化强度评分、金银柱等信号,主图生命线由绿变红为趋势转多信号。当这个指标由绿色变为红色时,它可能是在提示交易者市场趋势正在由下跌转为上涨。 1. 定义了X轴间隔值、Y轴间隔值、起点位X值、起点位Y值等变量。 2. 定义了概念、地域、行业等文本信息,并使用DRAWTEXT_FIX函数在指定位置绘制文本。 3. 计算了涨停板、K线实体、双倍量、倍量0、位置要求等条件,并根据条件生成相应的信号。 4. 使用STICKLINE函数绘制试盘K线、洗盘K线等图形。 5. 计算了生命线、短期阻力位、短期支撑位等指标。 6. 根据一系列条件判断,计算了量化强度分。
下面,我们来看看胜率: 胜率测试 进场条件:信号出现尾盘 平仓条件: 1.盈亏10%平仓,不管赢利还是亏损,达到10%平仓;
2.持仓超过15个交易日直接平仓
胜率:45.94% 出股明细 134涨19跌5平,上涨概率85%; 均值4.4%,中位数2.9%,最小-4.0%,最大23.9%: 同比上证指数136赢22输0平,胜率86% 同比深证成指137赢19输2平,胜率87%; 2.T1-T15尾盘卖 第1日收益为正机率0 第2日收益为正机率0.41 第3日收益为正机率0.44 第4日收益为正机率0.27 第5日收益为正机率0.21 第6日收益为正机率0.19 第7日收益为正机率0.15 第8日收益为正机率0.16 第9日收益为正机率0.16 第10日收益为正机率0.17 第12日收益为正机率0.16 第15日收益为正机率0.15 公式源码 1、主图公式
X间隔值:=0.15; Y间隔值:=0.15; 起点位X值:=X间隔值/10; 起点位Y值:=Y间隔值/10; 概念:=STRCAT('概念: ',GNBLOCK); DRAWTEXT_FIX(C>0,0*起点位X值,0.5*起点位Y值,0,概念),COLORYELLOW; 地域:=STRCAT(DYBLOCK,''); DRAWTEXT_FIX(C>0,0*起点位X值,3.5*起点位Y值,0,地域),COLORWHITE; 行业:=STRCAT(HYBLOCK,''); DRAWTEXT_FIX(C>0,4*起点位X值,3.5*起点位Y值,0,行业),COLORWHITE; LTSZ:=STRCAT(STRCAT('总市值:',CON2STR(FINANCE(41)/100000000,2)),' 亿元'); DRAWTEXT_FIX(C>0,8*起点位X值,3.5*起点位Y值,0,LTSZ),COLORWHITE; 涨停板1:=C=H&&C/REF(C,1)>1.0975&&C/REF(C,1)<1.11&&FINANCE(3)=1; 涨停板2:=C=H&&C/REF(C,1)>1.1985&&C/REF(C,1)<1.21&&FINANCE(3)=3; 涨停板:=涨停板1 OR 涨停板2; K线实体:=ABS(C-O)/REF(C,1); 双倍量:=(V/REF(MA(V,5),1)>=2) OR (V/REF(V,1)>=3); 倍量0:=C>O&&双倍量&&C>EMA(C,13)&&V=HHV(V,6); 倍量:=TFILTER(倍量0,C<O&&H<REF(H,1),1); 位置要求:=L/EMA(C,13)<1.05; SPX0:=H/REF(C,1)>=1.06&&H=HHV(H,6)&&倍量0&&H/C>1.005&&C/REF(C,1)>1.015&&位置要求&&K线实体>0.01 &&FINANCE(3)=1;DRAWTEXT_FIX(C>O,0,0.9,0,'公众号:股指标评测'),COLOR0000FF; SPX1:=H/REF(C,1)>=1.11&&H=HHV(H,6)&&倍量0&&H/C>1.005&&C/REF(C,1)>1.015&&位置要求&&K线实体>0.02 &&FINANCE(3)=3; SPX2:=SPX0 OR SPX1; SPX3:=SPX2&&NOT(EXISTR(SPX2,6,1)); 试盘K线:=FILTER(SPX3,5); STICKLINE(试盘K线,H,L,0,0),COLORFF55FF; STICKLINE(试盘K线,C,O,3.1,0),COLOR880088; STICKLINE(试盘K线,C,O,2.6,0),COLORAA00AA; STICKLINE(试盘K线,C,O,1.9,0),COLORCC00CC; STICKLINE(试盘K线,C,O,1.1,0),COLOREE00EE; STICKLINE(试盘K线,C,O,0.2,0),COLORFF44FF; SPZQ:=BARSLAST(试盘K线); 试盘最高不破:=LAST(H<=REF(H,SPZQ),2,1); 洗盘不破:=COUNT(EMA(C,13)<REF(EMA(C,13),1),SPZQ)<2; 洗盘K00:=C<O&&H<REF(H,1); 洗盘K0:=EXIST(试盘K线,10)&&H<HHV(H,SPZQ+1)&&C>=EMA(C,13)&&L<=REF(C,SPZQ)&&C<O&&COUNT(洗盘K00,SPZQ)<2; 洗盘K:=TFILTER(洗盘K0,试盘K线,1); XPZQ:=BARSLAST(洗盘K); 起爆K0:=EXISTR(试盘K线,10,3)&&C>REF(H,XPZQ)&&L<REF(H,XPZQ)&&EXISTR(洗盘K,SPZQ,1)&&C>O &&洗盘不破&&(H-C)/(C-O)<1&&COUNT(C>REF(H,XPZQ),XPZQ)=1; 起爆K1:=EXISTR(试盘K线,10,2)&&EVERY(C>=EMA(C,13),SPZQ)&&C>REF(H,XPZQ)&&O<REF(H,XPZQ) &&EXISTR(洗盘K,SPZQ,1)&&涨停板&&COUNT(涨停板,10)=1; 起爆K3:=起爆K0 OR 起爆K1; 起爆K:=FILTER(起爆K3,5); STICKLINE(起爆K,O,C,3.1,0),COLOR00AAFF; STICKLINE(起爆K,O,C,2.1,0),COLOR00BBFF; STICKLINE(起爆K,O,C,1.5,0),COLOR00CCFF; STICKLINE(起爆K,O,C,1,0),COLOR00DDFF; STICKLINE(起爆K,O,C,0.6,0),COLOR00EEFF; STICKLINE(起爆K,O,C,0.2,0),COLOR00FFFF; STICKLINE(起爆K,H,L,0,0),COLOR00FFFF; STICKLINE(FILTER(起爆K,5),O,L,0,0),COLORFFFFFF; STICKLINE(FILTER(起爆K,5),O,MAX(O,REF(H,XPZQ)),3.1,0),COLOR555555; STICKLINE(FILTER(起爆K,5),O,MAX(O,REF(H,XPZQ)),2.6,0),COLOR777777; STICKLINE(FILTER(起爆K,5),O,MAX(O,REF(H,XPZQ)),1.9,0),COLOR999999; STICKLINE(FILTER(起爆K,5),O,MAX(O,REF(H,XPZQ)),1.1,0),COLORCCCCCC; STICKLINE(FILTER(起爆K,5),O,MAX(O,REF(H,XPZQ)),0.2,0),COLORFFFFFF; 起涨K0:=H>REF(H,XPZQ)&&H/REF(C,1)>1.03&&C>O&&EXIST(试盘K线,10) &&EXIST(洗盘K,SPZQ)&&C<REF(H,XPZQ)&&NOT(EXIST(起爆K,SPZQ)); 起涨K1:=EXISTR(试盘K线,1,1)&&C>O&&C<REF(H,1)&&C>REF(C,1)&&H<REF(H,1); 起涨K2:=起涨K0 OR 起涨K1; 起涨K:=FILTER(起涨K2,5); STICKLINE(起涨K,H,L,0,0),COLOR0000FF; STICKLINE(起涨K,C,O,3.1,0),COLOR000099; STICKLINE(起涨K,C,O,2,0),COLOR0000BB; STICKLINE(起涨K,C,O,1,0),COLOR0000DD; STICKLINE(起涨K,C,O,0.2,0),COLOR0000FF; 生命线:EMA(C,13),COLORRED,LINETHICK2; IF(生命线<REF(生命线,1),生命线,DRAWNULL), COLORGREEN,LINETHICK2; DRAWTEXT(ISLASTBAR,生命线, '生命线'),COLORWHITE; DRAWTEXT(FILTER(起爆K,10),L*0.98,'↖起爆K'),COLORWHITE; DRAWTEXT(起涨K,L*0.99,'↖起涨K'),COLORWHITE; DRAWTEXT(洗盘K,H*1.01,'↙震仓K'),COLORWHITE; DRAWTEXT(试盘K线&&NOT(起爆K),(C+O)*0.5,'试盘K'),COLORWHITE; KK1:=SUMBARS(洗盘K,1); KK2:=SUMBARS(试盘K线,1); STICKLINE(KK1<10&&KK2<11,REF(H,XPZQ),REF(H,XPZQ),3.1,0),COLORWHITE; SWL:=(EMA(CLOSE,10)*7+EMA(CLOSE,20)*3)/10; SWS:=DMA(EMA(CLOSE,20),MAX(1,100*(SUM(VOL,5)/(3*CAPITAL)))),COLORWHITE,DOTLINE; JRH:=HHV(C,2); JRL:=LLV(C,2); MA3:=MA(CLOSE,3); KMJ:=MA3; YTSL:=(3*CLOSE+LOW+OPEN+HIGH)/6; CTA1:=(CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2)); CTA2:=(REF(CTA1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA3:=(REF(CTA2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA4:=(REF(CTA3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA5:=(REF(CTA4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA6:=(REF(CTA5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA7:=(REF(CTA6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA8:=(REF(CTA7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA9:=(REF(CTA8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTAA:=(REF(CTA9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTAB:=(REF(CTAA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTAC:=(REF(CTAB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTAD:=(CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2)); CTAE:=(REF(CTAD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTAF:=(REF(CTAE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA10:=(REF(CTAF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA11:=(REF(CTA10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA12:=(REF(CTA11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA13:=(REF(CTA12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA14:=(REF(CTA13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA15:=(REF(CTA14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA16:=(REF(CTA15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA17:=(REF(CTA16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2)); CTA18:=(REF(CTA17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2)); CTA19:=((REF(CTAD OR CTAE OR CTAF OR CTA10 OR CTA11 OR CTA12 OR CTA13 OR CTA14 OR CTA15 OR CTA16 OR CTA17 OR CTA18,1)) AND CTA1); CTA1A:=((REF(CTA1 OR CTA2 OR CTA3 OR CTA4 OR CTA5 OR CTA6 OR CTA7 OR CTA8 OR CTA9 OR CTAA OR CTAB OR CTAC,1)) AND CTAD); CTA21:=(REF(CTAD,1) AND KMJ AND KMJ<=REF(KMJ,2))*0+DATE; CTA22:=(REF(CTAD,1) AND KMJ>=REF(KMJ,1) AND KMJ<=REF(KMJ,2))*0+CTA21; CTA23:=REF(CTA13,1) AND KMJ>=REF(KMJ,1) AND KMJ<=REF(KMJ,2)*0; CTA24:=IF(CTA22>1230422,0,1); CTA25:=REF(CTA14,1) AND KMJ<=REF(KMJ,1) AND KMJ>=REF(KMJ,2)*1; CTA26:=REF(CTA15,1) AND KMJ>=REF(KMJ,1) AND KMJ<=REF(KMJ,2)*2; CO:=(C-O); E:=(HIGH+LOW+OPEN+2*CLOSE)/5; 阻力:=2*E-LOW; 支撑:=2*E-HIGH; DRAWTEXT_FIX(C!=0,0.89,0.85,0,STRCAT('短期阻力位:',STRCAT(CON2STR(阻力,2),' '))),COLORFFFF00; DRAWTEXT_FIX(C!=0,0.89,0.95,0,STRCAT('短期支撑位:',STRCAT(CON2STR(支撑,2),' '))),COLORRED; X1:=IF(MA(C,5)>MA(C,10),20,0); X2:=IF(MA(C,20)>MA(C,60),10,0); X3:=IF(KDJ.J>KDJ.K,10,0); X4:=IF(MACD.DIF>MACD.DEA,10,0); X5:=IF(MACD.MACD>0,10,0); X6:=IF(V>MA(V,60),10,0); X7:=IF(WINNER(C)>0.5,10,0); X8:=IF(C/REF(C,1)>1.03,10,0); XX:=X1+X2+X3+X4+X5+X6+X7+X8; DRAWTEXT_FIX(V>O,0.89,0.75,0,STRCAT('量化强度分:',STRCAT(CON2STR(XX,2),' '))),COLOR00AAFF;
2、选股公式
涨停板1:=C=H&&C/REF(C,1)>1.0975&&C/REF(C,1)<1.11&&FINANCE(3)=1; 涨停板2:=C=H&&C/REF(C,1)>1.1985&&C/REF(C,1)<1.21&&FINANCE(3)=3; 涨停板:=涨停板1 OR 涨停板2; K线实体:=ABS(C-O)/REF(C,1); 双倍量:=(V/REF(MA(V,5),1)>=2) OR (V/REF(V,1)>=3); 倍量0:=C>O&&双倍量&&C>EMA(C,13)&&V=HHV(V,6); 倍量:=TFILTER(倍量0,C<O&&H<REF(H,1),1); 位置要求:=L/EMA(C,13)<1.05; SPX0:=H/REF(C,1)>=1.06&&H=HHV(H,6)&&倍量0&&H/C>1.005&&C/REF(C,1)>1.015&&位置要求&&K线实体>0.01 &&FINANCE(3)=1; SPX1:=H/REF(C,1)>=1.11&&H=HHV(H,6)&&倍量0&&H/C>1.005&&C/REF(C,1)>1.015&&位置要求&&K线实体>0.02 &&FINANCE(3)=3; SPX2:=SPX0 OR SPX1; SPX3:=SPX2&&NOT(EXISTR(SPX2,6,1)); 试盘K线:=FILTER(SPX3,5); SPZQ:=BARSLAST(试盘K线); 试盘最高不破:=LAST(H<=REF(H,SPZQ),2,1); 洗盘不破:=COUNT(EMA(C,13)<REF(EMA(C,13),1),SPZQ)<2; 洗盘K00:=C<O&&H<REF(H,1); 洗盘K0:=EXIST(试盘K线,10)&&H<HHV(H,SPZQ+1)&&C>=EMA(C,13)&&L<=REF(C,SPZQ)&&C<O&&COUNT(洗盘K00,SPZQ)<2; 洗盘K:=TFILTER(洗盘K0,试盘K线,1); XPZQ:=BARSLAST(洗盘K); 起爆K0:=EXISTR(试盘K线,10,3)&&C>REF(H,XPZQ)&&L<REF(H,XPZQ)&&EXISTR(洗盘K,SPZQ,1)&&C>O &&洗盘不破&&(H-C)/(C-O)<1&&COUNT(C>REF(H,XPZQ),XPZQ)=1; 起爆K1:=EXISTR(试盘K线,10,2)&&EVERY(C>=EMA(C,13),SPZQ)&&C>REF(H,XPZQ)&&O<REF(H,XPZQ) &&EXISTR(洗盘K,SPZQ,1)&&涨停板&&COUNT(涨停板,10)=1; 起爆K3:=起爆K0 OR 起爆K1; 起爆K:=FILTER(起爆K3,5); XG:试盘K线&&NOT(起爆K);
|