以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]在开仓的那根K线位置显示开仓价格  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=7899)

--  作者:pepsi
--  发布时间:2011/9/6 16:58:53
--  [求助]在开仓的那根K线位置显示开仓价格

如何实现,在开仓的那根K线位置显示开仓价格,这么写好像不对哦。

drawtext(enlong,l,\'enterprice\',COLORred,0);

 


--  作者:王锋
--  发布时间:2011/9/6 19:45:42
--  

数字要转字符串才能被显示

drawtext(enlong,l,numtostr(enterprice),COLORred,0);


--  作者:pepsi
--  发布时间:2011/9/7 10:08:59
--  

公式源码如下,在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);


--  作者:pepsi
--  发布时间:2011/9/7 10:09:40
--  

开仓的位置所显示的字符是 -1 和 -1,咋回事啊


--  作者:just
--  发布时间:2011/9/7 10:37:32
--  
图片点击可在新窗口打开查看
--  作者:just
--  发布时间:2011/9/7 10:37:43
--  

我这里显示正常呀

 


--  作者:pepsi
--  发布时间:2011/9/7 12:02:08
--  
哦,我换台电脑试试,这台电脑权限有限制。
--  作者:pepsi
--  发布时间:2011/9/7 13:35:40
--  
换来一台电脑果然正常显示,看来电脑权限有限制的情况下,金字塔不能正常工作哦
--  作者:chengjun1201
--  发布时间:2015/10/29 9:51:24
--  
drawtext(enlong and ref(holding,1)<0,l,numtostr(enterprice,0),COLORred,0);
drawtext(exlong and ref(holding,1)>0,h,numtostr(enterprice,0),colorgreen,0);