以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 每月累计亏损1.2则不工作---怎写 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=53571) |
-- 作者:lyt369 -- 发布时间:2013/7/3 8:56:44 -- 每月累计亏损1.2则不工作---怎写 每月累计亏损1.2则不工作---怎写 |
-- 作者:jinzhe -- 发布时间:2013/7/3 9:18:53 -- nn:=barslast(month<>ref(month,1))+1; if ref(asset,1)-asset>1.2 then exit |
-- 作者:lyt369 -- 发布时间:2013/7/3 9:28:06 -- nn:=barslast(month<>ref(month,1))+1; if ref(asset,1)-asset>=12000 then exit;放进到模型最后面测试----结果跟放之前一样----即无效
|
-- 作者:jinzhe -- 发布时间:2013/7/3 9:32:09 -- 或者在开仓条件里面加上ref(asset,1)-asset<12000 |
-- 作者:lyt369 -- 发布时间:2013/7/3 9:39:27 -- 还是不行 |
-- 作者:qwer123 -- 发布时间:2013/7/3 10:05:16 -- [此贴子已经被作者于2013/7/3 10:06:02编辑过]
|
-- 作者:qwer123 -- 发布时间:2013/7/3 10:07:13 -- nn:=barslast(month<>ref(month,1))+1; if ref(asset,nn)-asset>1.2 then exit |
-- 作者:lyt369 -- 发布时间:2013/7/3 10:45:27 -- 还是不行 |
-- 作者:qwer123 -- 发布时间:2013/7/3 10:55:13 -- nn:=barslast(month<>ref(month,1))+1; if ref(asset,nn)-asset>1.2 *10000 then begin sell(1,0------); sellshort(1,0,----); exit; end |