以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  策略编写求助区  (http://weistock.com/bbs/list.asp?boardid=11)
----  求好心人帮忙改为金字塔公式~  (http://weistock.com/bbs/dispbbs.asp?boardid=11&id=9109)

--  作者:victior
--  发布时间:2011/11/23 19:11:36
--  求好心人帮忙改为金字塔公式~

之前用文华,换了期货公司,只支持金字塔,现在求帮我改为金字塔公式,感激不尽!!!

思路是这样:用在1分钟,PTA指数测试,只做日内,限制每日开仓次数,参考9:29的价格,在9:59判断开多还是开空,持仓半小时(因为10:15~10:30休息)后在10:13根据9:59的时候PTA价格判断开多还是开空,平掉相反的仓位;持仓半小时后在10:59根据10:29的时候PTA价格判断开多还是开空、加仓,平掉相反的仓位,如此类推,在14:58平掉所有仓位~

RR0929:VALUEWHEN(TIME=0929,C);
TIME=0959 && C<=RR0929+17.03,BK(1);
TIME=0959 && C>=RR0929-17.03,SK(1);
RR0959:VALUEWHEN(TIME=0959,C);
TIME=1013 && C>=RR0959-17.03,SP(BUYVOL);
TIME=1013 && C<=RR0959+17.03,BP(SELLVOL);
TIME=1013 && C<=RR0959+17.03,BK(1);
TIME=1013 && C>=RR0959-17.03,SK(1);
RR1013:VALUEWHEN(TIME=1013,C);
TIME=1059 && C>=RR1013-17.03,SP(BUYVOL);
TIME=1059 && C<=RR1013+17.03,BP(SELLVOL);
TIME=1059 && C<=RR1013+17.03,BK(1);
TIME=1059 && C>=RR1013-17.03,SK(1);
RR1059:VALUEWHEN(TIME=1059,C);
TIME=1128 && C>=RR1059-17.03,SP(BUYVOL);
TIME=1128 && C<=RR1059+17.03,BP(SELLVOL);
TIME=1128 && C<=RR1059+17.03,BK(1);
TIME=1128 && C>=RR1059-17.03,SK(1);
RR1128:VALUEWHEN(TIME=1128,C);
TIME=1359 && C>=RR1128-17.03,SP(BUYVOL);
TIME=1359 && C<=RR1128+17.03,BP(SELLVOL);
TIME=1359 && C<=RR1128+17.03,BK(1);
TIME=1359 && C>=RR1128-17.03,SK(1);
RR1359:VALUEWHEN(TIME=1359,C);
TIME=1429 && C>=RR1359-17.03,SP(BUYVOL);
TIME=1429 && C<=RR1359+17.03,BP(SELLVOL);
TIME=1429 && C<=RR1359+17.03,BK(1);
TIME=1429 && C>=RR1359-17.03,SK(1);
TIME=1458,SP(BUYVOL);
TIME=1458,BP(SELLVOL);

 


--  作者:26327756l
--  发布时间:2011/11/24 10:23:07
--  
问题正在解决中
--  作者:fly
--  发布时间:2011/11/24 10:23:39
--  

SP(BUYVOL);

BP(SELLVOL);
这两个是什么意思,

 

BK(1);--是买开仓?


--  作者:26327756l
--  发布时间:2011/11/24 11:02:36
--  

仅供参考

ss:=REFDATE(CLOSE,date,092900);
if time=095900 then
begin
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,0,market);
end
ss:=REFDATE(CLOSE,date,095900);
if time=101300 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,101300);
if time=105900 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,105900);
if time=112800 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,112800);
if time=135900 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,135900);
if time=142900 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end

if time=145800 then
begin
sellshort(holding<0 ,0,market);
sell(holding>0 ,0,market);
end


--  作者:victior
--  发布时间:2011/11/26 9:34:30
--  
以下是引用fly在2011-11-24 10:23:39的发言:

SP(BUYVOL);

BP(SELLVOL);
这两个是什么意思,

 

BK(1);--是买开仓?

SP(BUYVOL)=平多头仓位 BP(SELLVOL)=平空头仓位 BK(1),开一手仓位,是文华WH3的语句~
--  作者:victior
--  发布时间:2011/11/26 9:34:44
--  
谢谢楼上几个好心人!!!
--  作者:fly
--  发布时间:2011/11/28 15:19:45
--  

BUYVOL这个,按我的理解是---主动性买单量,不知是否正确?????

SP(BUYVOL),我知道是平多头仓位,但是里面含的这个参数BUYVOL,不知道什么意思

                   是按对手价平多头仓???


--  作者:victior
--  发布时间:2011/11/29 21:26:58
--  
以下是引用26327756l在2011-11-24 11:02:36的发言:

仅供参考

ss:=REFDATE(CLOSE,date,092900);
if time=095900 then
begin
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,0,market);
end
ss:=REFDATE(CLOSE,date,095900);
if time=101300 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,101300);
if time=105900 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,105900);
if time=112800 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,112800);
if time=135900 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end
ss:=REFDATE(CLOSE,date,135900);
if time=142900 then
begin
sellshort(holding<0 and  C>=ss-17.03,0,market);
sell(holding>0 and C<=ss+17.03,0,market);
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end

if time=145800 then
begin
sellshort(holding<0 ,0,market);
sell(holding>0 ,0,market);
end

请教,你这个的在9:59的开仓,为什么不是只开一手呢?


--  作者:蔡宛宏
--  发布时间:2011/12/19 16:53:30
--  
时间过滤的模型 不知道效果怎么样