欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → 阿火秘笈_编写技巧十九(12月5日更新_做参数优化时优化指定指标的方法)

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有221790人关注过本帖平板打印复制链接

主题:阿火秘笈_编写技巧十九(12月5日更新_做参数优化时优化指定指标的方法)

帅哥哟,离线,有人找我吗?
阿火
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2011/12/21 9:55:03 [只看该作者]

四、日内满仓反手的写法

因为满仓的情况下,要等平仓单成交、保证金释放后,开仓下单才能成功。

用系统自带的orderqueue在平仓单没有第一时间成交的情况下有一定的局限性,可用如下的方法:

runmode:0;

input:cw(3,1,10,1);

variable:cc=0;

ma5:=ma(c,5);

ma20:=ma(c,20);

entertime:=time>100000 and time<144500;

if holding>0 and cc<=0 then sell(1,cw,limitr,o);

if holding<0 and cc>=0 then sellshort(1,cw,limitr,o);

//此方法撤单和追单时间要控制在出信号的K线时间以内

if holding=0 and cc>0 and cw+tholding2>=cw then buy(1,cw,limitr,o);//平空成交后,"cw+tholding2>=cw "才会成立并开多

if holding=0 and cc<0 and cw-tholding2>=cw then buyshort(1,cw,limitr,o);//平多成交后,"cw-tholding2>=cw "才会成立并开空

if cc>0 and ma5<ma20 then cc:=0;

if cc<0 and ma5>ma20 then cc:=0;

if cc=0 and ma5>ma20 and entertime then cc:=1;

if cc=0 and ma5<ma20 and entertime then cc:=-1;

if time>=150000 then begin

 cc:=0;

end

[此贴子已经被作者于2011-12-21 9:55:23编辑过]

 回到顶部
总数 146 1 2 3 4 5 6 7 8 9 10 下一页 ..15