通达信系统指标公式并非闲人编辑整理
2016年4月
1
目 录
目录 ....................................................................................................................................................... 2
第一章 技术指标公式 ......................................................................................................................................... 1
第一节 大势型 ............................................................................................................................................. 1 第二节 超买超卖型 ..................................................................................................................................... 3 第三节 趋势型 ............................................................................................................................................. 9 第四节 能量型 ........................................................................................................................................... 14 第五节 成交量型 ....................................................................................................................................... 16 第六节 均线型 ........................................................................................................................................... 19 第七节 图表型 ........................................................................................................................................... 22 第八节 路径型 ........................................................................................................................................... 23 第九节 停损型 ........................................................................................................................................... 25 第十节 策略型 ........................................................................................................................................... 25 第十一节 神系 ........................................................................................................................................... 28 第十二节 龙系 ........................................................................................................................................... 30 第十三节 鬼系 ........................................................................................................................................... 32 第十四节 其他系 ....................................................................................................................................... 32 第十五节 特色型 ....................................................................................................................................... 37 第二章 条件选股公式 ....................................................................................................................................... 44
第一节 指标条件选股 ............................................................................................................................... 44 第二节 基本面选股 ................................................................................................................................... 49 第三节 即时盘中选股 ............................................................................................................................... 50 第四节 走势特征选股 ............................................................................................................................... 51 第五节 形态特征选股 ............................................................................................................................... 57 第三章 专家系统公式 ....................................................................................................................................... 62 第四章 五彩K线公式 ...................................................................................................................................... 66
2
通达信系统指标公式
第一章 技术指标公式
第一节 大势型
ABI 绝对广量指标
ABI:100*ABS(ADVANCE-DECLINE)/(ADVANCE+DECLINE); MAABI:EMA(ABI,M);
ADL 腾落指标
ADL:SUM(ADVANCE-DECLINE,0); MAADL:MA(ADL,M);
ADR 涨跌比率
ADR:SUM(ADVANCE,N)/SUM(DECLINE,N); MAADR:MA(ADR,M);
1
ARMS 阿姆氏指标
ARMS:EMA(ADVANCE/DECLINE,N); MAARMS:MA(ARMS,M);
BTI 广量冲力指标
BTI:EMA(100*ADVANCE/(ADVANCE+DECLINE),N); MABTI:MA(BTI,M);
MCL 麦克连指标
DIF:=ADVANCE-DECLINE; EMA1:=EMA(DIF,N1); EMA2:=EMA(DIF,N2); MCL:EMA1-EMA2; MAMCL1:EMA1; MAMCL2:EMA2;
MSI 麦氏综合指标(加密)
OBOS 超买超卖指标
OBOS:EMA(ADVANCE-DECLINE,N); MAOBOS:MA(OBOS,M);
2
STIX 指数平滑广量
TBR:100*ADVANCE/(ADVANCE+DECLINE); MATBR:EMA(TBR,M);
第二节 超买超卖型
CCI 商品路径指标
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));
KDJ 随机指标KDJ
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1); D:SMA(K,M2,1); J:3*K-2*D;
MFI 资金流量指标
TYP := (HIGH + LOW + CLOSE)/3;
V1:=SUM(IF(TYP>REF(TYP,1),TYP*VOL,0),N)/SUM(IF(TYP 3 MFI:100-(100/(1+V1)); MTM 动量线 MTM:CLOSE-REF(CLOSE,N); MTMMA:MA(MTM,M); OSC 变动速率线 OSC:100*(CLOSE-MA(CLOSE,N)); MAOSC:EXPMEMA(OSC,M); RSI 相对强弱指标 LC:=REF(CLOSE,1); RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100; RSI2:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100; RSI3:SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100; MARSI 相对强弱平均线 DIF:=CLOSE-REF(CLOSE,1); VU:=IF(DIF>=0,DIF,0); VD:=IF(DIF<0,-DIF,0); 4 MAU1:=MEMA(VU,M1); MAD1:=MEMA(VD,M1); MAU2:=MEMA(VU,M2); MAD2:=MEMA(VD,M2); RSI10:MA(100*MAU1/(MAU1+MAD1),M1); RSI6:MA(100*MAU2/(MAU2+MAD2),M2); KD 随机指标KD RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1); D:SMA(K,M2,1); SKDJ 慢速随机指标 LOWV:=LLV(LOW,N); HIGHV:=HHV(HIGH,N); RSV:=EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,M); K:EMA(RSV,M); D:MA(K,M); UDL 引力线 UDL:(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4; MAUDL:MA(UDL,M); 5 WR 威廉指标 WR1:100*(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N)); WR2:100*(HHV(HIGH,N1)-CLOSE)/(HHV(HIGH,N1)-LLV(LOW,N1)); LWR 慢速威廉指标 RSV:= (HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N))*100; LWR1:SMA(RSV,M1,1); LWR2:SMA(LWR1,M2,1); BIAS-QL 乖离率-传统版 BIAS :(CLOSE-MA(CLOSE,N))/MA(CLOSE,N)*100; BIASMA :MA(BIAS,M); BIAS 乖离率 BIAS1 :(CLOSE-MA(CLOSE,N1))/MA(CLOSE,N1)*100; BIAS2 :(CLOSE-MA(CLOSE,N2))/MA(CLOSE,N2)*100; BIAS3 :(CLOSE-MA(CLOSE,N3))/MA(CLOSE,N3)*100; 6 BIAS36 三六乖离 BIAS36:MA(CLOSE,3)-MA(CLOSE,6); BIAS612:MA(CLOSE,6)-MA(CLOSE,12); MABIAS:MA(BIAS36,M); ACCER 幅度涨速 ACCER:SLOPE(CLOSE,N)/CLOSE; CYD 承接因子 CYDS:WINNER(CLOSE)/(VOL/CAPITAL); CYDN:WINNER(CLOSE)/MA(VOL/CAPITAL,N); CYF 市场能量 CYF:100-100/(1+EMA(HSL,N)); 7 FSL 分水岭 SWL:(EMA(CLOSE,5)*7+EMA(CLOSE,10)*3)/10; SWS:DMA(EMA(CLOSE,12),MAX(1,100*(SUM(VOL,5)/(3*CAPITAL)))); ADTM 动态买卖气指标 DTM:=IF(OPEN<=REF(OPEN,1),0,MAX((HIGH-OPEN),(OPEN-REF(OPEN,1)))); DBM:=IF(OPEN>=REF(OPEN,1),0,MAX((OPEN-LOW),(OPEN-REF(OPEN,1)))); STM:=SUM(DTM,N); SBM:=SUM(DBM,N); ADTM:IF(STM>SBM,(STM-SBM)/STM,IF(STM=SBM,0,(STM-SBM)/SBM)); MAADTM:MA(ADTM,M); ATR 真实波幅 MTR:MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW)); ATR:MA(MTR,N); DKX多空线 MID:=(3*CLOSE+LOW+OPEN+HIGH)/6; DKX:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+ 16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+ 13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+ 10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+ 7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+ 4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210; MADKX:MA(DKX,M); 8 TAPI 加权指数成交值(需下载日线) TAPI:AMOUNT/INDEXC; MATAIP:MA(TAPI,M); 第三节 趋势型 ASI 振动升降指标(加密) CHO 佳庆指标 MID:=SUM(VOL*(2*CLOSE-HIGH-LOW)/(HIGH+LOW),0); CHO:MA(MID,N1)-MA(MID,N2); MACHO:MA(CHO,M); DMA 平均差 DIF:MA(CLOSE,N1)-MA(CLOSE,N2); DIFMA:MA(DIF,M); 9 DMI 趋向指标 MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N); HD :=HIGH-REF(HIGH,1); LD :=REF(LOW,1)-LOW; DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N); DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N); PDI: DMP*100/MTR; MDI: DMM*100/MTR; ADX: EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,MM); ADXR:EXPMEMA(ADX,MM); DPO 区间震荡线 DPO:CLOSE-REF(MA(CLOSE,N),N/2+1); MADPO:MA(DPO,M); EMV 简易波动指标 VOLUME:=MA(VOL,N)/VOL; MID:=100*(HIGH+LOW-REF(HIGH+LOW,1))/(HIGH+LOW); EMV:MA(MID*VOLUME*(HIGH-LOW)/MA(HIGH-LOW,N),N); MAEMV:MA(EMV,M); MACD 平滑异同平均 DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG); DEA:EMA(DIF,MID); 10 MACD:(DIF-DEA)*2,COLORSTICK; VMACD 量平滑异同平均 DIF:EMA(VOL,SHORT)-EMA(VOL,LONG); DEA:EMA(DIF,MID); MACD:DIF-DEA,COLORSTICK; QACD 快速异同平均 DIF:EMA(CLOSE,N1)-EMA(CLOSE,N2); MACD:EMA(DIF,M); DDIF:DIF-MACD; TRIX 三重指数平均线 MTR:=EMA(EMA(EMA(CLOSE,N),N),N); TRIX:(MTR-REF(MTR,1))/REF(MTR,1)*100; MATRIX:MA(TRIX,M) ; UOS 终极指标 TH:=MAX(HIGH,REF(CLOSE,1)); TL:=MIN(LOW,REF(CLOSE,1)); 11 ACC1:=SUM(CLOSE-TL,N1)/SUM(TH-TL,N1); ACC2:=SUM(CLOSE-TL,N2)/SUM(TH-TL,N2); ACC3:=SUM(CLOSE-TL,N3)/SUM(TH-TL,N3); UOS:(ACC1*N2*N3+ACC2*N1*N3+ACC3*N1*N2)*100/(N1*N2+N1*N3+N2*N3); MAUOS:EXPMEMA(UOS,M); VPT 量价曲线 VPT:SUM(VOL*(CLOSE-REF(CLOSE,1))/REF(CLOSE,1),N); MAVPT:MA(VPT,M); WVAD 威廉变异离散量 WVAD:SUM((CLOSE-OPEN)/(HIGH-LOW)*VOL,N)/10000; MAWVAD:MA(WVAD,M); PAV 筹码引力(加密) DBQR 对比强弱 ZS:(INDEXC-REF(INDEXC,N))/REF(INDEXC,N); GG:(CLOSE-REF(CLOSE,N))/REF(CLOSE,N); MADBQR1:MA(GG,M1); MADBQR2:MA(GG,M2); MADBQR3:MA(GG,M3); 12 JS 加速线 JS:100*(CLOSE-REF(CLOSE,N))/(N*REF(CLOSE,N)); MAJS1:MA(JS,M1); MAJS2:MA(JS,M2); MAJS3:MA(JS,M3); PAVE 强筹码引力(加密) CYE 市场趋势 MAL:=MA(CLOSE,5); MAS:=MA(MA(CLOSE,20),5); CYEL:(MAL-REF(MAL,1))/REF(MAL,1)*100; CYES:(MAS-REF(MAS,1))/REF(MAS,1)*100; QR 强弱 个股: (CLOSE-REF(CLOSE,N))/REF(CLOSE,N)*100; 大盘: (INDEXC-REF(INDEXC,N))/REF(INDEXC,N)*100; 强弱值:EMA(个股-大盘,2),COLORSTICK; GDX 鬼道线 AA:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,N))/MA(CLOSE,N); JAX:DMA(CLOSE,AA); 压力线:(1+M/100)*JAX; 支撑线:(1-M/100)*JAX; 13 JLHB 绝路航标 VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80; B:SMA(VAR1,N,1); VAR2:SMA(B,M,1); 绝路航标:IF(CROSS(B,VAR2) AND B<40,50,0); 第四节 能量型 BRAR 情绪指标 BR:SUM(MAX(0,HIGH-REF(CLOSE,1)),N)/SUM(MAX(0,REF(CLOSE,1)-LOW),N)*100; AR:SUM(HIGH-OPEN,N)/SUM(OPEN-LOW,N)*100; CR 带状能量线 MID:=REF(HIGH+LOW,1)/2; CR:SUM(MAX(0,HIGH-MID),N)/SUM(MAX(0,MID-LOW),N)*100; MA1:REF(MA(CR,M1),M1/2.5+1); MA2:REF(MA(CR,M2),M2/2.5+1); MA3:REF(MA(CR,M3),M3/2.5+1); MA4:REF(MA(CR,M4),M4/2.5+1); 14 MASS 梅斯线 MASS:SUM(MA(HIGH-LOW,N1)/MA(MA(HIGH-LOW,N1),N1),N2); MAMASS:MA(MASS,M); PSY 心理线 PSY:COUNT(CLOSE>REF(CLOSE,1),N)/N*100; PSYMA:MA(PSY,M); VR 成交量变异率 TH:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,0),N); TL:=SUM(IF(CLOSE WAD 威廉多空力度线 MIDA:=CLOSE-MIN(REF(CLOSE,1),LOW); MIDB:=IF(CLOSEREF(CLOSE,1),MIDA,MIDB),0); MAWAD:MA(WAD,M); 15 PCNT 幅度比 PCNT:(CLOSE-REF(CLOSE,1))/CLOSE*100; MAPCNT:EXPMEMA(PCNT,M); CYR 市场强弱 DIVE:=0.01*EMA(AMOUNT,N)/EMA(VOL,N); CYR:(DIVE/REF(DIVE,1)-1)*100; MACYR:MA(CYR,M); NVI 负成交量(加密) PVI 正成交量(加密) 第五节 成交量型 AMO 成交金额 AMO:AMOUNT,VOLSTICK; MAAMO1:MA(AMO,M1); MAAMO2:MA(AMO,M2); MAAMO3:MA(AMO,M3); 16 OBV 累积能量线 VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL); OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0); MAOBV:MA(OBV,M); VOL 成交量 VOLUME:VOL,VOLSTICK; MAVOL1:MA(VOLUME,M1); MAVOL2:MA(VOLUME,M2); VOL-TDX 成交量(盘中虚拟) TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,TOTALFZNUM,1))))); MTIME:=MOD(FROMOPEN,TOTAL); CTIME:=IF(MTIME<0.5,TOTAL,MTIME); VVOL:IF((CURRBARSCOUNT=1 AND DYNAINFO(8)>1),VOL*TOTAL/CTIME,DRAWNULL),NODRAW; STICKLINE((CURRBARSCOUNT=1 AND DYNAINFO(8)>1),VVOL,0,-1,-1),COLOR00C0C0; VOLUME:VOL,VOLSTICK; MAVOL1:MA(VOLUME,M1); MAVOL2:MA(VOLUME,M2); CCL 持仓量(适用于期货) 持仓量:VOLINSTK; MACCL:MA(持仓量,M); 17 SHORTVOL 抛空量(适用于港股) 抛空量:HKSHORTVOL,VOLSTICK; MACCL:MA(抛空量,M); VRSI 相对强弱量 LC:=REF(VOL,1); RSI1:SMA(MAX(VOL-LC,0),N1,1)/SMA(ABS(VOL-LC),N1,1)*100; RSI2:SMA(MAX(VOL-LC,0),N2,1)/SMA(ABS(VOL-LC),N2,1)*100; RSI3:SMA(MAX(VOL-LC,0),N3,1)/SMA(ABS(VOL-LC),N3,1)*100; HSL 换手线 HSL:100*VOL/(FINANCE(7)/100); MAHSL:MA(HSL,N); HSCOL 换手柱 HSCOL:100*VOL/(FINANCE(7)/100),VOLSTICK; MAHSL:MA(HSCOL,N); 18 DBQRV 对比强弱量 ZS:(INDEXV-REF(INDEXV,N))/REF(INDEXV,N); GG:(VOL-REF(VOL,N))/REF(VOL,N); DBLB 对比量比 GG:=VOL/SUM(REF(VOL,1),N); ZS:=INDEXV/SUM(REF(INDEXV,1),N); DBLB:GG/ZS; MADBLB:MA(DBLB,M); 第六节 均线型 MA 均线 MA1:MA(CLOSE,M1); MA2:MA(CLOSE,M2); MA3:MA(CLOSE,M3); MA4:MA(CLOSE,M4); 19 MA2 均线 MA1:MA(CLOSE,M1); MA2:MA(CLOSE,M2); MA3:MA(CLOSE,M3); MA4:MA(CLOSE,M4); MA5:MA(CLOSE,M5); MA6:MA(CLOSE,M6); MA7:MA(CLOSE,M7); MA8:MA(CLOSE,M8); MA9:MA(CLOSE,M9); MA10:MA(CLOSE,M10); ACD 升降线 LC:=REF(CLOSE,1); DIF:=CLOSE-IF(CLOSE>LC,MIN(LOW,LC),MAX(HIGH,LC)); ACD:SUM(IF(CLOSE=LC,0,DIF),0); MAACD:EXPMEMA(ACD,M); BBI 多空指标 BBI:(MA(CLOSE,M1)+MA(CLOSE,M2)+MA(CLOSE,M3)+MA(CLOSE,M4))/4; EXPMA 指数平均线 EXP1:EMA(CLOSE,M1); EXP2:EMA(CLOSE,M2); 20 EXPMA-S 指数平均线-副图 EXP1:EMA(CLOSE,M1); EXP2:EMA(CLOSE,M2); HMA 高价平均线 HMA1:MA(HIGH,M1); HMA2:MA(HIGH,M2); HMA3:MA(HIGH,M3); HMA4:MA(HIGH,M4); HMA5:MA(HIGH,M5); LMA 低价平均线 LMA1:MA(LOW,M1); LMA2:MA(LOW,M2); LMA3:MA(LOW,M3); LMA4:MA(LOW,M4); LMA5:MA(LOW,M5); VMA 变异平均线 VV:=(HIGH+OPEN+LOW+CLOSE)/4; VMA1:MA(VV,M1); VMA2:MA(VV,M2); VMA3:MA(VV,M3); VMA4:MA(VV,M4); VMA5:MA(VV,M5); 21 AMA 成本价均线 AMOV:=VOL*(OPEN+CLOSE)/2; AMV1:SUM(AMOV,M1)/SUM(VOL,M1); AMV2:SUM(AMOV,M2)/SUM(VOL,M2); AMV3:SUM(AMOV,M3)/SUM(VOL,M3); AMV4:SUM(AMOV,M4)/SUM(VOL,M4); MCST 市场成本 BBIBOLL 多空布林线 CV:=CLOSE; BBIBOLL:(MA(CV,3)+MA(CV,6)+MA(CV,12)+MA(CV,24))/4; UPR:BBIBOLL+M*STD(BBIBOLL,N); DWN:BBIBOLL-M*STD(BBIBOLL,N); 第七节 图表型 ZXNH 直线拟合(加密) ZX 重心线 AV:0.01*AMOUNT/VOL; 22 PUCU 逆时钟曲线 PU:MA(CLOSE,N); CU:MA(VOL,N); 第八节 路径型 BOLL-M 布林线-主图叠加 BOLL 布林线 BOLL:MA(CLOSE,N); UB:BOLL+2*STD(CLOSE,N); LB:BOLL-2*STD(CLOSE,N); PXB 瀑布线 PBX1:(EMA(CLOSE,M1)+MA(CLOSE,M1*2)+MA(CLOSE,M1*4))/3; PBX2:(EMA(CLOSE,M2)+MA(CLOSE,M2*2)+MA(CLOSE,M2*4))/3; PBX3:(EMA(CLOSE,M3)+MA(CLOSE,M3*2)+MA(CLOSE,M3*4))/3; PBX4:(EMA(CLOSE,M4)+MA(CLOSE,M4*2)+MA(CLOSE,M4*4))/3; PBX5:(EMA(CLOSE,M5)+MA(CLOSE,M5*2)+MA(CLOSE,M5*4))/3; PBX6:(EMA(CLOSE,M6)+MA(CLOSE,M6*2)+MA(CLOSE,M6*4))/3; 23 EXE 轨道线 UPPER:(1+M1/100)*MA(CLOSE,N); LOWER:(1-M2/100)*MA(CLOSE,N); ENE:(UPPER+LOWER)/2; MIKE 麦克支撑压力 HLC:=REF(MA((HIGH+LOW+CLOSE)/3,N),1); HV:=EMA(HHV(HIGH,N),3); LV:=EMA(LLV(LOW,N),3); STOR:EMA(2*HV-LV,3); MIDR:EMA(HLC+HV-LV,3); WEKR:EMA(HLC*2-LV,3); WEKS:EMA(HLC*2-HV,3); MIDS:EMA(HLC-HV+LV,3); STOS:EMA(2*LV-HV,3); SSRP 筹码峰(加密) XS 薛斯通道(加密) XS2 薛斯通道Ⅱ AA:=MA((2*CLOSE+HIGH+LOW)/4,5); 通道1:AA*N/100; 通道2:AA*(200-N)/100; CC:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20); DD:=DMA(CLOSE,CC); 通道3:(1+M/100)*DD; 通道4:(1-M/100)*DD; 24 第九节 停损型 SAR 抛物线指标(加密) TDXWAVE 通达信趋势浪(加密) VTY 价格变异率(加密) 第十节 策略型 MA策略 MA交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} {变量赋值} MA1:=MA(CLOSE,SHORT); MA2:=MA(CLOSE,LONG); {交易条件} 平空开多:=CROSS(MA1,MA2); 平多开空:=CROSS(MA2,MA1); {交易系统} BUYSHORT_BUY(平空开多,LOW); SELL_SELLSHORT(平多开空,HIGH); {交易信号过滤} AUTOFILTER; MACD策略 MACD交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} DIFF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG); DEA:=EMA(DIFF,MID); 25 MACD:=2*(DIFF-DEA); 平空开多:=CROSS(MACD,0); 平多开空:=CROSS(0,MACD); BUYSHORT_BUY(平空开多,LOW); SELL_SELLSHORT(平多开空,HIGH); AUTOFILTER; KDJ策略 KDJ交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:=SMA(RSV,M1,1); D:=SMA(K,M1,1); J:=3*K-2*D; 平空开多:=CROSS(J,0); 平多开空:=CROSS(100,J); BUYSHORT_BUY(平空开多,LOW); SELL_SELLSHORT(平多开空,HIGH); AUTOFILTER; 肯特纳 肯特纳通道交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} MA1:=REF(MA((HIGH+LOW+CLOSE)/3,AVGLENGTH),1); UPPERBAND:=MA1+REF(MA(TR,ATRLENGTH),1); LOWERBAND:=MA1-REF(MA(TR,ATRLENGTH),1); 开多条件:=MA1>REF(MA1,1) AND HIGH>=UPPERBAND; 平多条件:=LOW<=MA1; 开空条件:=MA1=MA1; GL1:=NOT(开多条件=1 AND 平多条件=1); GL2:=NOT(开空条件=1 AND 平空条件=1); SELL(平多条件,HIGH); BUYSHORT(平空条件,LOW); BUY(开多条件 AND GL1,LOW); 26 SELLSHORT(开空条件 AND GL2,HIGH); AUTOFILTER; 唐奇安 唐奇安通道交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} 周期高点:=REF(HHV(H,X1),1); 周期低点:=REF(LLV(L,X2),1); 平空开多:=HIGH>=周期高点; 平多开空:=LOW<=周期低点; BUYSHORT_BUY(平空开多,LOW); SELL_SELLSHORT(平多开空,HIGH); AUTOFILTER; 日内突破 日内突破交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} {变量赋值} NBAR:=BARSLAST(DATE<>REF(DATE,1))+1; HHN:REF(HHV(H,N),1); LLN:REF(LLV(L,N),1); MID:(HHN+LLN)/2; T1:=TIME>900 AND TIME <1455;{根据品种的交易时间和选择的周期做相应调整} T2:=TIME>=1455;{根据品种的交易时间和选择的周期做相应调整} {交易条件} 开多条件:=H>HHN AND (HHN-MID)/MID BUY(开多条件,LOW); SELLSHORT(开空条件,HIGH); SELL(T2,HIGH); BUYSHORT(T2,LOW); AUTOFILTER; 27 HANS123 日内HANS交易策略 {该模型为示范模型,仅用于说明算法语法,用户需根据自己交易经验修改后再实际应用} {变量赋值} N:=BARSLAST(DATE<>REF(DATE,1))+1; HHH:=VALUEWHEN(TIME<=900+NMIN1,HHV(H,N)); LLL:=VALUEWHEN(TIME<=900+NMIN1,LLV(L,N)); 上轨:HHH+M*MINDIFF; 下轨:LLL-M*MINDIFF; {交易条件} 开多条件:=C>上轨; 开空条件:=C<下轨; 交易时间:=TIME>900+NMIN1 AND TIME<1450; 平仓时间:=TIME>=1500-NMIN2; {交易系统} BUY(开多条件 AND 交易时间,LOW); SELLSHORT(开空条件 AND 交易时间,HIGH); SELL(平仓时间,HIGH); BUYSHORT(平仓时间,LOW); AUTOFILTER; 第十一节 神系 SG-XDT 心电图(需下载日线) QR:CLOSE/INDEXC*1000; MQR1:MA(QR,5); MQR2:MA(QR,10); 28 SG-NDB 脑电波 HH:=IF(C/REF(C,1)>1.093 AND L>REF(H,1),2*C-REF(C,1)-H,2*C-H-L); V1:=BARSCOUNT(C); V2:=2*REF(C,V1)-REF(H,V1)-REF(L,V1); DK:SUM(HH,0)+V2; MDK5:MA(DK,P1); MDK10:MA(DK,P2); SG-SMX 生命线(需下载日线) H1:=HHV(HIGH,N); L1:=LLV(LOW,N); H2:=HHV(INDEXH,N); L2:=LLV(INDEXL,N); ZY:=CLOSE/INDEXC*2000; ZY1:EMA(ZY,3); ZY2:EMA(ZY,17); ZY3:EMA(ZY,34); SG-LB 量比(需下载日线) ZY2:=VOL/INDEXV*1000; 量比:ZY2; MA5:MA(ZY2,5); MA10:MA(ZY2,10); 29 SG-PF 强势股评分(需下载日线) ZY1:=CLOSE/INDEXC*1000; A1:=IF(ZY1>HHV(ZY1,3),10,0); A2:=IF(ZY1>HHV(ZY1,5),15,0); A3:=IF(ZY1>HHV(ZY1,10),20,0); A4:=IF(ZY1>HHV(ZY1,2),10,0); A5:=COUNT(ZY1>REF(ZY1,1) ,9)*5; 强势股评分:A1+A2+A3+A4+A5; 第十二节 龙系 RAD 威力雷达 SM:=(OPEN+HIGH+CLOSE+LOW)/4; SMID:=MA(SM,D); IM:=(INDEXO+INDEXH+INDEXL+INDEXC)/4; IMID:=MA(IM,D); SI1:=(SMID-REF(SMID,1))/SMID; II:=(IMID-REF(IMID,1))/IMID; RADER1:SUM((SI1-II)*2,S)*1000; RADERMA:SMA(RADER1,M,1); LON 龙系长线 LC := REF(CLOSE,1); VID := SUM(VOL,2)/(((HHV(HIGH,2)-LLV(LOW,2)))*100); RC := (CLOSE-LC)*VID; LONG := SUM(RC,0); DIFF := SMA(LONG,10,1); DEA := SMA(LONG,20,1); LON : DIFF-DEA; LONMA : MA(LON,10); LONT : LON, COLORSTICK; 30 SHT 龙系短线 VAR1:=MA((VOL-REF(VOL,1))/REF(VOL,1),5); VAR2:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100; MY: VAR2*(1+VAR1); SHT: MY, COLORSTICK; SHTMA: MA(SHT,N); ZLJC 主力进出 VAR1:=(CLOSE+LOW+HIGH)/3; VAR2:=SUM(((VAR1-REF(LOW,1))-(HIGH-VAR1))*VOL/100000/(HIGH-LOW),0); VAR3:=EMA(VAR2,1); JCS:VAR3; JCM:MA(VAR3,12); JCL:MA(VAR3,26); ZLMM 主力买卖 LC :=REF(CLOSE,1); RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100; RSI3:=SMA(MAX(CLOSE-LC,0),18,1)/SMA(ABS(CLOSE-LC),18,1)*100; MMS:MA(3*RSI2-2*SMA(MAX(CLOSE-LC,0),16,1)/SMA(ABS(CLOSE-LC),16,1)*100,3); MMM:EMA(MMS,8); MML:MA(3*RSI3-2*SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100,5); SLZT 神龙在天 白龙: MA(CLOSE,125); 黄龙: 白龙+2*STD(CLOSE,170); 紫龙: 白龙-2*STD(CLOSE,145); 青龙: SAR(125,1,7), LINESTICK; VAR2:=HHV(HIGH,70); VAR3:=HHV(HIGH,20); 红龙: VAR2*0.83; 蓝龙: VAR3*0.91; ADVOL 龙系离散量 A:=SUM(((CLOSE-LOW)-(HIGH-CLOSE))*VOL/10000/(HIGH-LOW),0); ADVOL:A; MA1:MA(A,30); MA2:MA(MA1,100); 31 第十三节 鬼系 CYC 成本均线 JJJ:=IF(DYNAINFO(8)>0.01,0.01*DYNAINFO(10)/DYNAINFO(8),DYNAINFO(3)); DDD:=(DYNAINFO(5)<0.01 || DYNAINFO(6)<0.01); JJJT:=IF(DDD,1,(JJJ<(DYNAINFO(5)+0.01) && JJJ>(DYNAINFO(6)-0.01))); CYC1:IF(JJJT,0.01*EMA(AMOUNT,P1)/EMA(VOL,P1),EMA((HIGH+LOW+CLOSE)/3,P1)); CYC2:IF(JJJT,0.01*EMA(AMOUNT,P2)/EMA(VOL,P2),EMA((HIGH+LOW+CLOSE)/3,P2)); CYC3:IF(JJJT,0.01*EMA(AMOUNT,P3)/EMA(VOL,P3),EMA((HIGH+LOW+CLOSE)/3,P3)); CYC ∞:IF(JJJT,DMA(AMOUNT/(100*VOL),100*VOL/FINANCE(7)),EMA((HIGH+LOW+CLOSE)/3,120)); CYS 市场盈亏 CYC13:=0.01*EMA(AMOUNT,13)/EMA(VOL,13); CYS:(CLOSE-CYC13)/CYC13*100; CYQKL 博弈K线长度 KL:100*(WINNER(CLOSE)-WINNER(OPEN)); CYW 主力控盘 VAR1:=CLOSE-LOW; VAR2:=HIGH-LOW; VAR3:=CLOSE-HIGH; VAR4:=IF(HIGH>LOW,(VAR1/VAR2+VAR3/VAR2)*VOL,0); CYW: SUM(VAR4,10)/10000, COLORSTICK; 第十四节 其他系 XT 箱体 【箱顶】:PEAK(CLOSE,N,1)*0.98; 【箱底】:TROUGH(CLOSE,N,1)*1.02; 【箱高】:100*(【箱顶】-【箱底】)/【箱底】,NODRAW; 32 JAX 济安线 AA:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,N))/MA(CLOSE,N); 济安线:DMA((2*CLOSE+LOW+HIGH)/4,AA),LINETHICK3,COLORMAGENTA; CC:=(CLOSE/济安线); MA1:=MA(CC*(2*CLOSE+HIGH+LOW)/4,3); MAAA:=((MA1-济安线)/济安线)/3; TMP:=MA1-MAAA*MA1; J:IF(TMP<=济安线,济安线,DRAWNULL),LINETHICK3,COLORCYAN; A:TMP,LINETHICK2,COLORYELLOW; X:IF(TMP<=济安线,TMP,DRAWNULL),LINETHICK2,COLORGREEN; CJDX 超级短线 VAR1:=(2*CLOSE+HIGH+LOW)/4; VAR2:=EMA(EMA(EMA(VAR1,4),4),4); J: (VAR2-REF(VAR2,1))/REF(VAR2,1)*100, COLORSTICK; D: MA(J,3); K: MA(J,1); ZJTJ 庄家抬轿 VAR1:=EMA(EMA(CLOSE,9),9); 控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000; STICKLINE(控盘<0,控盘,0,1,0),COLORWHITE; A10:=CROSS(控盘,0); 无庄控盘:IF(控盘<0,控盘,0),COLORWHITE,NODRAW; 开始控盘:IF(A10,5,0),LINETHICK1,COLORYELLOW; STICKLINE(控盘>REF(控盘,1) AND 控盘>0,控盘,0,1,0),COLORRED; 有庄控盘:IF(控盘>REF(控盘,1) AND 控盘>0,控盘,0),COLORRED,NODRAW; VAR2:=100*WINNER(CLOSE*0.95); STICKLINE(VAR2>50 AND COST(85) 高度控盘:IF(VAR2>50 AND COST(85) 33 主力出货:IF(控盘0,控盘,0),COLOR00FF00,NODRAW; ZBCD 准备抄底 VAR1:=AMOUNT/VOL/7; VAR2:=(3*HIGH+LOW+OPEN+2*CLOSE)/7; VAR3:=SUM(AMOUNT,N)/VAR1/7; VAR4:=DMA(VAR2,VOL/VAR3); 抄底:(CLOSE-VAR4)/VAR4*100,COLORLIMAGENTA; DRAWICON(CROSS(-7.0,抄底),抄底,1); BDZX 波段之星 VAR2:=(HIGH+LOW+CLOSE*2)/4; VAR3:=EMA(VAR2,21); VAR4:=STD(VAR2,21); VAR5:=((VAR2-VAR3)/VAR4*100+200)/4; VAR6:=(EMA(VAR5,5)-25)*1.56; AK: EMA(VAR6,2)*1.22; AD1: EMA(AK,2); AJ: 3*AK-2*AD1; AA:100; BB:0; CC:80; 买进: IF(CROSS(AK,AD1),58,20); 卖出: IF(CROSS(AD1,AK),58,20); LHXJ 猎狐先觉 VAR1:=(CLOSE*2+HIGH+LOW)/4; VAR2:=EMA(VAR1,13)-EMA(VAR1,34); VAR3:=EMA(VAR2,5); 主力弃盘: (-2)*(VAR2-VAR3)*3.8; 主力控盘: 2*(VAR2-VAR3)*3.8; LYJH 猎鹰歼狐 VAR1:=(HHV(HIGH,36)-CLOSE)/(HHV(HIGH,36)-LLV(LOW,36))*100; 机构做空能量线: SMA(VAR1,2,1); VAR2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; 机构做多能量线: SMA(VAR2,5,1)-8; LH: M; 34 LH1: M1; JFZN 飓风智能中线 VAR2:=SUM(IF(CLOSE>OPEN,VOL,0),N)/SUM(VOL,N)*100; VAR3:=100-SUM(IF(CLOSE>OPEN,VOL,0),N)/SUM(VOL,N)*100; 多头力量: VAR2; 空头力量: VAR3; 多空平衡: 50; CYHT 财运亨通 VAR1:=(2*CLOSE+HIGH+LOW+OPEN)/5; 高抛: 80; VAR2:=LLV(LOW,34); VAR3:=HHV(HIGH,34); SK: EMA((VAR1-VAR2)/(VAR3-VAR2)*100,13); SD: EMA(SK,3); 低吸: 20; 强弱分界: 50; VAR4:=IF(CROSS(SK,SD),40,22); VAR5:=IF(CROSS(SD,SK),60,78); 卖出: VAR5; 买进: VAR4; SCR 筹码集中度 A:=P1+(100-P1)/2; B:=(100-P1)/2; CC:=COST(A); DD:=COST(B); SCR:(CC-DD)/(CC+DD)*100/2; 35 ASR 浮筹比例 ASR:(WINNER(C*1.1)-WINNER(C*0.9))/WINNER(HHV(H,0))*100; BSQJ 买卖区间 买线:=EMA(C,2); 卖线:=EMA(SLOPE(C,21)*20+C,42); STICKLINE(买线>=卖线,REFDATE(HHV(H,0),DATE),REFDATE(LLV(L,0),DATE),6,0),COLOR001050; STICKLINE(买线<卖线,REFDATE(HHV(H,0),DATE),REFDATE(LLV(L,0),DATE),6,0),COLOR404050; DRAWKLINE(H,O,L,C); 指导:=EMA((EMA(CLOSE,4)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4,2); 界:=MA(CLOSE,27); B买:IF(CROSS(指导,界) OR CROSS(买线,卖线),C,DRAWNULL),COLORMAGENTA,NODRAW; 持仓:IF(买线>=卖线,C,DRAWNULL),COLORRED,NODRAW; S卖:IF(CROSS(界,指导) OR CROSS(卖线,买线),C,DRAWNULL),COLORLIGRAY,NODRAW; 空仓:IF(买线<卖线,C,DRAWNULL),COLORGREEN,NODRAW; DRAWICON(CROSS(买线,卖线),L,1); DRAWICON(CROSS(卖线,买线),H,2); ZJL 折价率 用于排序 折价率:IF(FINANCE(34)>0.001,(FINANCE(34)-CLOSE)*100.0/FINANCE(34),0); CDP-STD 逆势操作 CH:=REF(H,1); CL:=REF(L,1); CC:=REF(C,1); CDP:(CH+CL+CC)/3; AH:CDP+CH-CL; NH:CDP+CDP-CL; NL:CDP+CDP-CH; AL:CDP-CH+CL; TBP-STD 趋势平衡点 APX:=(H+L+C)/3; TR0:=MAX(H-L,MAX(ABS(H-REF(C,1)),ABS(L-REF(C,1)))); MF0:=C-REF(C,2); MF1:=REF(MF0,1); MF2:=REF(MF0,2); DIRECT1:=BARSLAST(MF0>MF1 AND MF0>MF2); DIRECT2:=BARSLAST(MF0 TBP:REF(REF(C,1)+IF(DIRECT0>50,MIN(MF0,MF1),MAX(MF0,MF1)),1); 多头获利:REF(IF(DIRECT0>50,APX*2-L,DRAWNULL),1),NODRAW; 多头停损:REF(IF(DIRECT0>50,APX-TR0,DRAWNULL),1),NODRAW; 空头回补:REF(IF(DIRECT0<-50,APX*2-H,DRAWNULL),1),NODRAW; 36 空头停损:REF(IF(DIRECT0<-50,APX+TR0,DRAWNULL),1),NODRAW; SC 三叉(加密) NDB 脑电波(加密) JYJL 交易参考均量 单位时间总量: SUM(VOL,N)*100,NODRAW; 单位时间内均量: 单位时间总量/(N/M); JSJG 参考结算价(适用于金融期货) FIRST:=IF(PERIOD=0,HOUR=14 AND MINUTE=16,DRAWNULL); TOTAL:=IF(PERIOD=0,60,0); MAMIN:=BARSLAST(FIRST)+1; COUNTFLAG:=(PERIOD=0 AND ( (HOUR=14 AND MINUTE>=16) OR HOUR=15 )); 逼近结算价格:IF(COUNTFLAG,SUM(C*V,MAMIN)/SUM(V,MAMIN),DRAWNULL); LASTP:=C; LASTM:=MAMIN; LASTV:=MA(V,MAMIN); 参考结算价格:IF(COUNTFLAG,(SUM(C*V,MAMIN)+ LASTP*LASTV*(TOTAL-LASTM))/(LASTV*TOTAL),DRAWNULL); VOLATILITY 波动率 SQRT(250)*STD(C/REF(C,1)-1,N); 第十五节 特色型 CPBS 操盘BS点 BU:=CROSS(HIGH,SAR(3,1,20)); SEL:=CROSS(SAR(3,1,20),LOW); DRAWTEXT(BU,LOW,'B'),COLORYELLOW,LINETHICK2; DRAWTEXT(SEL,1.01*HIGH,'S'),COLORGREEN,LINETHICK2; 37 CYX 撑压线 Z1:=STRCAT(HYBLOCK,' '); Z2:=STRCAT(Z1,DYBLOCK); Z3:=STRCAT(Z2,' '); DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLOR00C0C0; A1:=REF(H,N)=HHV(H,2*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N); A2:=REF(L,N)=LLV(L,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N); E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2; E2:=(H+L)/2; H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1; L1:=(D2 AND NOT(D1 AND E1 F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1)); G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1); L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1; X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2)); G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1); R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1); S1:=R1>REF(R1,1); T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1); U1:=T1>REF(T1,1); R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2); S2:=R2>REF(R2,1); T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2); U2:=T2>REF(T2,1); NOTEXT1:DRAWLINE(S2,H,S1,H,1),LINETHICK2,COLORRED; NOTEXT2:DRAWLINE(U2,L,U1,L,1),LINETHICK2,COLORGREEN; 38 WAVE 波浪分析 ZIG(3,因子); SKSD 时空隧道 STICKLINE(CURRBARSCOUNT<=N,H,L,-1,0),COLORBLACK; DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(CON2STR(N,0),'周期前K线 选中主图后按ALT+T键调节回退的周期')),COLORLIMAGENTA; NOTEXT1:IF(CURRBARSCOUNT>=N+1,MA(C,M),DRAWNULL),COLORWHITE; NOTEXT2:IF(CURRBARSCOUNT<=N,MA(C,M),DRAWNULL),COLORBLACK; XLPL 吸拉派落(加密) GSTQ 股市天气(加密) AROON 阿隆指标 上轨:(N-HHVBARS(H,N))/N*100,COLORRED; 下轨:(N-LLVBARS(H,N))/N*100,COLORGREEN; CFJT 财富阶梯 突破:=REF(EMA(C,14),1); A1X:=(EMA(C,10)-突破)/突破*100; 多方:=IF(A1X>=0,REF(EMA(C,10),BARSLAST(CROSS(A1X,0))+1),DRAWNULL); 空方:=IF(A1X<0,REF(EMA(C,10),BARSLAST(CROSS(0,A1X))+1),DRAWNULL); STICKLINE(A1X>=0,多方,突破,10,0),COLOR000099; STICKLINE(A1X<0,空方,突破,10,0),COLOR00CC66; 39 TJCJL 太极成交量 总手:VOL,NODRAW; DRAWTEXT_FIX(ISLASTBAR,0,0,0,'说明: 红色柱为吸货量,绿色为出货量,黄色为天量,蓝色为地量'),COLORGRAY; ZZ:=IF(REF(C,1)>REF(O,1) AND O>REF(C,1)*1.014 AND C STICKLINE(VOL,0,VOL,1,0),COLORLIGRAY; STICKLINE(CROSS(C,C6) AND V>V5*1.2 AND V>V12*1.2 AND ZZ>2 AND C>H*0.975,0,VOL,1,0),COLORRED; STICKLINE(CROSS(C6,C) AND V>V5*1.2 AND V>V12*1.2,0,VOL,1,0),COLORGREEN; STICKLINE(VOL>MA(VOL,5)*2 AND V>V34*3 AND C STICKLINE(VOL>MA(VOL,5)*2 AND V>V34*3 AND CV5*1.2 AND V>V12*1.2 AND ZZ>2 AND C>H*0.975,VOL*0.5,0,1,0),COLORRED; STICKLINE(VOL>MA(VOL,5)*2 AND V>V34*3 AND CV5*1.2 AND V>V12*1.2,VOL*0.5,0,1,0),COLORRED; ZJFZ 追击反转 VAR2:=REF(LOW,1); VAR3:=SMA(ABS(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100; VAR4:=EMA(VAR3*10,3); VAR5:=LLV(LOW,13); VAR6:=HHV(VAR4,13); VAR7:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618; VAR8:=IF(VAR7>500,500,VAR7); STICKLINE(VAR8>-120,0,VAR8,3,1),COLORGRAY; STICKLINE(VAR8>1 AND \REF(\AR8,3,0),COLORRED; STICKLINE(VAR8>0.1 AND VAR8<1 AND \REF(\AR8,3,0),COLOR00FFFF; AND AND ZSDB 指数对比 A:=REF(INDEXC,1); 指数涨幅:IF(A>0,(INDEXC-A)*100/A,0),NODRAW; HYDB:DRAWKLINE(INDEXH,INDEXO,INDEXL,INDEXC); HYDB 行业对比 A:=REF(HY_INDEXC,1); 行业涨幅:IF(A>0,(HY_INDEXC-A)*100/A,0),NODRAW; DRAWTEXT_FIX(ISLASTBAR,0,0,0,HYBLOCK),COLOR00C0C0; HYDB:DRAWKLINE(HY_INDEXH,HY_INDEXO,HY_INDEXL,HY_INDEXC); 40 FKX 反K线 DRAWKLINE(-LOW, -OPEN, -HIGH, -CLOSE); ZJLX 资金流向 超B:=L2_AMO(0,2)/10000.0; 大B:=L2_AMO(1,2)/10000.0; 中B:=L2_AMO(2,2)/10000.0; 小B:=L2_AMO(3,2)/10000.0; 超S:=L2_AMO(0,3)/10000.0; 大S:=L2_AMO(1,3)/10000.0; 中S:=L2_AMO(2,3)/10000.0; 小S:=L2_AMO(3,3)/10000.0; 资金流向:(超B+大B+中B+小B)-(超S+大S+中S+小S),NODRAW; STICKLINE(资金流向>0,0,资金流向,2,0),COLORRED; STICKLINE(资金流向<0,0,资金流向,2,0),COLORCYAN; 近5日流向:SUM(资金流向,5),NODRAW; 近10日流向:SUM(资金流向,10),NODRAW; ZJQDL 资金驱动力 超B:=L2_AMO(0,2)/10000.0; 大B:=L2_AMO(1,2)/10000.0; 中B:=L2_AMO(2,2)/10000.0; 小B:=L2_AMO(3,2)/10000.0; 超S:=L2_AMO(0,3)/10000.0; 大S:=L2_AMO(1,3)/10000.0; 中S:=L2_AMO(2,3)/10000.0; 小S:=L2_AMO(3,3)/10000.0; 净流入:(超B+大B+中B+小B)-(超S+大S+中S+小S); 大宗净流入:(超B+大B)-(超S+大S); ZJBY 资金博弈 超B:=L2_AMO(0,2)/10000.0; 大B:=L2_AMO(1,2)/10000.0; 中B:=L2_AMO(2,2)/10000.0; 小B:=L2_AMO(3,2)/10000.0; 超S:=-L2_AMO(0,3)/10000.0; 大S:=-L2_AMO(1,3)/10000.0; 中S:=-L2_AMO(2,3)/10000.0; 小S:=-L2_AMO(3,3)/10000.0; 净流入:(超B+大B+中B+小B)+(超S+大S+中S+小S),NODRAW; 超大单:(超B)+(超S); 大单:(大B)+(大S); 中单:(中B)+(中S); 41 小单:(小B)+(小S); DDX 大单动向 大单动向:(LARGEINTRDVOL-LARGEOUTTRDVOL)*10000/FINANCE(7),NODRAW; NOTEXT1:MA(大单动向,N)*3; STICKLINE(大单动向>0,0,大单动向,2,0),COLORRED; STICKLINE(大单动向<0,0,大单动向,2,0),COLORCYAN; DDY 涨跌动因 涨跌动因:IF(TRADENUM>0,(TRADEOUTNUM-TRADEINNUM)*100/TRADENUM,0),NODRAW; NOTEXT1:MA(涨跌动因,N)*3; STICKLINE(涨跌动因>0,0,涨跌动因,2,0),COLORRED; STICKLINE(涨跌动因<0,0,涨跌动因,2,0),COLORCYAN; DDZ 大单差分 大单差分:IF(TRADENUM>0, (LARGETRDINNUM-LARGETRDOUTNUM)/TRADENUM*100,0),NODRAW; DDZ1:=大单差分*7; DDZ2:=大单差分*3; DRAWBAND(DDZ1,RGB(255,32,32),DDZ2,RGB(0,224,224)); DDF 大单频率 大单频率:IF(TRADENUM>0,LARGETRDINNUM*100/TRADENUM,0),NODRAW; NOTEXT1:MA(大单频率,N)*2; STICKLINE(1,0,大单频率,2,0); SUPL 主力集散线 主力集散线:SUM((LARGEINTRDVOL-LARGEOUTTRDVOL)*10000/FINANCE(7),0),LINETHICK2; MA1:MA(主力集散线,N),COLORBROWN; SUPV 主力净买量 主力净买量:(LARGEINTRDVOL-LARGEOUTTRDVOL); 42 主力买量:LARGEINTRDVOL,COLORRED,NODRAW; 主力卖量:LARGEOUTTRDVOL,COLORGREEN,NODRAW; STICKLINE(1,0,IF(主力买量>0,VOL,0),2,0),COLORBROWN; STICKLINE(1,0,IF(主力卖量>0,-VOL,0),2,0),COLORBROWN; STICKLINE(1,0,主力买量,2,0),COLORRED; STICKLINE(1,0,(-1*主力卖量),2,0),COLORGREEN; SUPH 主力活跃度 TMP:=LARGEINTRDVOL-LARGEOUTTRDVOL; 主力活跃度:(LARGEINTRDVOL+LARGEOUTTRDVOL)*10000/(2*FINANCE(7)),NODRAW; STICKLINE(TMP>0,0,主力活跃度,2,0),COLORLIRED; STICKLINE(TMP<0,0,主力活跃度,2,0),COLORLIGREEN; SUPAMO 主力资金线 主力资金线:(L2_AMO(0,0)+L2_AMO(1,0)-L2_AMO(0,1)-L2_AMO(1,1))/10000.0,LINETHICK2; DDE排序 DDE用于排序 DDX:(LARGEINTRDVOL-LARGEOUTTRDVOL)*10000/FINANCE(7); DDY:IF(TRADENUM>0,(TRADEOUTNUM-TRADEINNUM)*100/TRADENUM,0); DDZ:IF(TRADENUM>0,(LARGETRDINNUM-LARGETRDOUTNUM)/TRADENUM*100,0); SUP排序SUP用于排序 SUPL:SUM((LARGEINTRDVOL-LARGEOUTTRDVOL)*10000/FINANCE(7),0); SUPV:(LARGEINTRDVOL-LARGEOUTTRDVOL); SUPH:(LARGEINTRDVOL+LARGEOUTTRDVOL)*10000/(2*FINANCE(7)); SUPAMO:(L2_AMO(0,0)+L2_AMO(1,0)-L2_AMO(0,1)-L2_AMO(1,1))/10000.0; DDE力度 DDE力度用于排序 主力买力度:LARGEINTRDVOL*100/VOL; 主力卖力度:LARGEOUTTRDVOL*100/VOL; 43 第二章 条件选股公式 第一节 指标条件选股 BIAS买入 乖离率买入条件选股 (CLOSE-MA(CLOSE,N))/MA(CLOSE,N)*100+LL<0; KD买入 KD买入条件选股 RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:=SMA(RSV,M1,1); D:=SMA(K,M2,1); KD:CROSS(K,D)&&K<20; W&R买入 威廉指标买入条件选股 CROSS(LL,WR(N,N)); MTM买入 MTM买入条件选股 IMTM:CROSS(MTM(N,N),0); 44 KDJ买入 KDJ买入条件选股 RSV:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100; K:=SMA(RSV,N2,1); D:=SMA(K,N3,1); J:=3*K-2*D; CROSS(J,0); BIAS卖出 乖离率卖出条件选股 100*(CLOSE-MA(CLOSE,N))/MA(CLOSE,N)>M; BOLL买入 布林带买入条件选股 MID := MA(CLOSE,N); UPPER:= MID+S*STD(CLOSE,N); LOWER:= MID-S*STD(CLOSE,N); CROSS(CLOSE,LOWER); BOLL卖出 布林带卖出条件选股 MID := MA(CLOSE,N); UPPER:= MID+PP*STD(CLOSE,N); LOWER:= MID-PP*STD(CLOSE,N); CROSS(UPPER,CLOSE); 45 KD卖出 KD卖出条件选股 RSV:= (CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:=SMA(RSV,N1,1); D:=SMA(K,N2,1); CROSS(D,K) AND D>N3; KDJ卖出 KDJ卖出条件选股 RSV:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100; K:=SMA(RSV,N2,1); D:=SMA(K,N3,1); J:=3*K-2*D; CROSS(100,J); MA买入 均线买入条件选股 CROSS(MA(CLOSE,SHORT),MA(CLOSE,LONG)); MA卖出 均线卖出条件选股 RSV:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100; K:=SMA(RSV,N2,1); D:=SMA(K,N3,1); J:=3*K-2*D; CROSS(100,J); 46 MACD买入 MACD买入点条件选股 DIFF := EMA(CLOSE,SHORT) - EMA(CLOSE,LONG); DEA := EMA(DIFF,M); CROSS(DIFF,DEA); MACD卖出 MACD卖出条件选股 DIFF := EMA(CLOSE,SHORT) - EMA(CLOSE,LONG); DEA := EMA(DIFF,M); CROSS(DEA ,DIFF); + MTM卖出 MTM卖出条件选股 CROSS(0,MA(CLOSE-REF(CLOSE,N),N1)); RSI买入 RSI买入条件选股 LC:= REF(CLOSE,1); RSI1:=SMA(MAX(CLOSE-LC,0),N,1)/SMA(ABS(CLOSE-LC),N,1)*100; CROSS(RSI1,LL); RSI卖出 RSI卖出条件选股 LC := REF(CLOSE,1); RSI1:=SMA(MAX(CLOSE-LC,0),N,1)/SMA(ABS(CLOSE-LC),N,1)*100; CROSS(LL,RSI1); 47 SAR买入 抛物转向买入条件选股 SARTURN(N,STEP,MAXP)=1; SAR卖出 抛物转向卖出条件选股 SARTURN(N,STEP,MAXP)=-1; W&R卖出 威廉指标卖出条件选股 WR:=100*(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N)); CROSS(M,WR); PRD 穿透率(大于) PR:(WINNER(CLOSE)-REF(WINNER(CLOSE),1))>P1*VOL/CAPITAL; PRX 穿透率(小于)