以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  盈利后 回撤  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=78158)

--  作者:qq代人发帖
--  发布时间:2015/4/30 10:41:34
--  盈利后 回撤
盈利达到千九,开仓到现在的最高价回撤百分之三十,止盈 

--  作者:jinzhe
--  发布时间:2015/4/30 10:47:53
--  

hh:=hhv(h,enterbars+1);

if openprofit/ref(asset,enterbars)>=0.009 or (hh-c)/hh>=0.3  then sell(1,0,thisclose);

 

推荐使用走完k线模式下单,如果希望使用固定时间间隔模式,则把(hh-c)/hh>=0.3修改为(hh-l)/hh>=0.3


--  作者:zhanghaihuac
--  发布时间:2015/4/30 11:04:29
--  
 请问我现在有两种平仓方式,我都是想出信号就平,不想等到k线走完,就拿多头来说:
1.千5止损;
2.盈利达到千9时,如果回撤(最高点-开仓价)*0.3,止盈;
这两个条件怎么写呢 

--  作者:zhanghaihuac
--  发布时间:2015/4/30 11:09:51
--  
这里的盈利达到千9是指:开仓以来的最高价>开仓价=开仓价*0.009\'
--  作者:jinzhe
--  发布时间:2015/4/30 11:14:06
--  

1. 多头时:holding>0 and openprofit<0 and abs(openprofit)/ref(asset,enterbars+1)>0.005

    空头时:holding<0 and openprofit<0 and abs(openprofit)/ref(asset,enterbars+1)>0.005

 

2.

 多头时:

hh:=hhv(h,enterbars+1);

openprofit/ref(asset,enterbars)>=0.009 and holding>0 and l<=hh-(hh-enterprice)*0.3

 

空头时:

ll:=llv(l,enterbars+1);

openprofit/ref(asset,enterbars)>=0.009 and holding<0 and h>=ll+(enterprice-ll)*0.3


--  作者:zhanghaihuac
--  发布时间:2015/4/30 13:03:55
--  
请问   前一根满足条件下一根开盘开怎么表示?


--  作者:jinzhe
--  发布时间:2015/4/30 13:15:26
--  

这个就是走完k线


--  作者:zhanghaihuac
--  发布时间:2015/4/30 13:31:04
--  
那刚刚的平仓条件我是想在盘中达到条件就平怎么改呢


--  作者:jinzhe
--  发布时间:2015/4/30 13:32:30
--  
条件加一个ref1,比如如果平仓条件是c>o,那么就改成ref(c>o,1)
--  作者:zhanghaihuac
--  发布时间:2015/4/30 13:39:21
--  
如果满足条件1我开多,满足条件2我也开多,怎么表示啊