以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 请老师帮助写个公式 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=73792) |
-- 作者:IF左边 -- 发布时间:2014/12/31 9:22:27 -- 请老师帮助写个公式 1分钟周期,突破上一根K线高点开多,突破上一根K线低点开空,不需要等K线走完,即时交易,同一根K线上开多或开空只能开一次。 |
-- 作者:jinzhe -- 发布时间:2014/12/31 9:27:59 -- 使用固定时间间隔模式,间隔设置为1秒 variable:N=0; if n=0 and holding=0 and h>ref(h,1) then begin buy(1,1,market); n:=1; end
if n=0 and holding=0 and l<ref(l,1) then begin buyshort(1,1,market); n:=1; end
if n=1 and enterbars>0 and h>ref(h,1) then begin sellshort(1,0,market); buy(holding=0,1,market); end
if n=1 and enterbars>0 and l<ref(l,1) then begin sell(1,0,market); buyshort(holding=0,1,market); end
|
-- 作者:IF左边 -- 发布时间:2014/12/31 15:02:57 -- 老师,我加载到模拟软件上之后,不能限时交易,有些K线走完后也没有交易信号是什么原因 |
-- 作者:jinzhe -- 发布时间:2014/12/31 15:06:29 -- 1.不能即时下单是你选择了走完k线模式,所以按照我一开始的回复设置成固定时间间隔模式 2.没有下单信号就是交易条件不成立 |