股票配资网欢迎您

通达信账户动态指标公式

股票公式 2020-03-31 08:43

LINE:=0.1;
ROW:=0.05;
J1:=12.29;
S1:=300;
J2:=9.88;
S2:=410;
J3:=7.48;
S3:=200;
J4:=7.83;
S4:=300;
J5:=5;
S5:=500;
{横线}
{DRAWRECTREL(0,0,400,700,0);DRAWRECTREL(0,100,400,600,0);DRAWRECTREL(0,200,400,500,0);DRAWRECTREL(0,300,400,400,0);
{竖线}
{DRAWRECTREL(50,0,400,700,0);DRAWRECTREL(100,0,350,700,0);DRAWRECTREL(150,0,300,700,0);
DRAWRECTREL(200,0,250,700,0);}
DRAWTEXT_FIX(ISLASTBAR,0,0,0,'持股代码'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*1,0,0,'持股数量'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*2,0,0,'持股价格'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*3,0,0,'当前价格'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*4,0,0,'最新市值'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*5,0,0,'浮动盈亏'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*6,0,0,'盈亏比例'),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,ROW*7,0,0,'当日盈亏'),COLORYELLOW;
{ 持股 1}
持股价1:=J1; 持股量1:=S1;{参数J1,S1分别是持股价格和持股数量,可以在参数表里改动}
当前价1:="600856$CLOSE"; 昨收价1:=REF("600856$CLOSE",1);{自己的股票替换红色的股票代码}
最新市值1:=当前价1*持股量1; 浮动盈亏1:=最新市值1-持股价1*持股量1; 买入日期1:=1180110;{买入日期替换为自己的,前面的代表的是18年01月08日}
盈亏比例1:=浮动盈亏1/(持股价1*持股量1)*100; 当日盈亏1:=(当前价1-昨收价1)*持股量1*NOT(买入日期1=DATE);
清仓1:=NOT(0);{当清仓时为1,否则将1改为0}
DRAWTEXT_FIX(ISLASTBAR AND 清仓1 ,0,LINE*1,0,'600856');
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*1,LINE*1,0,CON2STR(持股量1,0));
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*2,LINE*1,0,CON2STR(持股价1,2));
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*3,LINE*1,0,CON2STR(当前价1,2));
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*4,LINE*1,0,CON2STR(最新市值1,0));
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*5,LINE*1,0,CON2STR(浮动盈亏1,0));
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*6,LINE*1,0,CON2STR(盈亏比例1,2));
DRAWTEXT_FIX(ISLASTBAR AND 清仓1,ROW*7+0.01,LINE*1,0,CON2STR(当日盈亏1,0));
{ 持股2 }
持股价2:=J2 ; 持股量2:=S2; 当前价2:="000523$CLOSE";昨收价2:=REF("000523$CLOSE",1);
最新市值2:=当前价2*持股量2; 浮动盈亏2:=最新市值2-持股价2*持股量2;盈亏比例2:=浮动盈亏2/(持股价2*持股量2)*100;
买入日期2:=1171001;当日盈亏2:=(当前价2-昨收价2)*持股量2*NOT(买入日期2=DATE);
清仓2:=NOT(0);
DRAWTEXT_FIX(ISLASTBAR AND 清仓2,0,LINE*2,0,'000523');
DRAWTEXT_FIX(ISLASTBAR AND 清仓2,ROW*1,LINE*2,0,CON2STR(持股量2,0));
DRAWTEXT_FIX(ISLASTBAR AND 清仓2,ROW*2,LINE*2,0,CON2STR(持股价2,2));
DRAWTEXT_FIX(ISLASTBAR AND 清仓2,ROW*3,LINE*2,0,CON2STR(当前价2,2));
DRAWTEXT_FIX(ISLASTBAR AND 清仓2,ROW*4,LINE*2,0,CON2STR(最新市值2,0));
DRAWTEXT_FIX(ISLASTBAR AND 清仓2,ROW*5,LINE*2,0,CON2STR(浮动盈亏2,0));

上一篇:通达信个股与指数比对指标公式 下一篇:没有了