自己製作個指標放到圖表上即可。指標程式碼如下:
var:EP(""),color(0);
if i_MarketPosition<>0 then
EP= numtostr(i_AvgEntryPrice,0)+"x"+NumToStr(i_currentcontracts,0)
else
EP= "EmptyNow";
if i_MarketPosition>0 then color=RGB(255,0,0);
if i_MarketPosition<0 then color=RGB(0,255,0);
if i_MarketPosition=0 then color=RGB(100,100,100);
{Show position on Chart...start}
text_delete(Value95);
Value95=TEXT_New(D, T, H,"");
TEXT_SetString(Value95, EP);
TEXT_SetColor(Value95, color);
TEXT_SetStyle(Value95, 1, 1);
TEXT_Setattribute(Value95,1,true);
TEXT_SetSize(Value95,13);
TEXT_Setlocation(Value95,D,T,GetAppInfo(aiHighestDispValue));
{Show position on Chart...end}
呈現的效果就像這樣,綠色表示空單、紅色多單、空手顯示 EmptyNow: