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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 如何在K线上画出移动止损线

   

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


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

主题:如何在K线上画出移动止损线

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


加好友 发短信
等级:论坛游侠 帖子:334 积分:0 威望:0 精华:0 注册:2013/8/29 9:26:12
如何在K线上画出移动止损线  发帖心情 Post By:2015/1/27 15:16:39    Post IP:221.237.16.10[只看该作者]

老师好,下面是期指1分钟交易代码范本,我想在1分钟K线图上分别画出固定止损线和移动止损线,请问代码怎么实现,谢谢:

 

//中间变量
variable:highprice=0;
win1:=0;
win2:=0;

//交易条件
kd:=kd1 and kd2;
pd:=pd1 and pd2 ;

//交易系统
if kd then begin
   sellshort(1,0,limitr,c);
   buy(holding=0,1,limitr,c);
   highprice:=enterprice;
   zs:=enterprice-10;//10点固定止损
end

if enterprice-c>=10 then 多损:sell(holding>0,0,limitr,zs);

if holding>0 then begin
   if c>highprice then highprice:=c;
      win1:=(c-enterprice)/enterprice*100;
      win2:=(highprice-c)/(highprice-enterprice)*100;
   if win1>0 and win1<=0.88 and win2>40 then begin
       多回:sell(1,0,limitr,highprice-(highprice-enterprice)*0.4);
       end
   if win1>0.88 and win2>20 then begin
       多赢:sell(1,0,limitr,highprice-(highprice-enterprice)*0.2);

       end
end


 回到顶部
总数 27 1 2 3 下一页