以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  最高浮盈1万,浮盈回撤30%时平仓怎么写?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=65618)

--  作者:qq代人发帖
--  发布时间:2014/5/29 15:33:37
--  最高浮盈1万,浮盈回撤30%时平仓怎么写?
请问该怎么写才能实现:
最高浮盈1万,浮盈回撤30%时平仓?

--  作者:jinzhe
--  发布时间:2014/5/29 15:37:21
--  

if hhv(openprofit,enterbars+1)>10000 and (hhv(openprofit,enterbars+1)-openprofit)/hhv(openprofit,enterbars+1)>=0.3 then begin

     sell(1,0,market);

     sellshort(1,0,market);

end


--  作者:DarthYoda
--  发布时间:2014/5/29 18:12:19
--  
标记一下,正好要用到
--  作者:DarthYoda
--  发布时间:2014/5/31 18:55:57
--  
以下是引用jinzhe在2014/5/29 15:37:21的发言:

if hhv(openprofit,enterbars+1)>10000 and (hhv(openprofit,enterbars+1)-openprofit)/hhv(openprofit,enterbars+1)>=0.3 then begin

     sell(1,0,market);

     sellshort(1,0,market);

end

这个要改为多少跳该如何写,例如盈利超过100跳,则回退30跳止赢