设为首页收藏本站

 找回密码
 注册
查看: 1270|回复: 0
打印 上一主题 下一主题

真正的鳄鱼线指标 [复制链接]

Rank: 2

精华
0
UID
170538
积分
51
帖子
14
主题
3
阅读权限
30
注册时间
2013-8-22
最后登录
2020-4-24
跳转到指定楼层
1#
发表于 2019-6-8 17:19:39 |只看该作者 |倒序浏览
鳄鱼指标线
1.该系统是尊重于原著《量化交易新空间》中关于鳄鱼指标线的所有开仓条件、加仓条件、
   平仓条件
2.系统对分型采用尽可能的枚举进行模拟,力求最接近于原著作者表达的意思
3.对分型、AO、AC、区域、平衡线进行了明确定义
4.对“蓝光特惠”等小概率开仓事件进行了忽略,对连续6阳线平仓进行忽略。
5.请尊重作者的劳动,如有高手,可以与作者交换,做者将提供Crocodile_V3版的健壮模型!
   13592659139  




//------------------------------------------------------------------------
// 简称: Crocodile
// 名称:
// 类别: 公式应用
// 类型: 用户应用
// 输出:
//------------------------------------------------------------------------
Params
        Numeric Length1(5);
        Numeric Length2(8);
        Numeric Length3(13);
        // 离市周期 Trailing Exit Length
    Bool LastProfitableTradeFilter(true);
    Numeric lots(1);       
                                          // 使用入市过滤条件
Vars
    Numeric MinPoint;                       // 最小变动单位
        NumericSeries Chun;
        NumericSeries Chi;
        NumericSeries Er;
        NumericSeries MFI;
        NumericSeries  AO;
    NumericSeries  AC;
         Numeric        i;
    Bool        AODX;
    bool        AOCY;
        bool        AOSF;
        bool        Acs;
        bool        ACx;
        bool        ACcy;
        bool        PHXS;
        bool        PHXX;
        bool        HFX;
        bool        qy;
    Numeric     HHFX;   
    Numeric myEntryPrice;                   // 开仓价格
    Numeric myExitPrice;                    // 平仓价格
    Bool SendOrderThisBar(False);           // 当前Bar有过交易
    NumericSeries preEntryPrice(0);         // 前一次开仓的价格

