股票软件通达信精品指标公式-智能财富盈亏指标源码通达信公式
公式源码:
现手买:=BUYVOL*DYNAINFO(7)*100/10000 COLOR0000FF,NODRAW;
现手卖:=SELLVOL*DYNAINFO(7)*100/10000 COLOR00FF00,NODRAW;
合:=ABS(现手买)+ABS(现手卖)COLOR80FFFF,NODRAW;
差:=ABS(现手买)-ABS(现手卖)COLOR80FFFF,NODRAW;
MPB1:=ABS(现手买)/合*100;
MPB2:=ABS(现手卖)/合*100;
TESTSKIP(NOT(现手买 OR 现手卖 OR 合 OR 差 OR MPB1 OR MPB2)!=0);
DRAWRECTREL(100,1000,400,940,RGB(190,190,190));
DRAWRECTREL(100,995,400,945,RGB(200,200,200));
DRAWRECTREL(100,990,400,950,RGB(210,210,210));
DRAWRECTREL(100,985,400,955,RGB(220,220,220));
DRAWRECTREL(100,980,400,960,RGB(230,230,230));
DRAWRECTREL(100,975,400,965,RGB(240,240,240));
DRAWRECTREL(100,970,400,970,RGB(250,250,250));
DRAWRECTREL(250-现手卖*200/合,1000,250,940,RGB(0,128,0));
DRAWRECTREL(250-现手卖*200/合,995,250,945,RGB(0,148,0));
DRAWRECTREL(250-现手卖*200/合,990,250,950,RGB(0,168,0));
DRAWRECTREL(250-现手卖*200/合,985,250,955,RGB(0,188,0));
DRAWRECTREL(250-现手卖*200/合,980,250,960,RGB(0,208,0));
DRAWRECTREL(250-现手卖*200/合,975,250,965,RGB(0,228,0));
DRAWRECTREL(250-现手卖*200/合,970,250,970,RGB(0,248,0));
DRAWRECTREL(250,1000,250+现手买*200/合,940,RGB(128,0,0));
DRAWRECTREL(250,995,250+现手买*200/合,945,RGB(148,0,0));
DRAWRECTREL(250,990,250+现手买*200/合,950,RGB(168,0,0));
DRAWRECTREL(250,985,250+现手买*200/合,955,RGB(188,0,0));
DRAWRECTREL(250,980,250+现手买*200/合,960,RGB(208,0,0));
DRAWRECTREL(250,975,250+现手买*200/合,965,RGB(228,0,0));
DRAWRECTREL(99.8,1000.2,99.8,939.8,RGB(250,250,0));{左}
DRAWRECTREL(400.2,939.8,400.2,1000.2,RGB(250,250,0));{右}
DRAWRECTREL(99.8,939.8,400.2,939.8,RGB(250,250,0));{上}
DRAWRECTREL(250,1000,250,940,RGB(250,250,0));{中}
DRAWTEXT_FIX(1,0.38,0.9,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),COLORFF00FF;
DRAWTEXT_FIX(1,0.08,0.9,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),COLORFFFF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)>0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLORFF00FF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)<0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLOR00FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)=0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLORFFFF00;
DRAWTEXT_FIX(1,0.048,0.95,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%%')),COLORFFFF00;
DRAWTEXT_FIX(1,0.408,0.95,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%%')),COLORFF00FF;
代码1:=CODELIKE('000625');{分别在年、月、日及买入价位、买入股数等处填入实际数据}
买入时间1:=YEAR{年}=2013 AND MONTH{月}=5 AND DAY{日}=22;
买入价位1:=10.65;
买入股数1:=100;
天数1:=BARSLAST(买入时间1);
{第二只个股,填入代码、买入时间、价位及股数}
代码2:=CODELIKE('0');{在[0]位置处填写个股代码}
买入时间2:=YEAR{年}=2013 AND MONTH {月}=0 AND DAY{日}=0;
买入价位2:=0;
买入股数2:=0;
天数2:=BARSLAST(买入时间2);
{第三只个股,填入代码、买入时间、价位及股数}
代码3:=CODELIKE('0');
买入时间3:=YEAR{年}=0 AND MONTH{月}=0 AND DAY{日}=0;
买入价位3:=0;
买入股数3:=0;
天数3:=BARSLAST(买入时间3);
{1}
买入个股时间1:=IF(代码1,买入时间1,0);
买入价格1:=IF(买入个股时间1,买入价位1,0);
买入价1:=REF(买入价位1,BARSLAST(买入个股时间1));
现价1:=IF(BARSLAST(买入个股时间1)+1>=1,CONST(C),0);
最高价条件1:=IF(BARSLAST(买入个股时间1)+1>=1,H=HHV(H,BARSLAST(买入个股时间1)+1),0);
最高价横线1:=IF(BARSLAST(最高价条件1)>=0 AND BARSLAST(买入个股时间1)+1>=1,CONST(REF(H,BARSLAST(最高价条件1))),0);
最低价条件1:=IF(BARSLAST(买入个股时间1)+1>=1,L=LLV(L,BARSLAST(买入个股时间1)+1),0);
最低价横线1:=IF(BARSLAST(最低价条件1)+1>=1 AND BARSLAST(买入个股时间1)+1>=1,
CONST(REF(L,BARSLAST(最低价条件1))),0);
{2}
买入个股时间2:=IF(代码2,买入时间2,0);
买入价格2:=IF(买入个股时间2,买入价位2,0);
买入价2:=REF(买入价位2,BARSLAST(买入个股时间2));
现价2:=IF(BARSLAST(买入个股时间2)+1>=1,CONST(C),0);
最高价条件2:=IF(BARSLAST(买入个股时间2)+1>=1,H=HHV(H,BARSLAST(买入个股时间2)+1),0);
最高价横线2:=IF(BARSLAST(最高价条件2)+1>=1 AND BARSLAST(买入个股时间2)+1>=1,
CONST(REF(H,BARSLAST(最高价条件2))),0);
最低价条件2:=IF(BARSLAST(买入个股时间2)+1>=1,L=LLV(L,BARSLAST(买入个股时间2)+1),0);
最低价横线2:=IF(BARSLAST(最低价条件2)+1>=1 AND BARSLAST(买入个股时间2)+1>=1,
CONST(REF(L,BARSLAST(最低价条件2))),0);
{3}
买入个股时间3:=IF(代码3,买入时间3,0);
买入价格3:=IF(买入个股时间3,买入价位3,0);
买入价3:=REF(买入价位3,BARSLAST(买入个股时间3));
现价3:=IF(BARSLAST(买入个股时间3)+1>=1,CONST(C),0);
最高价条件3:=IF(BARSLAST(买入个股时间3)+1>=1,H=HHV(H,BARSLAST(买入个股时间3)+1),0);
最高价横线3:=IF(BARSLAST(最高价条件3)+1>=1 AND BARSLAST(买入个股时间3)>=0,
CONST(REF(H,BARSLAST(最高价条件3))),0);
最低价条件3:=IF(BARSLAST(买入个股时间3)+1>=1,L=LLV(L,BARSLAST(买入个股时间3)+1),0);
最低价横线3:=IF(BARSLAST(最低价条件3)+1>=1 AND BARSLAST(买入个股时间3)+1>=1,
CONST(REF(L,BARSLAST(最低价条件3))),0);
持股数量【股】:IF(代码1,买入股数1,IF(代码2,买入股数2,IF(代码3,买入股数3,DRAWNULL))),NODRAW;
持股天数:IF(代码1,天数1,IF(代码2,天数2,IF(代码3,天数3,DRAWNULL))),NODRAW;
最高价:=IF(代码1,最高价横线1,IF(代码2,最高价横线2,IF(代码3,最高价横线3,DRAWNULL))),COLOR00FFFF,LINETHICK2;
最低价:=IF(代码1,最低价横线1,IF(代码2,最低价横线2,IF(代码3,最低价横线3,DRAWNULL))),COLORFF0000,LINETHICK2;
买入价:IF(代码1,买入价1,IF(代码2,买入价2,IF(代码3,买入价3,DRAWNULL))),COLORFF00FF,LINETHICK4;
现价:IF(代码1,现价1,IF(代码2,现价2,IF(代码3,现价3,DRAWNULL))),COLORFFFF00,LINETHICK2;
买入时间:=IF(代码1,买入时间1,IF(代码2,买入时间2,IF(代码3,买入时间3,DRAWNULL)));
股数:=IF(代码1,买入股数1,IF(代码2,买入股数2,IF(代码3,买入股数3,DRAWNULL)));
DRAWBAND(现价,RGB(150,0,0),买入价,RGB(0,180,180));
DRAWBAND(买入价,RGB(0,180,180),买入价,RGB(0,180,180));
DRAWBAND(现价,RGB(180,0,180),现价,RGB(180,0,180));
DRAWKLINE(H,O,L,C);
OZ:=DYNAINFO(3)*0.85,COLOR0000FF;
RSVV:=(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100;
VARB2:=(RSVV/2+22)*1;
VAR1T:=EMA(VOL,13);
VAR2T:=EMA(AMOUNT,13);
VAR3T:=((VAR2T /VAR1T) / 100);
VAR4T:=(((CLOSE -VAR3T) / VAR3T) * 100);
VAR5T:=((VAR4T < (0)) AND ZXNH),COLORRED;
VAR6T:=VAR5T AND RSVV<VARB2-2;
DRAWICON(VAR6T>0,L*0.995,34);
DRAWTEXT(VAR6T>0,L*0.99,'买'),COLOR00FFFF;
K:=(C+H+L)/3;
D:=EMA(K,4);
VAR1X:=REF(EMA(K,4),1)COLORMAGENTA,LINETHICK2;
VARXX:=(EMA(K,4)-VAR1X)/VAR1X*100,NODRAW;
VAR2X:IF(VARXX>=0,REF(EMA(K,4),BARSLAST(CROSS(VARXX,0))+1),DRAWNULL)COLORFF00FF,LINETHICK2;
VAR3X:IF(VARXX<0,REF(EMA(K,4),BARSLAST(CROSS(0,VARXX))+1),DRAWNULL)COLOR00FF00,LINETHICK2;
STICKLINE(VARXX>=0,VAR2X,VAR1X,0,0)COLORFF00FF;
STICKLINE(VARXX<0,VAR3X,VAR1X,0,0)COLOR00FF00;
STICKLINE(CROSS(VARXX,0),C,O,2,0)COLORYELLOW;
STICKLINE(CROSS(0,VARXX),C,O,2,0)COLORGREEN;
操盘线:VAR1X,COLORFF00FF,LINETHICK4;
IF(VARXX<0,VAR1X,DRAWNULL)COLOR00FF00,LINETHICK4;
D1:=YEAR AND MONTH AND DAY;
AA1:=STRCAT(CON2STR(YEAR,0),'年');
AA2:=STRCAT(CON2STR(MONTH,0),'月');
AA3:=STRCAT(CON2STR(DAY,0),'日');
AA4:=STRCAT('【',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三','日'))));
AA5:=STRCAT(STRCAT(STRCAT(AA1,AA2),STRCAT(AA3,AA4)),'】');
DRAWTEXT_FIX(D1,0.78,0,0,AA5),COLORFFFF00;
现赢利:=(现价-买入价)/买入价*100;
金额:=买入价*现赢利*股数/100;
WW3:=STRCAT(STRCAT(STRCAT(STRCAT(STRCAT('【','现赢利'),'】'),':'),CON2STR(现赢利,2)),'﹪');
WW4:=STRCAT(STRCAT(STRCAT(STRCAT(STRCAT('【','现亏损'),'】'),':'),CON2STR(现赢利,2)),'﹪');
WW5:=STRCAT(STRCAT(STRCAT(STRCAT(STRCAT('【','利润'),'】'),':'),CON2STR(金额,0)),'元');
WW6:=STRCAT(STRCAT(STRCAT(STRCAT(STRCAT('【','亏损'),'】'),':'),CON2STR(金额,0)),'元');
DRAWTEXT_FIX(HHV(H,80)=最高价 AND 现价>=买入价,0.64,1,0,WW3),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND (HHV(H,80)>最高价 OR HHV(H,80)<最高价) AND 最高价>0 AND
现价>=买入价,0.67,1,0,WW3),COLORRED;
DRAWTEXT_FIX(HHV(H,80)=最高价 AND 现价<买入价,0.64,1,0,WW4),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR AND (HHV(H,80)>最高价 OR HHV(H,80)<最高价) AND 最高价>0 AND
现价<买入价,0.67,1,0,WW4),COLORGREEN;
DRAWTEXT_FIX(HHV(H,80)=最高价 AND 现价>=买入价,0.8,1,0,WW5),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND (HHV(H,80)>最高价 OR HHV(H,80)<最高价) AND 最高价>0 AND
现价>=买入价,0.83,1,0,WW5),COLORYELLOW;
DRAWTEXT_FIX(HHV(H,80)=最高价 AND 现价<买入价,0.8,1,0,WW6),COLORWHITE;
DRAWTEXT_FIX(ISLASTBAR AND (HHV(H,80)>最高价 OR HHV(H,80)<最高价) AND 最高价>0 AND
现价<买入价,0.83,1,0,WW6),COLORWHITE;
DRAWNUMBER(ISLASTBAR,C,C),COLOR00FFFF;
特别提示:
选股预警指标编写 ,不同主流行情软件间指标转换。 请联系微信:396950280
一个聚百万原创指标公式圈子