以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 老师,请问一下,怎么在白盘和夜盘控制多空各交易一次,谢谢 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=137933) |
-- 作者:sb348 -- 发布时间:2016/8/12 14:38:18 -- 老师,请问一下,怎么在白盘和夜盘控制多空各交易一次,谢谢 老师,请问一下,怎么在白盘和夜盘,控制做多和做空各交易一次,谢谢 |
-- 作者: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 |
-- 作者:sb348 -- 发布时间:2016/8/12 15:55:42 -- 老师,能不能完整写一个白盘做多和做空各交易一次+夜盘做多和做空各交易一次的全局变量控制?谢谢 [此贴子已经被作者于2016-8-12 15:56:53编辑过]
|
-- 作者: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 |