Rss & SiteMap

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

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

标题:请帮把不同开平仓条件写成相对应模块谢谢

1楼
临界天地 发表于:2015/5/18 13:27:38
如果我有三个不同的开平仓条件   想写成
pd1  只对应kd1
pd2  只对应kd2
pd3 只对应kd3     应该怎么写呢
2楼
jinzhe 发表于:2015/5/18 13:32:33

variable:cc=0;

if kd1 and holding=0 and cc=0 then begin

   buy(holding=0,1,market);

   cc:=1;

end

 

if kd2 and holding=0 and cc=0 then begin

   buy(holding=0,1,market);

   cc:=2;

end

 

 

if kd3 and holding=0 and cc=0 then begin

   buy(holding=0,1,market);

   cc:=3;

end

 

if pd1 and holding>0 and cc=1 then begin

    sell(1,0,market);

    cc:=0;

end

 

if pd2 and holding>0 and cc=2 then begin

    sell(1,0,market);

    cc:=0;

end

 

if pd3 and holding>0 and cc=3 then begin

    sell(1,0,market);

    cc:=0;

end

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


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