以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  获利20跳,触发移动止损,怎么写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=156900)

--  作者:qq代人发帖
--  发布时间:2017/8/16 11:26:40
--  获利20跳,触发移动止损,怎么写
请教一下:出场条件,1、如果单子获利20跳,触发移动止损,最高点回测20个点出场。2、行情如果没有触发移动止损,亏损20跳也固定出场。3、单子获利40个点也直接出场。
这样的出场表达要如何写,谢谢

--  作者:pyd
--  发布时间:2017/8/16 11:30:26
--  

hh:=hhv(c,enterbars+1);
if hh-enterprice>=20*mindiff and hh-c>=20 and holding>0 then sell();//回撤止盈
if hh-enterprice>=40 and holding>0 then sell(); //盈利40点止盈
if enterprice-c>=20*mindiff and holding>0 then sell();//止损

[此贴子已经被作者于2017/8/16 11:36:55编辑过]

--  作者:332046997
--  发布时间:2017/8/16 11:40:19
--  
谢谢