以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 如何取得“当日连盈次数”? (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=55307) |
-- 作者:huifeng623 -- 发布时间:2013/8/18 13:27:46 -- 如何取得“当日连盈次数”? 如何取得“当日连盈次数”? 非常感谢 |
-- 作者:jinzhe -- 发布时间:2013/8/19 9:08:59 -- variable:n=0;
nn:=barslast(平仓条件)+1; if 平仓条件 and 持仓判断 and openprofit>0 and ref(openprofit,nn)>0 then begin 平仓语句; n:=n+1; end
if time>=closetime(0) then n:=0;
用全局变量N来计算当日连赢次数,收盘前重置为0 |