Rss & SiteMap

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

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

标题:[求助]求助,这个如何限制只开一手

1楼
victior 发表于:2011/11/29 21:51:13

模型如下,9:59:00这个时间开的仓位如何才能固定只开一手呢?其他时间的开仓都固定了一手,就是这个位置不行啊?

 

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

2楼
阿火 发表于:2011/11/29 21:59:23

奇怪了 仓位固定为1啊

if time=095900 then
begin
buy(holding=0 and C<=ss+17.03,1,market);
buyshort(holding=0 and C>=ss-17.03,1,market);
end

3楼
victior 发表于:2011/11/29 22:03:06

图片点击可在新窗口打开查看

 

 

如图,9:59开的仓位是6手啊?怎样改为只开一手?

4楼
victior 发表于:2011/11/29 22:47:19
终于搞掂了,呵呵!
5楼
lcgs005 发表于:2012/11/4 21:11:17
以下是引用victior在2011-11-29 22:47:19的发言:
终于搞掂了,呵呵!

怎么搞定的,具体说说吧

共5 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.