Begin
    // 集合竞价过滤
    If(!CallAuctionFilter()) Return;

    If(BarStatus == 0)
    {
        preEntryPrice = InvalidNumeric;
        
    }

    MinPoint = MinMove*PriceScale;
    chun=AverageFC((h[3]+l[3])/2,Length1);
        Chi=AverageFC((h[5]+l[5])/2,Length2);
    Er=AverageFC((h[8]+l[8])/2,Length3);
    PlotNumeric("唇线",Average((h[3]+l[3])/2,Length1),0 ,Green);
        PlotNumeric("齿线",Average((h[5]+l[5])/2,Length2),0, red);
        PlotNumeric("鄂线",Average((h[8]+l[8])/2,Length3),0, blue);
        MFI=(h+l)/2;
        AO=(average(MFI,5)-average(MFI,34));
        AC=AO-average(AO,5);

   

    //上分形定义
       
       
        For  i=3 to 6
        if (h[i+2]<h[i] and  h[i+1]<h[i]  and h[i-1]<h[i] and h[i-2]<h[i])
           {HFX=true;
             HHFX=h[i];
           }
      
       
          
       
   
   //以下为AO指标
   
    AODX=(ao[3]>ao[2] and ao[1]>ao[2] and ao[2]>o  )  
          or (ao[4]>ao[3] and ao[4]>ao[2] and ao[1]>ao[3] and ao[1]>ao[2]and ao[2]>o and ao[3]>0)
          or (ao[5]>ao[4] and ao[5]>ao[3] and ao[5]>ao[2] and ao[1]>ao[4] and ao[1]>ao[3] and ao[1]>ao[2] and ao[2]>0 and ao[3]>0 and ao[2]>o)
      or (ao[6]>ao[5] and  ao[6]>ao[4] and ao[6]>ao[3] and ao[6]>ao[2] and ao[1]>ao[5] and ao[1]>ao[4] and ao[1]>ao[3] and ao[1]>ao[2] and ao[5]>o  and ao[4]>o and ao[3]>o and ao[2]>o);
                               
                                  
                                                  
                                                   //蝶形买进
                                                  
        AOCY=ao[2]<o and ao[1]>o ; //穿越买进
    AOSF=ao[5]<ao[2] and ao[2]<0 and ao[5]<ao[6] and ao[6]<o   and ao[1]>ao[2] and   ao[2]<ao[3] and ao[5]<ao[4];//双峰买进       
                                                  
   
   //以下为AC指标
   
   ACS=AC[3]<Ac[4] and ac[2]>ac[3]   and   ac[1]>ac[2] and ac[3]>o;//AC零轴之上买进;
   ACX=ac[4]<ac[5] and  ac[4]<ac[3] and ac[3]<ac[2] and ac[2]<ac[1] and ac[1]<o;//AC 零轴之下买进
   ACCY=ac[3]<ac[4]and  ac[3]<ac[2] and ac[1]>0 and ac[2]<o;//AC 穿越买进
   

   //以下为区域
   
          QY=ao[1]>o and ac[1]>o ;
   
   
   //以下为平衡线指标
   
     PHXX= high[1]<high[2] and  high[2]<high[3] and high[3]<er[3]; //平衡线下买入;
         PHXS=high[2]>high[1] and high[2]>er[2];// 平衡线上买入;
   

   if(HFX==true)

         PlotNumeric("上分形",HHFX,0,Yellow,3);//输出上分形的值

       

    If(MarketPosition == 0 and chi>chun)
   
        // 突破开仓
        If(High > HHFX and hhfx>chi)
        {
            
                    myEntryPrice = HHFX ;
            myEntryPrice = max(Open,myEntryPrice)+MinPoint; // 大跳空的时候用开盘价代替
            preEntryPrice = myEntryPrice;
            Buy(lots,myEntryPrice);
            SendOrderThisBar = True;
                        Commentary("分形买入");
    }

       
            If(MarketPosition==1 and   QY==true and close[1]>close[2]and SendOrderThisBar==false and close[1]>preEntryPrice+minpoint)
                  {
                   myEntryPrice= max(Open,PreEntryPrice)+MinPoint;
                   Buy(lots,myentryprice);
                   SendOrderThisBar=true;
                   Commentary("区域买入");
                   }
               
       
   If(MarketPosition == 1  and SendOrderThisBar==false and close[1]>preEntryPrice+30*minpoint) // 有多仓的情况,加多仓
    {
      
        If(preEntryPrice!=InvalidNumeric )
               
                       
                If(High > HHFX and hhfx>chi and BarsSinceLastEntry>2 )  //突破分形加仓;
                {       
            myEntryPrice = HHFX ;
                myEntryPrice = max( Open,myEntryPrice)+MinPoint; // 大跳空的时候用开盘价代替
                preEntryPrice = myEntryPrice;
                Buy(lots,myEntryPrice);
                SendOrderThisBar = True;
                Commentary("分形加仓");
               
                }
         If(aodx==true or AOCY==true or aosf==true  and SendOrderThisBar==false)//AO加仓;
                if (high>high[1])
                   {myEntryPrice=Max(high[1],open)+MinPoint;
                        Buy(lots,myExitPrice);
                        SendOrderThisBar=true;
                       
                        Commentary("AO加仓");
                       
                        }
         if(ACS==true or AcX==true OR AcCY==true and SendOrderThisBar==false)//AC 加仓;
                       
         if (high>high[1] and SendOrderThisBar==false)
                {myEntryPrice=Max(high[1],open)+MinPoint;
                 Buy(lots,myEntryPrice);
                 SendOrderThisBar=true;
                 Commentary("AC加仓");
                 
                 }
                          
         If(PHXX==true and high>high[3]  and SendOrderThisBar==false )   
                {myEntryPrice=Max(high[3],open)+MinPoint;//平衡线下加仓
               
                Buy(lots,myEntryPrice);
                SendOrderThisBar=true;
                Commentary("平衡线下加仓");
               
                }       
               
               
               
     if        (PHXS==true and high>high[2] and SendOrderThisBar==false)
                 
      {  myEntryPrice=Max(high[2],open)+MinPoint;//平衡线上加仓

        Buy(lots,myEntryPrice);       
                SendOrderThisBar=true;
                Commentary("平衡线上加仓");
                }
     }       

       
         if(MarketPosition == 1 and  SendOrderThisBar==false and  BarsSinceLastEntry>2)
     {  If(low<chi)
          
                {Sell(0,Min(open,chi)-minpoint);
                 Commentary("破齿线平仓");
                }
          

          
          
          
          
          
          
          
          
          
          
          
                }       

End

//以上系统仅写出了多头市场,在螺纹钢、铁矿石等相对较为活跃的品种表现较好!
//高手补全空头部分或发现什么问题后,请与我联系,分享源码,交流心得,也是对分享成果的尊重。
//由阳光雨露原创,QQ:5400958969
// 编译版本        GS2015.12.25
// 用户版本        2018/08/20 13:35:00
// 版权所有        zyqh100032595
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TradeBlazer公式修改和重写的权利
您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-4-27 04:11

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部