以文本方式查看主题

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

--  作者:qihuotaiji
--  发布时间:2014/1/1 20:38:05
--  [求助]请老师编一个加仓的模型
c>ma(c,31) and c=hhv(c,9)买入开仓30%仓位;
c<ma(c,10) and c=llv(c,9)卖出平仓;
c<ma(c,31) and c=llv(c,9)卖出开仓30%仓位;
c>ma(c,10) and c=hhv(c,9)买入平仓;
连续亏损3次以后的下一次开仓40%仓位;
连续亏损4次以后的下一次开仓50%仓位;
连续盈利3次以后的下一次开仓20%仓位;
老师这个能完成吗?谢谢

--  作者:jinzhe
--  发布时间:2014/1/2 9:02:54
--  
if c<ma10 and c=llv(c,9) and holding>0 then begin
 sell(1,0,market);
 if numprofit(1)>0 then begin
  n:=n+1;
  m:=0;
 end
 if numprofit(1)<0 then begin
  n:=0;
  m:=m+1;
 end
end