How to avoid choppy markets Damiani Volameter MT4

Forums ProRealTime English forum ProBuilder support How to avoid choppy markets Damiani Volameter MT4

Viewing 4 posts - 1 through 4 (of 4 total)
  • #33027

    Hi!

    This indicator look interesting and I wonder if someone with MT4 coding skills could translate it to PRT?
    This code version is missing the red dot printed at the bottom but not so important..

    Damiani Volameter MT4 Indicator

    The Damiani Volameter is another trend and range filter. When the white line is above the green line, a red line will print at the bottom of the indicator window and it shows that the market is ranging. When the green line is above the white line, the market is trending. The indicator does not display which direction the market is trending, thus, you might need to add another directional indicator like momentum, to make it a complete trading system.

    How do I use it?

    Like the squeeze break trend and range filter indicator, I suggest using it just purely to filter the ranging market from the trending market. Like most range and trend filters, the challenge is to know when the range market is ending and when the new trend is starting, vice versa.

    Trending market = use trend strategies (moving average cross, etc)

    Range market = use range strategies (stochastics, oscillators)

     

    MT4 code and screenshot below..

    #property indicator_separate_window
    #property indicator_buffers 3
    #property indicator_color1 Silver
    #property indicator_color2 FireBrick
    #property indicator_color3 Lime
    //—- input parameters
    extern int Viscosity=7;
    extern int Sedimentation=50;
    extern double Threshold_level=1.1;
    extern bool lag_supressor=true;
    double lag_s_K=0.5;
    //—- buffers
    double thresholdBuffer[];
    double vol_m[];
    double vol_t[];
    double ind_c[];
    //+——————————————————————+
    //| Custom indicator initialization function |
    //+——————————————————————+
    int init()
    {
    //—- indicators
    SetIndexStyle(0,DRAW_LINE);
    SetIndexBuffer(0,thresholdBuffer);
    SetIndexStyle(1,DRAW_SECTION);
    SetIndexBuffer(1,vol_m);
    SetIndexStyle(2,DRAW_LINE);
    SetIndexBuffer(2,vol_t);

    ArrayResize(ind_c,Bars);
    ArrayInitialize(ind_c,0.0);
    //—-
    return(0);
    }
    //+——————————————————————+
    //| Custor indicator deinitialization function |
    //+——————————————————————+
    int deinit()
    {
    //—-

    //—-
    return(0);
    }
    //+——————————————————————+
    //| Custom indicator iteration function |
    //+——————————————————————+
    int start()
    {
    double vol=0;
    int changed_bars=IndicatorCounted();
    //Comment(“ATR ratio= “+short_atr+” / “+long_atr);
    int limit=Bars-changed_bars;
    if (limit>Sedimentation+5)limit=limit-Sedimentation;
    for(int i=limit;i>=0;i–)
    {

    double sa=iATR(NULL,0,Viscosity,i);
    double s1=ind_c[i+1];
    double s3=ind_c[i+3];
    double atr=NormalizeDouble(sa,Digits);
    if(lag_supressor)
    vol= sa/iATR(NULL,0,Sedimentation,i)+lag_s_K*(s1-s3);
    else
    vol= sa/iATR(NULL,0,Sedimentation,i);
    //vol_m[i]=vol;

    double anti_thres=iStdDev(NULL,0,Viscosity,0,MODE_LWMA,PRICE_TYPICAL,i);

    anti_thres=anti_thres/
    iStdDev(NULL,0,Sedimentation,0,MODE_LWMA,PRICE_TYPICAL,i);

    double t=Threshold_level;
    t=t-anti_thres;

    if (vol>t){vol_t[i]=vol;vol_m[i]=vol;
    IndicatorShortName(“DAMIANI Signal/Noise: TRADE / ATR= “+DoubleToStr(atr,Digits)+” values:”);}
    else {vol_t[i]=vol;vol_m[i]=EMPTY_VALUE;
    IndicatorShortName(“DAMIANI Signal/Noise: DO NOT trade / ATR= “+DoubleToStr(atr,Digits)+” values:”);}
    ind_c[i]=vol;
    thresholdBuffer[i]=t;
    }
    //—-

    //—-
    return(0);
    }
    //+——————————————————————+

     

    #33077

    Sure, please provide the .mq4 file instead. Much easier for me to read, understand and translate the code. Thanks.

    #33178

    This indicator is now available for prorealtime, you’ll find it in the library, follow this link: Damiani volatmeter prorealtime version

    #33195

    Thanks Nicholas, you truly are a wizard! 🙂

    If you want to change the settings to a specific market, which of the settings should you adjust?

    7, 50 or 1.1? Or a combo?

     

    Brgds

    Tim

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login