以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  两个开仓方法同时满足即开两次,如何让软件只开一次仓  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=57700)

--  作者:panjia1000
--  发布时间:2013/10/17 21:34:47
--  两个开仓方法同时满足即开两次,如何让软件只开一次仓

 
 if  vol_1>=vol_2+vol_3+vol_4 and c_1<o_1-n6  then 
 begin
  buySHORT(1,lots,limitr,open),IGNORECHECKPRICE;
 HigherAfterEntry:=enterprice;
 LowerAfterEntry:=enterprice;
   end
  
if  vol_1>=avvol*3 and c_1<o_1-n7  then 
  
  begin
  buyshort(1,lots,limitr,open);
 HigherAfterEntry:=enterprice;
 LowerAfterEntry:=enterprice;
   end

 以上两个开仓条件同时满足软件就开了两次仓,而我只要求开一次


--  作者:jinzhe
--  发布时间:2013/10/18 8:57:29
--  

variable:n=0

if  vol_1>=vol_2+vol_3+vol_4 and c_1<o_1-n6   and n=0 then 
 begin
  buySHORT(1,lots,limitr,open),IGNORECHECKPRICE;
 HigherAfterEntry:=enterprice;
 LowerAfterEntry:=enterprice;

n:=1;
   end
  
if  vol_1>=avvol*3 and c_1<o_1-n7  and n=0 then 
  
  begin
  buyshort(1,lots,limitr,open);
 HigherAfterEntry:=enterprice;
 LowerAfterEntry:=enterprice;

n:=1;
   end

 

 

用全局变量来记录下单状态,为0时能下单,只要有任意一个交易了,变为0,后面的就不能交易


--  作者:zyglys
--  发布时间:2014/1/25 20:14:07
--  
版主你好,(if  vol_1>=avvol*3 and c_1<o_1-n7  then )中的avvol是嘛意思?
--  作者:jinzhe
--  发布时间:2014/1/26 10:09:27
--  
这个是提问的用户自己定义的,我也不知道啥意思