以下是通达信双底主图幅图指标公式源码和使用说明
通达信双底主图选股幅图指标公式源码:
P:=5;
G1:=TROUGHBARS(3,P,1);
G2:=TROUGHBARS(3,P,2);
F1:=PEAKBARS(3,P,1);
F2:=PEAKBARS(3,P,2);
JG:=REF(C,G1);
YG:=REF(C,G2);
JF:=REF(C,F1);
YF:=REF(C,F2);
XG:JG YGANDJF YFANDcrOSS(C,JF);
{主图}
N:=15;
T:=LLVBARS(L,N);
HT:=HHVBARS(H,N);
TT:=BARSLAST(T=0);
XG:=T=0ANDREF(TT,1) 20ANDL REF(L,REF(TT,1));
XGT:=BARSLAST(XG);
QF:=BACKSET(XG=1,HT+1);
QFT:=BARSLAST(CROSS(QF=1,0.5));
DRAWLINE(QFT=0,H,XG,L,0),COLORYELLOW;
QF1:=BACKSET(QFT=0,TT+1);
QF1T:=BARSLAST(CROSS(QF1=1,0.5));
DRAWLINE(QF1T=0,L,QFT=0,H,0),COLORYELLOW;
STICKLINE(QF1T=0,C,O,1.8,0),COLORWHITE;
STICKLINE(QF1T=0,H,L,0,0),COLORWHITE;
DRAWTEXT(QF1T=0,H*1.02,VARCAT(VARCAT('第一底价',VAR2STR(REF(L,QF1T),2)),'元'))COLORYELLOW;
STICKLINE(XG,C,O,1.8,0),COLORWHITE;
STICKLINE(XG,H,L,0,0),COLORWHITE;
DRAWTEXT(XGT=0,H*1.04,VARCAT(VARCAT('双底价',VAR2STR(REF(L,XGT),2)),'元'))COLORYELLOW;
DRAWICON(XG,L*0.94,1);
{副图}
N:=15;
T:=LLVBARS(L,N);
HT:=HHVBARS(H,N);
TT:=BARSLAST(T=0);
XG:=T=0ANDREF(TT,1) 20ANDL REF(L,REF(TT,1));
XGT:=BARSLAST(XG);
QF:=BACKSET(XG=1,HT+1);
QFT:=BARSLAST(CROSS(QF=1,0.5));
QF1:=BACKSET(QFT=0,TT+1);
QF1T:=BARSLAST(CROSS(QF1=1,0.5));
STICKLINE(XG,8,0,1.8,0),COLORWHITE;
{选股}
T:=LLVBARS(L,15);
TT:=BARSLAST(T=0);
T=0ANDREF(TT,1) 20ANDL REF(L,REF(TT,1));
拉升力:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,30)-LLV(LOW,36))*0.6*CLOSE;
拉升力A:=SMA(拉升力,6.3,1);
波峰波谷:=SMA(拉升力A,3,1);
拉升力B:=3*拉升力A-2.1*波峰波谷;
空方:=3*波峰波谷-1*拉升力A;
做空:=IF(空方 拉升力B,拉升力B,空方);
做空周期:=HHV(做空,21);
多头:=IF(做空 =REF(做空,1),做空,1);
空头:=IF(做空 REF(做空,1),做空,1);
涨幅:=CLOSE/REF(CLOSE,1) 1.065;
昨涨幅:=REF(CLOSE,1)/REF(CLOSE,2) 1.065;
VOLUME:=VOL;
MAVOL1:=MA(VOLUME,5);
MAVOL2:=MA(VOLUME,10);
停牌:=DYNAINFO(4)
XG:昨涨幅AND多头=做空周期AND涨幅ANDVOLUME MAVOL1ANDVOLUME MAVOL2ANDVOLUME REF(VOLUME,1)AND停牌;
通达信双底主图选股幅图指标公式截图