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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 呼叫阿火版主

   

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


  共有2611人关注过本帖树形打印复制链接

主题:呼叫阿火版主

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


加好友 发短信
等级:新手上路 帖子:40 积分:205 威望:0 精华:0 注册:2013/3/20 12:30:44
呼叫阿火版主  发帖心情 Post By:2013/3/26 10:21:20    Post IP:222.210.88.152[只看该作者]

阿火版主,你的这个模型,我试过怎么开仓好像有漏单现象呢。请再开下。谢谢

 

七、把各种模型组合成一个模型的方法,适用于所有模型,即便是“即时下单模型”。

    对于信号在同一个点位的模型(比如都是开盘价),可以实盘图表化交易

     说明:因为图表交易同一根K线出现2个开多信号的话,只会开一次,另外一个无法执行,但是可以做历时回测

             组合起来的模型,加入后台下单语句,就可以用于后台下单,当然,后台下单用“后台下单模板”会更好用。

     方法原理:计算每个时点要下单的手数和方向,再根据holding判断出要平仓和开仓的数量,然后再下单。

看起来很多,其实很简单,最基本得模块就是蓝色部分

input:cang1(1,0,10,1),cang2(1,0,10,1);
variable:cc1=0,cc2=0;

/////////////////////////////////模型1——10周期反手
hi:=ref(hhv(h,10),1);
lo:=ref(llv(l,10),1);
if cc1>0 and l<lo then begin
 pc:=min(max(holding,0),cang1);
 kc:=cang1-pc;
 if pc>0 then sell(1,pc,limitr,min(o,lo-0.2)-0.6);
 if kc>0 then buyshort(1,kc,limitr,min(o,lo-0.2)-0.6);
 cc1:=0;
end
if cc1<0 and h>hi then begin
 pc:=min(abs(min(holding,0)),cang1);
 kc:=cang1-pc;
 if pc>0 then sellshort(1,pc,limitr,max(o,hi+0.2)+0.6);
 if kc>0 then buy(1,kc,limitr,max(o,hi+0.2)+0.6);
 cc1:=0;
end
if cc1=0 and h>hi then begin
 pc:=min(abs(min(holding,0)),cang1);
 kc:=cang1-pc;
 if pc>0 then sellshort(1,pc,limitr,max(o,hi+0.2)+0.6);
 if kc>0 then buy(1,kc,limitr,max(o,hi+0.2)+0.6);
 cc1:=1;
end
if cc1=0 and l<lo then begin
 pc:=min(max(holding,0),cang1);
 kc:=cang1-pc;
 if pc>0 then sell(1,pc,limitr,min(o,lo-0.2)-0.6);
 if kc>0 then buyshort(1,kc,limitr,min(o,lo-0.2)-0.6);
 cc1:=-1;
end

/////////////////////////////////以上是模型1

/////////////////////////////////模型2——20周期反手
hi:=ref(hhv(h,20),1);
lo:=ref(llv(l,20),1);
if cc2>0 and l<lo then begin
 pc:=min(max(holding,0),cang2);
 kc:=cang2-pc;
 if pc>0 then sell(1,pc,limitr,min(o,lo-0.2)-0.6);
 if kc>0 then buyshort(1,kc,limitr,min(o,lo-0.2)-0.6);
 cc2:=0;
end
if cc2<0 and h>hi then begin
 pc:=min(abs(min(holding,0)),cang2);
 kc:=cang2-pc;
 if pc>0 then sellshort(1,pc,limitr,max(o,hi+0.2)+0.6);
 if kc>0 then buy(1,kc,limitr,max(o,hi+0.2)+0.6);
 cc2:=0;
end
if cc2=0 and h>hi then begin
 pc:=min(abs(min(holding,0)),cang2);
 kc:=cang2-pc;
 if pc>0 then sellshort(1,pc,limitr,max(o,hi+0.2)+0.6);
 if kc>0 then buy(1,kc,limitr,max(o,hi+0.2)+0.6);
 cc2:=1;
end
if cc2=0 and l<lo then begin
 pc:=min(max(holding,0),cang2);
 kc:=cang2-pc;
 if pc>0 then sell(1,pc,limitr,min(o,lo-0.2)-0.6);
 if kc>0 then buyshort(1,kc,limitr,min(o,lo-0.2)-0.6);
 cc2:=-1;
end

/////////////////////////////////以上是模型2

//有更多的模型,往后面添加即可

 


 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/3/26 10:56:10    Post IP:58.246.57.26[只看该作者]

使用日志方式完善您的策略 

 http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=49428



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
美女呀,离线,留言给我吧!
jiangsen
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:992 积分:4305 威望:0 精华:0 注册:2012/8/3 10:50:38
  发帖心情 Post By:2013/3/28 17:57:03    Post IP:211.95.61.36[只看该作者]

别动不动就找阿火

 回到顶部