以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- [原创] (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=97297) |
-- 作者:苦麻菜真好吃 -- 发布时间:2016/5/11 10:22:36 -- [原创] 开多仓后,1、设置初始止损为x, 2、若盈利3atr后将止损上移至保本止损、 3、若盈利5atr后,回撤3atr平仓止盈、 4、若盈利N(N>5)atr后、回撤3atr平仓止盈
开空仓后,1、设置初始止损为x, 2、若盈利3atr后将止损上移至保本止损、 3、若盈利5atr后,回撤3atr平仓止盈、 4、若盈利N(N>5)atr后、回撤3atr平仓止盈
|
-- 作者:jinzhe -- 发布时间:2016/5/11 10:27:12 -- 初始止损为x
是亏损x点还是具体的亏损了x元 |
-- 作者:苦麻菜真好吃 -- 发布时间:2016/5/11 10:42:29 -- X是个条件、帮忙写后面就可以了、谢谢老师! |
-- 作者:jinzhe -- 发布时间:2016/5/11 10:45:27 -- 那么atr是点数还是具体的金额? |
-- 作者:苦麻菜真好吃 -- 发布时间:2016/5/11 10:56:17 -- atr也是一个条件 |
-- 作者:jinzhe -- 发布时间:2016/5/11 10:57:25 -- 盈利3atr 这里的atr怎么就是一个条件了? |
-- 作者:苦麻菜真好吃 -- 发布时间:2016/5/11 11:05:12 -- 就按照点数来用吧 |
-- 作者:jinzhe -- 发布时间:2016/5/11 11:11:00 -- 2、若盈利3atr后将止损上移至保本止损、 3、若盈利5atr后,回撤3atr平仓止盈、 4、若盈利N(N>5)atr后、回撤3atr平仓止盈
if hhv(h,enterbars+1)>enterprice+3*atr and hhv(h,enterbars+1)<enterprice+5*atr and c<enterprice and holding>0 then sell(1,0,marketr); if hhv(h,enterbars+1)>=enterprice+5*atr and c<hhv(h,enterbars+1)-3*atr and holding>0 then sell(1,0,marketr);
if hhv(h,enterbars+1)>enterprice+3*atr and hhv(h,enterbars+1)<enterprice+5*atr and c<enterprice and holding<0 then sellshort(1,0,marketr); if hhv(h,enterbars+1)>=enterprice+5*atr and c<hhv(h,enterbars+1)-3*atr and holding<0 then sellshort(1,0,marketr); |