以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- [讨论]交易函数可否统计过去一段时间内的平均盈亏等数据 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=65829) |
-- 作者:choir2001 -- 发布时间:2014/6/5 11:08:22 -- [讨论]交易函数可否统计过去一段时间内的平均盈亏等数据 比如过去3个月的平均单笔盈利。现有的交易函数好像都没有时间限制。 |
-- 作者:jinzhe -- 发布时间:2014/6/5 11:26:16 -- 这个得要枚举计算,比较麻烦 |
-- 作者:jinzhe -- 发布时间:2014/6/5 11:29:14 -- 单笔盈利就是把盈利的交易做平均计算,亏损的不计算在内? |
-- 作者:choir2001 -- 发布时间:2014/6/5 12:47:29 -- 是的。例如AVGWIN
建议把常用交易统计函数都加入一个时间限定参数 |
-- 作者:jinzhe -- 发布时间:2014/6/5 13:50:57 -- 这里只枚举了6月份的计算方式,用户可以参考下面的写法自行编写一下其他月份的:
variable:ss=0; if cross(ma5,ma10) then begin if cross(ma10,ma5) then begin if ((h1=-1 and ref(h1,1)=1) or (h1=1 and ref(h1,1)=-1)) and numprofit(1)>0 then ss:=ss+numprofit(1); ss2:ss-ref(ss,nn);//3个月内的总盈利
|
-- 作者:choir2001 -- 发布时间:2014/6/5 19:34:59 -- 这也行,谢谢~ |