通达信趋势主图
CCC:=AMOUNT/VOL/100;
M5:MA(CCC,5),COLORFF00FF,LINETHICK1;
M13:MA(CCC,13),COLOR00FFFF,LINETHICK1;
M21:MA(CCC,21),COLORRED,LINETHICK1;
M34:MA(CCC,34),COLORFFFFFF,LINETHICK2;
STICKLINE(C<O,C,O,3.2,1),COLORFFF333;
STICKLINE(C>O,C,O,3.2,1),COLORRED;
STICKLINE(CCC>M34 AND M34>REF(M34,1) AND CCC>M13,C,O,3.2,0),COLORRED;
STICKLINE(CCC>M34 AND M34>REF(M34,1) AND CCC>M13 AND C<O,C,O,3.2,1),COLORDDDDDD;
STICKLINE(CCC<=M34 AND M34>REF(M34,1) AND C<=O,C,O,3.2,1),COLOR00FFFF;
STICKLINE(CCC<=M34 AND M34>REF(M34,1),C,O,3.2,0),COLOR00FFFF;
STICKLINE(CCC<=M34 AND M34>REF(M34,1) AND C<=O,C,O,3.2,1),COLOR00FFFF;
STICKLINE(CCC<=M34 AND M34<=REF(M34,1),C,O,3.2,1),COLORFF0000;
STICKLINE(CCC<=M34 AND M34<=REF(M34,1) AND C<=O,C,O,3.2,0),COLORFF0000;
M34,COLORFFFFFF,LINETHICK2;
IF(M34<REF(M34,1),M34,DRAWNULL),COLORFF0000,LINETHICK2;
M21,COLORRED;
IF(M21<REF(M21,1),M21,DRAWNULL),COLOR00FF00,LINETHICK1;
M13,COLOR00FFFF;
IF(M13<REF(M13,1),M13,DRAWNULL),COLORFFF333,LINETHICK1;
M5,COLORFF00FF;
IF(M5<REF(M5,1),M5,DRAWNULL),COLOR009880,LINETHICK1;
K8:=SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,2.5,1);
短入:=K8>REF(K8,1) AND CROSS(K8,SMA(K8,2.5,1)) AND K8<50;
DRAWICON(短入,L*0.96,13);
抄底:=REF(COUNT("KDJ.K"<REF("KDJ.K",1),5)>=5,1) AND COUNT("KDJ.K"<30,5)>=2
AND COUNT("KDJ.J"<0,3)>0 AND CROSS("KDJ.J",0);
DRAWTEXT(抄底 AND NOT((CCC>M34 OR M34>REF(M34,1))),L*0.98,'--抄底')
,COLOR00FFFF;
DRAWTEXT(抄底 AND (CCC>M34 OR M34>REF(M34,1)),L*0.98,'--确认'),COLORRED;
TJ00:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D") AND REF("KDJ.K",1)<35,1));
加仓:=C<REF(C,TJ00+1)*1.1 AND REF("KDJ.K",1)<60 AND (TJ00+1)<25 AND (TJ00+1)>5 AND "KDJ.K">REF("KDJ.K",TJ00+1) AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(加仓 AND NOT((CCC>M34 OR M34>REF(M34,1))),L*0.98,'--回抽')
,COLOR5599FF;
DRAWTEXT(加仓 AND (CCC>M34 OR M34>REF(M34,1)),L*0.98,'--加仓'),COLORFF00FF;
DRAWICON(CROSS("KDJ.J",0) AND (CCC>M34 OR M34>REF(M34,1)),L*0.97,1);
HH0:=CONST(HHV(H,75));
LL0:=CONST(LLV(L,75));
MM0:=CONST((HH0+LL0)/2);
HL0:=CONST(IF(CONST(C)>=MM0,LL0-(HH0-LL0)*0.2,HH0+(HH0-LL0)*0.2));
HH1:=IF(CONST(C)<MM0,HH0*1.01,HL0);
LL1:=IF(CONST(C)>=MM0,LL0*0.99,HL0);
HL1:=(HH1+LL1)/2,COLORFFFFFF;
STICKLINE("MACD.MACD">0,"MACD.MACD"+HL1,HL1,2.5,1),COLORDD55CC;
STICKLINE("MACD.MACD">0 AND "MACD.MACD">REF("MACD.MACD",1),
"MACD.MACD"+HL1,HL1,2.5,0),COLORDD55CC;
STICKLINE("MACD.MACD"<0,"MACD.MACD"+HL1,HL1,2.5,0),COLOR00D080;
STICKLINE("MACD.MACD"<0 AND "MACD.MACD">REF("MACD.MACD",1),
"MACD.MACD"+HL1,HL1,2.5,1),COLOR00D080;
IF("MACD.DIF">0,HL1*0.975,DRAWNULL),COLOR0000FF,LINETHICK1,CIRCLEDOT;
IF("MACD.DIF">0 AND "MACD.MACD"<0,HL1*0.975,DRAWNULL),COLOR00FFFF,CIRCLEDOT;
IF("MACD.DIF"<0 AND "MACD.MACD">0,HL1*0.975,DRAWNULL),COLORFF0080,CIRCLEDOT;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
CCC赋值:成交额/成交量/100
输出
M5:CCC的5日简单移动平均,COLORFF00FF,LINETHICK1
输出
M13:CCC的13日简单移动平均,COLOR00FFFF,LINETHICK1
输出
M21:CCC的21日简单移动平均,画红色,LINETHICK1
输出
M34:CCC的34日简单移动平均,COLORFFFFFF, 线宽为2
当满足条件C当满足条件C>O时,在C和O之间画柱状线
STICKLINE(CCC>M34 AND M34>1日前的M34 AND CCC>M13,C,O,3.2,0),画红色
STICKLINE(CCC>M34 AND M34>1日前的M34 AND CCC>M13 AND C
STICKLINE(CCC<=M34 AND M34>1日前的M34 AND C<=O,C,O,3.2,1),COLOR00FFFF
STICKLINE(CCC<=M34 AND M34>1日前的M34,C,O,3.2,0),COLOR00FFFF
STICKLINE(CCC<=M34 AND M34>1日前的M34 AND C<=O,C,O,3.2,1),COLOR00FFFF
STICKLINE(CCC<=M34 AND M34<=1日前的M34,C,O,3.2,1),COLORFF0000
STICKLINE(CCC<=M34 AND M34<=1日前的M34 AND C<=O,C,O,3.2,0),COLORFF0000
M34,COLORFFFFFF, 线宽为2
IF(M34<1日前的M34,M34,DRAWNULL),COLORFF0000, 线宽为2
M21,画红色
IF(M21<1日前的M21,M21,DRAWNULL),COLOR00FF00,LINETHICK1
M13,COLOR00FFFF
IF(M13<1日前的M13,M13,DRAWNULL),COLORFFF333,LINETHICK1
M5,COLORFF00FF
IF(M5<1日前的M5,M5,DRAWNULL),COLOR009880,LINETHICK1
K8赋值:SMA((收盘价-8日内最低价最低值)/(8日内最高价最高值-8日内最低价最低值)*100,2.5,1)
K8的2.5日[1日权重]移动平均
当满足条件短入时,在L*0.96和13之间画图标
抄底赋值:REF(COUNT("KDJ.K"[=5,1) AND COUNT("KDJ.K"<30,5)>=2 ]
AND COUNT("KDJ.J"<0,3)>0 AND "KDJ.J"上穿0
DRAWTEXT(抄底 AND NOT((CCC>M34 OR M34>1日前的M34)),L*0.98,'--抄底')
,COLOR00FFFF
DRAWTEXT(抄底 AND (CCC>M34 OR M34>1日前的M34),L*0.98,'--确认'),画红色
TJ00赋值:上次1日前的"KDJ.K"上穿"KDJ.D" AND "KDJ.K"<35,1距今天数)
加仓赋值:C5 AND "KDJ.K">TJ00+1日前的"KDJ.K" AND "KDJ.K"上穿"KDJ.D"
DRAWTEXT(加仓 AND NOT((CCC>M34 OR M34>1日前的M34)),L*0.98,'--回抽')
,COLOR5599FF
DRAWTEXT(加仓 AND (CCC>M34 OR M34>1日前的M34),L*0.98,'--加仓'),COLORFF00FF
DRAWICON("KDJ.J"上穿0 AND (CCC>M34 OR M34>1日前的M34),L*0.97,1)
HH0赋值:CONST(75日内H最高值)
LL0赋值:CONST(75日内L最低值)
MM0赋值:CONST((HH0+LL0)/2)
HL0赋值:CONST(IF(CONST(C)>=MM0,LL0-(HH0-LL0)*0.2,HH0+(HH0-LL0)*0.2))
HH1赋值:IF(CONST(C)
LL1赋值:IF(CONST(C)>=MM0,LL0*0.99,HL0)
HL1赋值:(HH1+LL1)/2,COLORFFFFFF
当满足条件"MACD.MACD">0时,在"MACD.MACD"+HL1和HL1之间画柱状线
STICKLINE("MACD.MACD">0 AND "MACD.MACD">1日前的"MACD.MACD",
"MACD.MACD"+HL1,HL1,2.5,0),COLORDD55CC
当满足条件"MACD.MACD"<0时,在"MACD.MACD"+HL1和HL1之间画柱状线
STICKLINE("MACD.MACD"<0 AND "MACD.MACD">1日前的"MACD.MACD",
"MACD.MACD"+HL1,HL1,2.5,1),COLOR00D080
如果"MACD.D">0返回HL1*0.975否则返回DRAWNULL
如果"MACD.D">0 AND "MACD.MACD"<0返回HL1*0.975否则返回DRAWNULL
如果"MACD.D"<0 AND "MACD.MACD">0返回HL1*0.975否则返回DRAWNULL