以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://www.weistock.com/bbs/list.asp?boardid=4) ---- 请问老师,如何统计当日,夜盘交易次数和白盘的交易次数呢? (http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=85259) |
-- 作者:stardna -- 发布时间:2015/9/16 11:29:07 -- 请问老师,如何统计当日,夜盘交易次数和白盘的交易次数呢? TOTALDAYTRADE是表示当日交易次数,包含了夜盘和白盘,请问老师该如何实现呢?非常感谢! |
-- 作者:jinzhe -- 发布时间:2015/9/16 13:13:37 -- variable:n=0,m=0; if 平空 条件 and holding<0 then begin sellshort(1,0,market); if time>010000 and time<=063000 then n:=n+1; if time>130000 and time<=190000 then m:=m+1; end
if 平多 条件 and holding>0 then begin sell(1,0,market); if time>010000 and time<=063000 then n:=n+1; if time>130000 and time<=190000 then m:=m+1; end
if time=closetime(0) then begin n:=0; m:=0; end
n为夜盘交易次数,m为白天交易次数 |
-- 作者:stardna -- 发布时间:2015/9/16 15:17:50 -- 谢谢老师的辛苦指导,我想取的是当日,不知怎么过滤一下呢? |
-- 作者:jinzhe -- 发布时间:2015/9/16 15:23:18 -- n和m都是当日的值,不会累加其他日期的 |