以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  移动止盈改为后台  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=163860)

--  作者:cdqwy781
--  发布时间:2018/6/5 22:26:43
--  移动止盈改为后台
maxProfit:ENTERPRICE-llv(l,ENTERBARS);

maxProfit1:HHV(H,ENTERBARS)-ENTERPRICE;

if maxProfit>10*mindiff and  holding<0 and ENTERBARS>0 and  C>MA(C,10) then 止盈b:sellshort(1,holding,market);





if maxProfit1>10*mindiff and  holding>0 and ENTERBARS>0 and C<MA10 then 止盈b1:sell(1,holding,market);

--  作者:wenarm
--  发布时间:2018/6/6 8:44:02
--  

maxProfit:tENTERPRICE-llv(l,tENTERBARS);
maxProfit1:HHV(H,tENTERBARS)-tENTERPRICE;
if maxProfit>10*mindiff and  tholding<0 and tENTERBARS>0 and  C>MA(C,10) then 止盈b:tsellshort(1,tholding,market);
if maxProfit1>10*mindiff and  tholding>0 and tENTERBARS>0 and C<MA10 then 止盈b1:tsell(1,tholding,market);

 

最简单的改法就是把图表的交易函数改为后台的。不过还是属于图表的处理思路。对于后台的移动止损,你可以参考系统自带的后台移动止损模块代码