Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共9 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求好心人帮忙改为金字塔公式~

1楼
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);

 

2楼
26327756l 发表于:2011/11/24 10:23:07
问题正在解决中
3楼
fly 发表于:2011/11/24 10:23:39

SP(BUYVOL);

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

 

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

4楼
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

5楼
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的语句~
6楼
victior 发表于:2011/11/26 9:34:44
谢谢楼上几个好心人!!!
7楼
fly 发表于:2011/11/28 15:19:45

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

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

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

8楼
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的开仓,为什么不是只开一手呢?

9楼
蔡宛宏 发表于:2011/12/19 16:53:30
时间过滤的模型 不知道效果怎么样
共9 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 5.10938 s, 2 queries.