飞狐个股盈亏显示在副图公式
参数:佣金 0.5 0.1 5
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
EXPLAIN(1, STRMID(STKLABEL,1,6)),LINETHICK;
进价:=SELFDATA('持仓股');
股数:=SELFDATA('持仓量');
买入价:进价,LINETHICK,COLORFFFFFF;
保本价:进价*(1.001+佣金*2/1000)+0.001,LINETHICK,COLOR00FF00;//默认佣金:万分之五 调整到自己的实际佣金
盈亏:(DYNAINFO( 7)-保本价)*股数,LINETHICK,COLORFFFF;//保本价=进价*(印花税+佣金*2/1000)+0.001(过户费可不计入)
每股盈亏:(DYNAINFO( 7)-保本价),LINETHICK,COLORFFFFFF;
A:=BARPOS; B:=DATACOUNT; A2:=SYSPARAM(2); A3:=SYSPARAM(3); HM:=A3-A2;
HQ:=HHV(HIGH,HM);
LQ:=LLV(LOW,HM);
ZH:=HQ[B];
ZL:=LQ[B];
Q:=(ZH-ZL)/10;
MM:=HM/100;
DW:=A=A3-ROUND(MM*95);
DRAWTEXT(DW, 0.15 ,'买入价'+NUMTOSTR(进价,2)+' 持仓量'+NUMTOSTR(股数,0)),COLORFFFFFF,ALIGN1;
DRAWTEXT(DW, -0.15 ,'保本价'+NUMTOSTR(保本价,2)+' 总盈亏'+NUMTOSTR(盈亏,2)),COLORFFFFFF,ALIGN5;