-- 作者: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 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/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的开仓,为什么不是只开一手呢?
|