设为首页收藏本站

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

恳请fish0451出手 移植个mt4的好公式--qqe [复制链接]

Rank: 6Rank: 6

精华
0
UID
1896
积分
1979
帖子
117
主题
33
阅读权限
70
注册时间
2008-7-16
最后登录
2013-11-16
跳转到指定楼层
1#
发表于 2009-2-26 09:56:14 |只看该作者 |倒序浏览
您移植的stepma感觉很棒 偶然看到qqe这个指标 脱胎于rsi 感觉不错 但很多mt4代码看不懂 能否移植一下 谢谢
//+------------------------------------------------------------------+
//|            Qualitative Quantitative Estimation Indicator for Metatrader 4 |
//|            Copyright © 2006Roman Ignatov |
//|             mailto:roman.ignatov@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 200 Roman Ignatov"
#property link      "mailto:roman.ignatov@gmail.com  "

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Navy
#property indicator_style1 STYLE_SOLID
#property indicator_width1 2

#property indicator_color2 Navy
#property indicator_style2 STYLE_DOT


extern int SF = 5;

int RSI_Period = 14;
int Wilders_Period;
int StartBar;

double TrLevelSlow[];
double AtrRsi[];
double MaAtrRsi[];
double Rsi[];
double RsiMa[];

int init()
{
    Wilders_Period = RSI_Period * 2 - 1;
    if (Wilders_Period < SF)
        StartBar = SF;
    else
        StartBar = Wilders_Period;
        
    IndicatorBuffers(6);
    SetIndexBuffer(0, RsiMa);
    SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
    SetIndexLabel(0, "Value 1");
    SetIndexDrawBegin(0, StartBar);
    SetIndexStyle(1, DRAW_LINE, STYLE_DOT);
    SetIndexBuffer(1, TrLevelSlow);
    SetIndexLabel(1, "Value 2");
    SetIndexDrawBegin(1, StartBar);
    SetIndexBuffer(2, AtrRsi);
    SetIndexBuffer(3, MaAtrRsi);
    SetIndexBuffer(4, Rsi);
    IndicatorShortName(StringConcatenat  e("QQE(", SF, ")"));
    return(0);
}


int start()
{
    int counted, i;
    double rsi0, rsi1, dar, tr, dv;
   
    if(Bars <= StartBar)
        return (0);

    counted = IndicatorCounted();
    if(counted < 1)
        for(i = Bars - StartBar; i < Bars; i++)
        {
            TrLevelSlow = 0.0;
            AtrRsi = 0.0;
            MaAtrRsi = 0.0;
            Rsi = 0.0;
            RsiMa = 0.0;
        }
   
    counted = Bars - counted - 1;
        
    for (i = counted; i >= 0; i--)
        Rsi = iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, i);

    for (i = counted; i >= 0; i--)
    {
        RsiMa = iMAOnArray(Rsi, 0, SF, 0, MODE_EMA, i);
        AtrRsi = MathAbs(RsiMa[i + 1] - RsiMa);
    }

    for (i = counted; i >= 0; i--)
        MaAtrRsi = iMAOnArray(AtrRsi, 0, Wilders_Period, 0, MODE_EMA, i);

    i = counted + 1;
    tr = TrLevelSlow;
    rsi1 = iMAOnArray(Rsi, 0, SF, 0, MODE_EMA, i);
    while (i > 0)
    {
        i--;
        rsi0 = iMAOnArray(Rsi, 0, SF, 0, MODE_EMA, i);
        dar = iMAOnArray(MaAtrRsi, 0, Wilders_Period, 0, MODE_EMA, i) * 4.236;

        dv = tr;
        if (rsi0 < tr)
        {
            tr = rsi0 + dar;
            if (rsi1 < dv)
                if (tr > dv)
                    tr = dv;
        }
        else if (rsi0 > tr)
        {
            tr = rsi0 - dar;
            if (rsi1 > dv)
                if (tr < dv)
                    tr = dv;
        }
        TrLevelSlow = tr;
        rsi1 = rsi0;
    }
   
    return(0);
}

Rank: 6Rank: 6

精华
0
UID
1896
积分
1979
帖子
117
主题
33
阅读权限
70
注册时间
2008-7-16
最后登录
2013-11-16
2#
发表于 2009-2-26 12:17:38 |只看该作者
上个效果图 最下面的指标就是qqe
附件: 你需要登录才可以下载或查看附件。没有帐号?注册

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
153
积分
212
帖子
17
主题
6
阅读权限
40
注册时间
2007-8-19
最后登录
2019-4-5
3#
发表于 2009-2-26 13:37:06 |只看该作者
这个图怎么看着这么诡异呢?

使用道具 举报

初级大户

天蓬大元帅

Rank: 5Rank: 5

精华
0
UID
1138
积分
1217
帖子
161
主题
61
阅读权限
60
注册时间
2008-1-30
最后登录
2009-10-5
4#
发表于 2009-2-26 13:41:36 |只看该作者
都不上传上来,谁能帮你改啊。。。
交易开拓者QQ群:1群:38529330,2群:24771838,3群:39107556,4群:38478324。。。

使用道具 举报

Rank: 7Rank: 7Rank: 7

精华
0
UID
926
积分
4317
帖子
167
主题
33
阅读权限
80
注册时间
2007-12-15
最后登录
2016-8-9
5#
发表于 2009-2-26 16:32:06 |只看该作者
好!先收藏了,周末看看。

使用道具 举报

Rank: 2

