以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  图标交易重复开仓  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=53895)

--  作者:李亚弟
--  发布时间:2013/7/12 15:08:35
--  图标交易重复开仓
代码如下;
variable:cc=0;
ma1:=ma(ref(close,1),40);
h1:hhv(ref(h,1),20); 
l1:llv(ref(low,1),20);
if cc=0 and tbc then begin //cc用来标识持仓。持有多单则为1,持有空单则为-1,无持仓则为0.
   if h>h1 and h>ma1 then begin //开多 
      buyp:=max(o,h1);
      buy(1,lots,limitr,buyp); 
      kcj:=buyp;
      cc:=1;
   end
   else if l<l1 and l<ma1 then begin //开空
           sellp:=min(o,l1); 
           buyshort(1,lots,limitr,sellp); 
           kcj:=sellp;
           cc:=-1;
        end
end
这样的代码为什么重复开仓。实盘。

--  作者:jinzhe
--  发布时间:2013/7/12 15:28:44
--  

几分钟周期?走完k线下单还是固定轮询


--  作者:李亚弟
--  发布时间:2013/7/12 15:52:52
--  
1分钟K线。1秒轮询。
--  作者:jinzhe
--  发布时间:2013/7/12 15:55:25
--  
轮询模式的话,重复那就是信号闪烁了