以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  [求助]盈利>=+0.5%,回撤382全部退出; 单品种  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=68968)

--  作者:帅哥周
--  发布时间:2014/8/20 10:25:59
--  [求助]盈利>=+0.5%,回撤382全部退出; 单品种

盈利>=+0.5%,回撤382全部退出 单品种。


--  作者:帅哥周
--  发布时间:2014/8/20 10:32:34
--  
这个怎么写呀?
--  作者:pyd
--  发布时间:2014/8/20 10:38:52
--  

//多头
VARIABLE:n=0,m=0;
hh:hhv(h,enterbars+1);
if hh-enterprice>=0.5*enterprice then n:=1;
if n=1 and hh-l>=382 and holding>0 then
begin
 sell(1,holding,market);
 n:=0;
 end
 //空头
 ll:llv(l,enterbars+1);
 if enterprice-ll>=0.5*enterprice then m:=1;
 if m=1 and h-ll>=382 and holding<0 then
 BEGIN
 sellshort(1,1,market);
 m:=0;
 end