| | | |
通达信公式HGRID分时指标公式源码
DRAWRECTREL(000,0,3000,3000,RGB(10,10,10));
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:L1+P1*7/8,COLORLIGREEN;
支撑:L1+P1*0.5/8,COLORRED;
中:(支撑+阻力)/2,COLORWHITE;
现价:CLOSE,COLORWHITE,LINETHICK2;
SELL1:中+(阻力-中)*1/3,COLORYELLOW,POINTDOT;
SELL2:中+(阻力-中)*2/3,COLORYELLOW,POINTDOT;
BUY1:中-(中-支撑)*1/3,COLORYELLOW,POINTDOT;
BUY2:中-(中-支撑)*2/3,COLORYELLOW,POINTDOT;
DRAWTEXT(CURRBARSCOUNT=8,阻力+0.003,'阻力'),COLORGREEN,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=8,支撑-0.003,'支撑'),COLORLIRED,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=8,(支撑+阻力)/2,'基准'),COLORWHITE,LINETHICK1;
DAYUPSELL2:=BARSLAST(CROSS(C,SELL2));
DRAWICON(COUNT(C>阻力,DAYUPSELL2)>=1 AND CROSS(SELL2,C),SELL2,1);
DAYUPSELL1:=BARSLAST(CROSS(C,SELL1));
DRAWICON(COUNT(C>SELL2,DAYUPSELL1)>=1 AND CROSS(SELL1,C),SELL1,1);
DAYUPZHONG:=BARSLAST(CROSS(C,中));
DRAWICON(COUNT(C>SELL1,DAYUPZHONG)>=1 AND CROSS(中,C),中,1);
DAYUPBUY1:=BARSLAST(CROSS(C,BUY1));
DRAWICON(COUNT(C>中,DAYUPBUY1)>=1 AND CROSS(BUY1,C),BUY1,1);
DAYUPBUY2:=BARSLAST(CROSS(C,BUY2));
DRAWICON(COUNT(C>BUY1,DAYUPBUY2)>=1 AND CROSS(BUY2,C),BUY2,1);
DAYUPZC:=BARSLAST(CROSS(C,支撑));
DRAWICON(COUNT(C>BUY2,DAYUPZC)>=1 AND CROSS(支撑,C),支撑,1);
DAYDOWNBUY2:=BARSLAST(CROSS(BUY2,C));
DRAWICON(COUNT(C<支撑,DAYDOWNBUY2)>=1 AND CROSS(C,BUY2),BUY2,2);
DAYDOWNBUY1:=BARSLAST(CROSS(BUY1,C));
DRAWICON(COUNT(C<BUY2,DAYDOWNBUY1)>=1 AND CROSS(C,BUY1),BUY1,2);
DAYDOWNZHONG:=BARSLAST(CROSS(中,C));
DRAWICON(COUNT(C<BUY1,DAYDOWNZHONG)>=1 AND CROSS(C,中),中,2);
DAYDOWNSELL1:=BARSLAST(CROSS(SELL1,C));
DRAWICON(COUNT(C<中,DAYDOWNSELL1)>=1 AND CROSS(C,SELL1),SELL1,2);
DAYDOWNSELL2:=BARSLAST(CROSS(SELL2,C));
DRAWICON(COUNT(C<SELL1,DAYDOWNSELL2)>=1 AND CROSS(C,SELL2),SELL2,2);
DAYDOWNZL:=BARSLAST(CROSS(阻力,C));
DRAWICON(COUNT(C<SELL2,DAYDOWNZL)>=1 AND CROSS(C,阻力),阻力,2);
IF(CLOSE<=BUY2,CLOSE,DRAWNULL),COLORRED,LINETHICK3;
IF(CLOSE>=SELL2,CLOSE,DRAWNULL),COLORYELLOW,LINETHICK3;
|
| | | | |
|