以文本方式查看主题

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

--  作者:wocool100
--  发布时间:2015/8/4 14:32:17
--  请教一个问题
老师你好,请问这个怎么写。 

 盈利100点回撤40点止盈,盈利200点回撤60点止盈, 盈利300点以上回撤20%止盈

--  作者:jinzhe
--  发布时间:2015/8/4 14:35:59
--  

以开多为例:

if holding>0 and hhv(h,enterbars+1)-enterprice>100 and hhv(h,enterbars+1)-enterprice<200 and l<hhv(h,enterbars+1)-40 then sell.........;

 

if holding>0 and hhv(h,enterbars+1)-enterprice>=200 and hhv(h,enterbars+1)-enterprice<300 and l<hhv(h,enterbars+1)-60 then sell.........;

 

if holding>0 and hhv(h,enterbars+1)-enterprice>=300 and l<hhv(h,enterbars+1)-300*0.2 then sell.........;


--  作者:wocool100
--  发布时间:2015/8/4 14:44:44
--  
谢谢。 另外再问下。 MA5余MA10金叉加仓一次怎么写。  
DD1:=CROSS(MA5,MA10);
加多:BUY(DD1 AND HOLDING>0,1,THISCLOSE);  


我这样写的,但是模型一直加仓 

--  作者:jinzhe
--  发布时间:2015/8/4 14:46:06
--  
如果你开多是开多1手,那么加多的时候holding判断写为holding=1