通达信FT
N1:=12;N2:=26;M:=9;
CC:=(C+L+H+O)/4;
DIFF:=EMA(CC,5)-EMA(CC,13),COLORBB00BB,LINETHICK2;
DEA:=EMA(DIFF,4),COLOR00BB00,LINETHICK2;
MACD:=XMA((DIFF-DEA)*200,2),COLORSTICK;
红柱持股:MACD,NODRAW;
黄色高抛:MACD,NODRAW;
蓝柱持币:MACD,NODRAW;
紫色反弹:MACD,NODRAW;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,6,0 ),COLOR003333;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,3.5,0 ),COLOR004444;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,3,0 ),COLOR005555;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2.5,0 ),COLOR007777;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR009999;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,1.5,0 ),COLOR00BBBB;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,1,0 ),COLOR00DDDD;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0.5,0 ),COLOR00FFFF;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,6 ,0 ),COLOR000033;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,3.5 ,0 ),COLOR000044;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,3 ,0 ),COLOR000055;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2.5 ,0 ),COLOR000077;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2 ,0 ),COLOR000099;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,1.5 ,0 ),COLOR0000BB;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,1 ,0 ),COLOR0000DB;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,0.5 ,0 ),COLOR0000FF;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,6,0 ),COLORFF00CA;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,3.5,0 ),COLORFF00CC;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,3,0 ),COLORFF00DB;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2.5,0 ),COLORFF00DD;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFF00DF;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,1.5,0 ),COLORFF00EE;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,1,0 ),COLORFF00EF;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0.5,0 ),COLORFF00FF;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,6,0 ),COLOR333300;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,3.5,0 ),COLOR444400;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,3,0 ),COLOR555500;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2.5,0 ),COLOR777700;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLOR999900;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,1.5,0 ),COLORBBBB00;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,1,0 ),COLORDDDD00;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0.5,0 ),COLORFFFF00;
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*100;
DEAA:=EMA(DIF,9);
RSV:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;
K:=SMA(RSV,2,1);{股票指标网}
D:=SMA(K,2,1);
J:=3*K-2*D;
主流资金:=(EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3))/100, COLORRED,LINETHICK2;
非主流资金:=(EMA(100*(INDEXC-LLV(INDEXL,34))/(HHV(INDEXH,34)-LLV(INDEXL,34)),3))/100,COLORGREEN,LINETHICK2;
KJ共振:CROSS(DIF,DEAA) AND CROSS(K,D) AND 主流资金>非主流资金;
DRAWTEXT(KJ共振,红柱持股,'B'),COLORGREEN;
四连阳:EVERY(红柱持股>REF(红柱持股,1),4),NODRAW;
LAST((H-L)/REF(C,1)<0.1,20,0) AND VOL>REF(VOL,1)*2 AND C>REF(C,1)*1.03
AND "DMI.PDI">"DMI.MDI" AND CROSS("DMI.ADX","DMI.ADXR")
AND"DMI.ADXR">"DMI.MDI" AND "DMI.PDI">"DMI.ADX" AND"KDJ.D">REF("KDJ.D",1);
未来函数检测结果如下:
该公式包含未来函数:XMA
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N1赋值:12
N2赋值:26
M赋值:9
CC赋值:(C+L+H+O)/4
DIFF赋值:CC的5日指数移动平均-CC的13日指数移动平均,COLORBB00BB, 线宽为2
DEA赋值:DIFF的4日指数移动平均,COLOR00BB00, 线宽为2
MACD:=XMA((DIFF-DEA)*200,2),COLORSTICK
输出
红柱持股:MACD,NODRAW
输出
黄色高抛:MACD,NODRAW
输出
蓝柱持币:MACD,NODRAW
输出
紫色反弹:MACD,NODRAW
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,6,0 ),COLOR003333
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,3.5,0 ),COLOR004444
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,3,0 ),COLOR005555
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,2.5,0 ),COLOR007777
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,2,0 ),COLOR009999
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,1.5,0 ),COLOR00BBBB
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,1,0 ),COLOR00DDDD
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,0.5,0 ),COLOR00FFFF
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,6 ,0 ),COLOR000033
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,3.5 ,0 ),COLOR000044
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,3 ,0 ),COLOR000055
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,2.5 ,0 ),COLOR000077
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,2 ,0 ),COLOR000099
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,1.5 ,0 ),COLOR0000BB
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,1 ,0 ),COLOR0000DB
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,0.5 ,0 ),COLOR0000FF
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,6,0 ),COLORFF00CA
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,3.5,0 ),COLORFF00CC
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,3,0 ),COLORFF00DB
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,2.5,0 ),COLORFF00DD
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,2,0 ),COLORFF00DF
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,1.5,0 ),COLORFF00EE
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,1,0 ),COLORFF00EF
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,0.5,0 ),COLORFF00FF
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,6,0 ),COLOR333300
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,3.5,0 ),COLOR444400
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,3,0 ),COLOR555500
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,2.5,0 ),COLOR777700
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,2,0 ),COLOR999900
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,1.5,0 ),COLORBBBB00
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,1,0 ),COLORDDDD00
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,0.5,0 ),COLORFFFF00
DIF赋值:(收盘价的12日指数移动平均-收盘价的26日指数移动平均)*100
DEAA:=DIF的9日指数移动平均
RSV赋值:(收盘价-5日内最低价最低值)/(5日内最高价最高值-5日内最低价最低值)*100
RSV的2日[1日权重]移动平均
K的2日[1日权重]移动平均
J赋值:3*K-2*D
主流资金赋值:(EMA(100*(C-34日内最低价最低值)/(34日内H最高值-34日内最低价最低值),3))/100, 画红色, 线宽为2
非主流资金赋值:(EMA(100*(INDEXC-34日内INDEXL最低值)/(34日内INDEXH最高值-34日内INDEXL最低值),3))/100,画绿色, 线宽为2
KJ共振:DIF上穿DEAA AND K上穿D AND 主流资金>非主流资金
当满足条件KJ共振时,在红柱持股和'B'位置书写文字
输出
四连阳:EVERY(红柱持股>1日前的红柱持股,4),NODRAW
LAST((H-L)/1日前的C<0.1,20,0) AND 成交量>1日前的成交量*2 AND C>1日前的C*1.03
AND "DMI.PDI">"DMI.MDI" AND "DMI.ADX"上穿"DMI.ADXR"
AND"DMI.ADXR">"DMI.MDI" AND "DMI.PDI">"DMI.ADX" AND"KDJ.D">1日前的"KDJ.D"