以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  换月模型程序编写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=56867)

--  作者:phone
--  发布时间:2013/9/23 9:16:20
--  换月模型程序编写
麻烦编写换月模型程序

1.当下月合约当日成交手数>当月合约当日成交手数

则全部多单平仓,并市价委托开下月合约同等数量的多单

空仓也一样。

--  作者:jinzhe
--  发布时间:2013/9/23 9:30:13
--  
这个需要专业版,用户请出示专业版账号
--  作者:phone
--  发布时间:2013/9/23 9:32:40
--  
专业版帐号已通知信息发给你了
[此贴子已经被作者于2013/9/23 9:34:01编辑过]

--  作者:jinzhe
--  发布时间:2013/9/23 9:43:11
--  
处理中
--  作者:jinzhe
--  发布时间:2013/9/23 10:02:45
--  

heyue:=STRLEFT(stklabel ,2 );
dangyue:=strtonum(STRRIGHT(stklabel ,2));
xiayue:=if(dangyue<>12,dangyue+1,1);
dy:=if(dangyue<10,\'0\'+numtostr(dangyue,0),numtostr(dangyue,0));
xy:=if(xiayue<10,\'0\'+numtostr(xiayue,0),numtostr(xiayue,0));

duo:=tbuyholdingex(\'\',strcat(heyue,dy),1);
kong:=tsellholdingex(\'\',strcat(heyue,dy),1);
{drawtext(islastbar,h+4*mindiff,dy);
drawtext(islastbar,l-4*mindiff,xy);
drawtext(barpos=datacount-2,c,heyue);
drawtext(barpos=datacount-3,c,strcat(heyue,dy));
drawtext(barpos=datacount-4,c,strcat(heyue,xy));}
dy_vol_day:=callstock(strcat(heyue,dy),vtvol,6);
xy_vol_day:=callstock(strcat(heyue,xy),vtvol,6);

if xy_vol_day>dy_vol_day  then begin
 tsell(1,duo,mkt,0,0,\'\',strcat(heyue,dy));
 tbuy(tbuyholding(1)=0,duo,mkt,0,0,\'\',strcat(heyue,xy));
end

if xy_vol_day>dy_vol_day then begin
 tsellshort(1,kong,mkt,0,0,\'\',strcat(heyue,dy));
 tbuyshort(tsellholding(1)=0,kong,mkt,0,0,\'\',strcat(heyue,xy));
end


--  作者:jinzhe
--  发布时间:2013/9/23 11:13:46
--  

补充说明一点,这个是要在具体合约上使用的,不能使用在连续合约也就是00合约上