精华
0
UID
2560
积分
66
帖子
19
主题
5
阅读权限
30
注册时间
2008-10-13
最后登录
2019-3-24
6#
发表于 2009-2-26 22:25:46 |只看该作者
这个看起很高超样,帮你顶! 期待高手出招!!!

使用道具 举报

Rank: 4

精华
1
UID
714
积分
581
帖子
126
主题
23
阅读权限
50
注册时间
2007-11-10
最后登录
2015-12-1
7#
发表于 2009-2-27 22:28:32 |只看该作者
mt4如此有名,果然不是盖的啊,看画面确实不错
森林中最不缺的是猎物,对猎人来说最珍贵的是子弹
[fly]人生没有彩排,每一场都是现场直播[/fly]

使用道具 举报

Rank: 6Rank: 6

精华
0
UID
1896
积分
1979
帖子
117
主题
33
阅读权限
70
注册时间
2008-7-16
最后登录
2013-11-16
8#
发表于 2009-2-28 10:15:32 |只看该作者

期待 fish0451 根据tb的rsi指标改了个rsi函数 以方便引用

//------------------------------------------------------------------------
// 简称: rsi
// 名称: rsi
// 类别: 用户函数
// 类型: 内建函数
// 输出: 数值型
//------------------------------------------------------------------------

Params
        Numeric Length(14) ;

Vars
        NumericSeries NetChgAvg( 0 );
        NumericSeries TotChgAvg( 0 );
        Numeric Change( 0 );
        Numeric SF( 0 );
        Numeric ChgRatio( 0 ) ;
        Numeric RSIValue;
Begin
        SF = 1/Length;
        If(CurrentBar < Length)
        {
                RSIValue = InvalidNumeric;
        }Else
        {
                If(CurrentBar == Length)
                {
                        NetChgAvg = ( Close - Close[Length] ) / Length ;
                        TotChgAvg = AverageFC( Abs( Close - Close[1] ), Length ) ;
                }
               
                If(CurrentBar>length)
                {
                        Change = Close - Close[1] ;
                        NetChgAvg = NetChgAvg[1] + SF * ( Change - NetChgAvg[1] ) ;
                        TotChgAvg = TotChgAvg[1] + SF * ( Abs( Change ) - TotChgAvg[1] ) ;
                }
               
                If( TotChgAvg <> 0 )
                {
                        ChgRatio = NetChgAvg / TotChgAvg ;
                }else
                {
                        ChgRatio = 0 ;
                }
               
                RSIValue = 50 * ( ChgRatio + 1 ) ;
        }

        Return rsivalue;
End

//------------------------------------------------------------------------
// 编译版本        GS2004.06.12
// 用户版本        2009/02/28 10:04
// 版权所有         
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

使用道具 举报

Rank: 6Rank: 6

精华
0
UID
1896
积分
1979
帖子
117
主题
33
阅读权限
70
注册时间
2008-7-16
最后登录
2013-11-16
9#
发表于 2009-2-28 10:26:13 |只看该作者
另 在tb中 ema对应函数XAverage

使用道具 举报

Rank: 7Rank: 7Rank: 7

精华
0
UID
926
积分
4317
帖子
167
主题
33
阅读权限
80
注册时间
2007-12-15
最后登录
2016-8-9
10#
发表于 2009-2-28 22:31:50 |只看该作者
//------------------------------------------------------------------------
// 简称: qqe
// 名称:
// 类别: 技术指标
// 类型: 其它类
// 输出:
//------------------------------------------------------------------------
Params
        Numeric SF(5);                       
        Numeric RSI_Period(14);       
        Numeric rat(4.236);
Vars
        NumericSeries TrLevelSlow(0);       
        NumericSeries AtrRsi(0);       
        NumericSeries MaAtrRsi(0);       
        NumericSeries Rsi(0);
        NumericSeries RsiMa(0);
        Numeric Wilders_Period(0);       
        Numeric dar(0);       
        NumericSeries  smin(0);
    NumericSeries  smax(0);
        NumericSeries p;
       
Begin
        Wilders_Period=RSI_Period * 2 - 1;
        If(BarStatus==0)
        {
                 TrLevelSlow=0;
         AtrRsi=0;
         MaAtrRsi=0;
         Rsi=0;
         RsiMa=0;
                 p=0;
        }
        if(CurrentBar>RSI_Period)
        {
                Rsi=iRSI(Close,RSI_Period);
                RsiMa=XAverage(Rsi,SF);
                AtrRsi=Abs(RsiMa[1] - RsiMa);
                MaAtrRsi=XAverage(AtrRsi,Wilders_Period);
                dar=XAverage(MaAtrRsi,Wilders_Period) * rat;       
                smax=RsiMa+dar;
                smin=RsiMa-dar;

                p=p[1];

                if (RsiMa>smax[1]) {p=1; }         
                if (RsiMa<smin[1]) {p=-1;}

                if(p>0)
          {
                if(smin<smin[1])
                        smin=smin[1];
                TrLevelSlow=smin;
                if(TrLevelSlow<TrLevelSlow[1])
                        TrLevelSlow=TrLevelSlow[1];
          }
          Else
          {
                if(smax>smax[1])
                        smax=smax[1];
                TrLevelSlow=smax;
                if(TrLevelSlow>TrLevelSlow[1])
                        TrLevelSlow=TrLevelSlow[1];
          }
                PlotNumeric("RsiMa",RsiMa);
                PlotNumeric("TrLevelSlow",TrLevelSlow);
        }

End


//------------------------------------------------------------------------
// 编译版本        GS2004.06.12
// 用户版本        2009/02/28 20:14
// 版权所有        fish0451
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-5-15 06:35

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部