以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]平推如何编写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=78387)

--  作者:xiaosa2003
--  发布时间:2015/5/8 9:36:53
--  [求助]平推如何编写
例如浮盈>10000,以开仓价作为止损点?
--  作者:jinzhe
--  发布时间:2015/5/8 9:38:18
--  

if openprofit>10000 and holding>0 then sell(1,0,limitr,enterprice);

if openprofit>10000 and holding<0 then sellshort(1,0,limitr,enterprice);


--  作者:xiaosa2003
--  发布时间:2015/5/8 9:49:10
--  
你这个是浮盈大于1W,用开仓价平仓吧
我的意思是,如果浮盈大于1W后,价格回到开仓价平仓

--  作者:jinzhe
--  发布时间:2015/5/8 9:58:09
--  

if hhv(openprofit,enterbars+1)>10000 and holding>0  and c<enterprice then sell(1,0,market);

if hhv(openprofit,enterbars+1)>10000 and holding<0  and c>enterprice then sellshort(1,0,market);

走完k线模式下的方法

 

如果是固定轮询模式则要改为l<enterprice 和 h>enterprice


--  作者:xiaosa2003
--  发布时间:2015/5/8 10:21:52
--  
HHV 函数在逐K线模式下不能直接在IF控制语句之内引用。
看了帮助,没看懂

--  作者:jinzhe
--  发布时间:2015/5/8 10:25:23
--  

说明你把我的这段代码嵌套进了一个if判断内

把这段话单独拿出来,不要放在if判断之内