以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://www.weistock.com/bbs/list.asp?boardid=4) ---- 请教利润回撤50%平仓的编写 (http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=138177) |
-- 作者:四季长安 -- 发布时间:2016/8/18 8:09:32 -- 请教利润回撤50%平仓的编写 新手请教,当盈利超过20点后,如果回撤50%就平仓的编写。谢谢 |
-- 作者:jinzhe -- 发布时间:2016/8/18 9:12:56 -- if holding>0 and hhv(h,enterbars+1)>enterprice+20 and enterbars>0 and openprofit<=hhv(openprofit,enterbars+1)*0.5 then sell(1,0,market); if holding<0 and llv(l,enterbars+1)<enterprice-20 and enterbars>0 and openprofit<=hhv(openprofit,enterbars+1)*0.5 then sellshort(1,0,market); |
-- 作者:四季长安 -- 发布时间:2016/8/18 18:14:33 -- 谢谢 |