Rss & SiteMap

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

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

标题:老师,请问一下,怎么在白盘和夜盘控制多空各交易一次,谢谢

1楼
sb348 发表于:2016/8/12 14:38:18
老师,请问一下,怎么在白盘和夜盘,控制做多和做空各交易一次,谢谢
2楼
jinzhe 发表于:2016/8/12 14:51:22

这个要全局变量来控制

比如

variable:duo=0,n=0;

 

if 开多条件 and duo=0 and holding=0 then begin

     buy(1,1,market);

    duo:=1;

end

 

if 开空条件 and kong=0 and holding=0 then begin

    buyshort(1,1,market);

    kong:=1;

end

 

if time=closetime(1) then begin

    duo:=0;

    kong:=0;

end

 

if time=closetime(0) then begin

    duo:=0;

    kong:=0;

end

3楼
sb348 发表于:2016/8/12 15:55:42
老师,能不能完整写一个白盘做多和做空各交易一次+夜盘做多和做空各交易一次的全局变量控制?谢谢
[此贴子已经被作者于2016-8-12 15:56:53编辑过]
4楼
jinzhe 发表于:2016/8/12 16:06:51

variable:duo=0,kong=0;

 

if 开多条件 and duo=0 and holding=0 then begin

     buy(1,1,market);

    duo:=1;

end

 

if 开空条件 and kong=0 and holding=0 then begin

    buyshort(1,1,market);

    kong:=1;

end

 

if time=closetime(1) then begin

    duo:=0;

    kong:=0;

end

 

if time=closetime(0) then begin

    duo:=0;

    kong:=0;

end

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


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