如何实现,在开仓的那根K线位置显示开仓价格,这么写好像不对哦。
drawtext(enlong,l,'enterprice',COLORred,0);
数字要转字符串才能被显示
drawtext(enlong,l,numtostr(enterprice),COLORred,0);
公式源码如下,在K线图中没有显示开仓信号的箭头,并且也没有显示出价格,看下图
MID :=MA(CLOSE,M);
UPPER:=MID + N*STD(CLOSE,M);
LOWER:=MID - N*STD(CLOSE,M);
enlong:=cross(h,ref(upper,1));
exlong:=cross(ref(mid,1),l);
enshort:=cross(ref(lower,1),l);
exshort:=cross(h,ref(mid,1));
if enlong then
buy(holding=0,1,market);
if exlong then
sell(holding=1,0,market);
if enshort then
buyshort(holding=0,1,market);
if exshort then
sellshort(holding=-1,0,market);
drawtext(enlong,l,numtostr(enterprice,0),COLORred,0);
drawtext(exlong,h,numtostr(enterprice,0),colorgreen,0);
开仓的位置所显示的字符是 -1 和 -1,咋回事啊
我这里显示正常呀