之前用文华,换了期货公司,只支持金字塔,现在求帮我改为金字塔公式,感激不尽!!!
思路是这样:用在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);
SP(BUYVOL);
BP(SELLVOL);
这两个是什么意思,
BK(1);--是买开仓?
仅供参考
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
SP(BUYVOL);
BP(SELLVOL);
这两个是什么意思,
BK(1);--是买开仓?
BUYVOL这个,按我的理解是---主动性买单量,不知是否正确?????
SP(BUYVOL),我知道是平多头仓位,但是里面含的这个参数BUYVOL,不知道什么意思
是按对手价平多头仓???
仅供参考
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的开仓,为什么不是只开一手呢?