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


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

   

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


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

主题:求助

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


加好友 发短信
等级:新手上路 帖子:81 积分:159 威望:0 精华:0 注册:2010/6/30 2:39:46
求助  发帖心情 Post By:2018/4/2 21:08:27    Post IP:112.112.122.47[只看该作者]

请哪位老师帮忙把MC的交易模型改为金字塔的,谢谢!MC模型如下:

inputs: lots(1),blenpre(20),blenvol(7),dropstart(10),dropk(4);

vars  : minpoint(0),myoffset(0),prehp(0),prelp(0),highafterentry(0),loafterentry(0),bopenlong(False),bopenshort(False),mavol(0),dropstartflag(False),atr(0),dropline(0);

 

minpoint = MinMove*PriceScale;

prehp = highest(low,blenpre);

prelp = lowest(high,blenpre);

mavol = average(v,blenvol);

bopenlong  = low[1]>=prehp[1]  and low[2]>=prelp[2] and high>=high[1]and mavol[1]>=mavol[2];

bopenshort = high[1]<=prelp[1] and high[2]<=prehp[2] and low<=low[1] and mavol[1]>=mavol[2];

 

atr = AvgTrueRange(14);

//kai cang

if(bopenlong  and marketposition=0) then buy("BPK") next bar at maxlist(open,high[1]) limit;

if(bopenshort and marketposition=0) then sellshort("SPK") next bar at minlist(open,low[1]) limit;

 

//diao deng zhi sun

if (marketposition<>0 and barssinceentry>=1) then

   begin

      if (barssinceentry>1) then begin

         highafterentry= maxlist(high[1],highafterentry[1]);

         loafterentry= minlist(low[1],loafterentry[1]);

         end else begin

         highafterentry= maxlist(close[1],entryprice);

         loafterentry= minlist(close[1],entryprice);

         end;

   end;

dropstartflag = (highafterentry>=entryprice*(1+dropstart*0.001) or loafterentry<=entryprice*(1-dropstart*0.001));

 

//zhi sun tiao jian

if (marketposition<>0 and barssinceentry>=1) then

    begin

       if (marketposition=1) then dropline= highafterentry-dropk*atr[1];

           if(low<=dropline and dropstartflag=True) then sell("SP1") next bar at minlist(open,dropline) limit;

       if (marketposition=-1) then dropline = loafterentry+dropk*atr[1];

           if(high>=dropline and dropstartflag=True) then buytocover("BP1") next bar at maxlist(open,dropline) limit;    

    end;


 回到顶部