以下是通达信多空转换简版主图指标公式源码

{月涨跌}
月O:=O#MONTH,NODRAW;
月C:=C#MONTH,NODRAW;
月H:=H#MONTH,NODRAW;
月L:=L#MONTH,NODRAW;

 STICKLINE(月C>=月O,月L,月H,5,0),COLORBROWN;{月涨}
STICKLINE(月C<=月O,月L,月H,5,0),COLORGRAY;{月跌}
 {STICKLINE(月C>=月O,月O,月C,5,0),COLORLIRED;}{月涨}
 {STICKLINE(月C<月O,月O,月C,5,0),COLORLIGREEN;}{月跌};

月开盘价:CONST(O#MONTH),LINETHICK3;

获利盘001%:=REFDATE(CONST(COST(0.001)),DATE),LINETHICK6,COLORYELLOW;
获利盘01%:=REFDATE(CONST(COST(0.01)),DATE),LINETHICK6,COLORYELLOW;
 DRAWBAND(获利盘001%,RGB(250,150,50),获利盘01%,RGB(250,150,50));

获利盘49%:=REFDATE(CONST(COST(49)),DATE),LINETHICK6,COLORYELLOW;
获利盘51%:=REFDATE(CONST(COST(51)),DATE),LINETHICK6,COLORYELLOW;
 DRAWBAND(获利盘49%,RGB(250,150,50),获利盘51%,RGB(250,150,50));

获利盘99.9%:=REFDATE(CONST(COST(99.9)),DATE),LINETHICK6,COLORYELLOW;
获利盘99.99%:=REFDATE(CONST(COST(99.999)),DATE),LINETHICK6,COLORYELLOW;
 DRAWBAND(获利盘99.9%,RGB(250,150,50),获利盘99.99%,RGB(250,150,50));

当期开盘:DOPEN,NODRAW,COLORRED;
当期收盘:DCLOSE,NODRAW,COLORYELLOW;
当期最高:DHIGH,NODRAW,COLORMAGENTA;
当期最低:DLOW,NODRAW,COLORWHITE;

当期上影:DHIGH-MAX(DOPEN,DCLOSE),NODRAW,COLORMAGENTA;
当期下影:MIN(DOPEN,DCLOSE)-DLOW,NODRAW,COLORGREEN;
当期实体:ABS(DCLOSE-DOPEN),NODRAW,COLORRED;
当期涨幅:(DCLOSE-DOPEN)/DOPEN*100,NODRAW,COLORWHITE;
当期波幅:(DHIGH-DLOW)/DLOW*100,NODRAW,COLORMAGENTA;

 STICKLINE(DOPEN<DCLOSE,DHIGH,DLOW,4,0),COLOR33BBBB;
 STICKLINE(DOPEN<DCLOSE,DOPEN,DCLOSE,4,0),COLOR8833CC;
 STICKLINE(DOPEN>DCLOSE,DHIGH,DLOW,4,0),COLORAA3333;
 STICKLINE(DOPEN>DCLOSE,DOPEN,DCLOSE,4,0),COLOR668833;

涨跌周期:BARSLAST(O=DOPEN AND DVOL!=REF(DVOL,1))+1,NODRAW,COLORRED;
 DRAWNUMBER(REFX(涨跌周期,1)<=涨跌周期 OR ISLASTBAR ,DHIGH,涨跌周期);
DRAWTEXT_FIX(1,0.991,0.881,1,STRCAT(‘涨跌周期:’,CON2STR(涨跌周期,2))),COLORGRAY;

 {画K线}
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。