欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [求助]移动止盈问题

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4462人关注过本帖平板打印复制链接

主题:[求助]移动止盈问题

帅哥哟,离线,有人找我吗?
yiechaochao
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:35 积分:31 威望:0 精华:0 注册:2011/11/30 14:35:54
[求助]移动止盈问题  发帖心情 Post By:2014/4/17 8:31:05    Post IP:61.154.239.10[只看该作者]

看了论坛中的移动止盈范例,添加进我的策略中,怎么maxprofit与win总是一直一致的,在行情转向过后,两个的数据还是一致,导致win2一直是0,这是什么原因
VARIABLE: maxprofit=0;
win:=0;
win2:=0;
if holding > 0 and enterbars > 0 then
begin
 win:=(c-enterprice)/enterprice*100; //记录最大盈利
 if win>maxprofit then begin
  maxprofit:=win; 
  u:maxprofit;
  end
 win2:=(maxprofit-win)/maxprofit*100; //最大盈利后的回调幅度
 p:win2;
end
if holding < 0 and enterbars > 0 then
begin
 win:=(enterprice-c)/enterprice*100; //记录最大盈利
 if win> maxprofit then begin
  maxprofit:=win;
  i:maxprofit;
  end
 win2:=(maxprofit-win)/maxprofit*100; //最大盈利后的回调幅度
 d:win2;
end
//出现最高盈利后,回落到盈利的60%平仓出场
止赢多:SELL(win2>=60 and openprofit > 0, 0);// and openprofit > 0
止盈空:sellshort(win2>60 and openprofit > 0,0);
[此贴子已经被作者于2014/4/17 8:31:48编辑过]

 回到顶部