Rss & SiteMap

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

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

标题:平仓再开仓,不能成交为什么?

1楼
厚德载物 发表于:2013/9/23 15:26:01
BC1:=HOLDING>0 AND X>0
BC2:=HOLDING=0 AND X>0
SELL(BC1,HOLDING,THISCLOSE),ORDERQUEUE;
BUYSHORT(BC2,1,MARKET),ORDERQUEUE;
BUYSHORT执行不了,为什么?
2楼
fly 发表于:2013/9/23 16:42:14

怎么没有平空开多的指令.

给您提供个简单代码,供您参考

 

buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);

//平空

if holding<0 and buycond  then sellshort(1,1,market);

 

//开多
if buycond  and holding=0  then
 begin
 buy(1,1,market);
 end
 

//平多
if holding>0 and sellcond  then sell(1,1,market); 

//开空
if holding=0 and sellcond  then buyshort(1,1,market),;

3楼
厚德载物 发表于:2013/9/23 20:01:55

你回答我的问题了吗?

 

我的代码有什么错误?

4楼
jinzhe 发表于:2013/9/24 9:05:42

你策略一共就这么点代码?

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


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