以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 连亏次数 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=98686) |
-- 作者:c100010766 -- 发布时间:2016/6/17 15:01:43 -- 连亏次数 老师好,如果 求的连亏次数的次数,,就是连亏5次,,一共出现了几次,连亏3次,一共出现 几次,测试报告里没有呀 |
-- 作者:jinzhe -- 发布时间:2016/6/17 15:05:07 -- 没有这样的数据的 |
-- 作者:c100010766 -- 发布时间:2016/6/17 15:46:33 -- 是软件里没有函数,还是写不出来 ,,,在3年内,,连续亏损3次,4次,5次,,,一共出现了几次, |
-- 作者:jinzhe -- 发布时间:2016/6/17 15:55:02 -- 没有这样的函数的, 写法参考:
variable:n=0; variable:ss3=0,ss4=0,ss5=0;
if 平多条件 and holding>0 then begin sell.......; if numprofit(1)>=0 then n:=0; if numprofit(1)<0 then n:=n+1; if n=3 then ss3:=ss3+1; if n=4 then ss4:=ss4+1; if n=5 then ss5:=ss5+1 end
if 平空条件 and holding<0 then begin seshortll.......; if numprofit(1)>=0 then n:=0; if numprofit(1)<0 then n:=n+1; if n=3 then ss3:=ss3+1; if n=4 then ss4:=ss4+1; if n=5 then ss5:=ss5+1 end |