以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  程序本来是要多,要么空,要么没有单,可今天出现了一个情况  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=53324)

--  作者:大灰狼
--  发布时间:2013/6/24 17:05:52
--  程序本来是要多,要么空,要么没有单,可今天出现了一个情况
在逻辑上或语句上有什么问题,程序本来是要多,要么空,要么没有单,可今天出现了一个情况,

//开多
if dblcom then begin                 
        sellshort(holding<0,holding,market),orderqueue;
        buy(holding=0,sv,market);
              end  else begin
              if (long and not(ddblcom)) then begin
                 sellshort(holding<0,0,market),orderqueue;
                 buy(holding=0,sv,market);
                       end
                  end 
//开空                     
if ddblcom then begin                     
                 sell(holding>0,0,market),orderqueue;
                 buyshort(holding=0,sv,market); 
                end else  begin 
                     if (short and  not(dblcom)) then begin
                     sell(holding>0,0,market),orderqueue;
                     buyshort(holding=0,sv,market);
                                  end 
                           end       
//平多
if longX then begin
    sell(holding>0,0,market);
     end
   
  //平空
  if shortX then begin
     sellshort(holding<0,0,market); 
       end  
36  17:03:48
先开了多,随后又平多开空,可是帐户上多单还在。

--  作者:jinzhe
--  发布时间:2013/6/25 9:22:18
--  
模拟交易还是实盘交易?有没有记录下单日志?