Re: Various Indicators - (MT5)

401
mrtools wrote: Wed Sep 03, 2025 6:15 am Hello this is the buffer list

Code: Select all

SetIndexBuffer(0, bli, INDICATOR_DATA); 
   SetIndexBuffer(1, sli, INDICATOR_DATA);
   SetIndexBuffer(2, zli, INDICATOR_DATA);  
   SetIndexBuffer(3, vals,INDICATOR_DATA); 
   SetIndexBuffer(4, val, INDICATOR_DATA); 
   SetIndexBuffer(5, valc, INDICATOR_CALCULATIONS);
   SetIndexBuffer(6, count,INDICATOR_CALCULATIONS);
and enums:

Code: Select all

enum enTimeFrames
{
   tf_cu  = PERIOD_CURRENT, // Current time frame
   tf_m1  = PERIOD_M1,      // 1 minute
   tf_m2  = PERIOD_M2,      // 2 minutes
   tf_m3  = PERIOD_M3,      // 3 minutes
   tf_m4  = PERIOD_M4,      // 4 minutes
   tf_m5  = PERIOD_M5,      // 5 minutes
   tf_m6  = PERIOD_M6,      // 6 minutes
   tf_m10 = PERIOD_M10,     // 10 minutes
   tf_m12 = PERIOD_M12,     // 12 minutes
   tf_m15 = PERIOD_M15,     // 15 minutes
   tf_m20 = PERIOD_M20,     // 20 minutes
   tf_m30 = PERIOD_M30,     // 30 minutes
   tf_h1  = PERIOD_H1,      // 1 hour
   tf_h2  = PERIOD_H2,      // 2 hours
   tf_h3  = PERIOD_H3,      // 3 hours
   tf_h4  = PERIOD_H4,      // 4 hours
   tf_h6  = PERIOD_H6,      // 6 hours
   tf_h8  = PERIOD_H8,      // 8 hours
   tf_h12 = PERIOD_H12,     // 12 hours
   tf_d1  = PERIOD_D1,      // daily
   tf_w1  = PERIOD_W1,      // weekly
   tf_mn  = PERIOD_MN1,     // monthly
   tf_cp1 = -1,             // Next higher time frame
   tf_cp2 = -2,             // Second higher time frame
   tf_cp3 = -3              // Third higher time frame
};
input enTimeFrames        inpTimeFrame    = tf_cu;                      // Time frame
input string              inpButtonID     = "adxt b1";                  // Button unique ID
input int                 inpLength       = 35;                         // Average length
enum  enDouble
      {
         avgs_regular,                                                  // Regular averages
         avgs_double,                                                   // Double smoothed averages
      };
input enDouble            inpDouble       = avgs_double;                // Averages calculating mode
input bool                inpUseRegMa     = false;                      // Regularized ma?
input double              inpLambda       = 5;                          // Lambda (if using regularized ma's)
enum  enRmaTypes
      {
            ma_rema,                                                    // Regularized exponential moving average 
            ma_rrma,                                                    // Regularized relative maving average
            ma_remaf,                                                   // Regularized fast exponential moving average 
            ma_errema,                                                  // Efficiency ratio regularized exponential moving average
            ma_errrma,                                                  // Efficiency ratio regularized relative moving average 
            ma_erremaf                                                  // Efficiency ratio regularized fast exponential moving average 
      };
input enRmaTypes          inpReMaType     = ma_rema;                    // Regularized Ma type
enum  enMaTypes
      {
            ma_adxvma,                                                  // Adxvma
            ma_aema,                                                    // Adaptive exponential moving average - AEMA 
            ma_arma,                                                    // Adaptive relative moving average - ARMA 
            ma_ahr,                                                     // Ahrens moving average
            ma_alma,                                                    // Arnaud Legoux Moving Average - ALMA
            ma_alxma,                                                   // Alexander moving average - ALXMA
            ma_dema,                                                    // Double exponential moving average - DEMA
            ma_dfema,                                                   // Double fast exponential moving average - DFEMA
            ma_dsema,                                                   // Double smoothed exponential moving average - DSEMA
            ma_dsema2,                                                  // Double smoothed EMA (variation)
            ma_dsemaf,                                                  // Double smoothed fast exponential moving average - DSFEMA
            ma_dswema,                                                  // Double smoothed Wilders exponential moving average - DSWEMA
            ma_dscma,                                                   // Deviation scaled MA - DSCMA
            ma_dwma,                                                    // Double weighted MA - DWMA
            ma_dpwma,                                                   // Double parabolic weighted ma - DPWMA
            ma_edic,                                                    // Ehlers distance coefficient filter - EDIC
            ma_emas,                                                    // Ema derivative - EMAD
            ma_ema,                                                     // Exponential moving average - EMA
            ma_epma,                                                    // End point moving average - EPMA
            ma_emaf,                                                    // Fast exponential moving average - FEMA
            ma_eotf,                                                    // Ehlers Optimal tracking filter
            ma_eoef,                                                    // Ehlers Optimal ellipitic filter
            ma_erema,                                                   // Efficiency ratio exponential moving average - EREMA
            ma_erdsema,                                                 // Efficiency ratio double smooth EMA - ERDSEMA
            ma_ertema,                                                  // Efficiency ratio triple EMA - ERTEMA
            ma_evwma,                                                   // Elastic volume weighted MA - EVWMA
            ma_frama,                                                   // Fractal adaptive moving average - FRAMA
            ma_gchan,                                                   // G Channel average - GCHAN
            ma_hull,                                                    // Hull moving average - HMA
            ma_hulle,                                                   // Hull moving average EMA based - HMAe
            ma_hullf,                                                   // Hull moving average Fast EMA based - HMAf
            ma_hullr,                                                   // Hull moving average RMA based - HMAr
            ma_hulls,                                                   // Hull moving average Slow ma based - HMAs
            ma_ie2,                                                     // IE/2
            ma_ilinr,                                                   // Integral of linear regression slope
            ma_itl,                                                     // Instantaneous trendline
            ma_jur,                                                     // Jurik smoothing
            ma_kijun,                                                   // Kijun sen
            ma_lagg,                                                    // Laguerre filter
            ma_leade,                                                   // Leader exponential moving average;
            ma_leadf,                                                   // Leader fast exponential moving average
            ma_leadr,                                                   // Leader relative moving average
            ma_linr,                                                    // Linear regression value - LSMA
            ma_slwma,                                                   // Smoothed linear weighted moving average - SLWMA
            ma_lwma,                                                    // Linear weighted moving average - LWMA
            ma_mcg,                                                     // McGinley Dynamic
            ma_mcg2,                                                    // McGinley Dynamic 2
            ma_mcma,                                                    // McNicholl ema
            ma_nlma,                                                    // Non lag moving average
            ma_nma,                                                     // Natural moving average - NMA
            ma_pdfma,                                                   // Probability density funcion ma (pdfma)
            ma_pema,                                                    // Progressive exponential moving average 
            ma_ptema,                                                   // Pentuple exponential moving average 
            ma_ptrma,                                                   // Pentuple relative moving average 
            ma_pfma,                                                    // Progressive fast exponential moving average 
            ma_prma,                                                    // Progressive relative maving average 
            ma_pwma,                                                    // Parabolic weighted moving average - PWMA
            ma_qema,                                                    // Quadruple exponential moving average - QEMA
            ma_qma,                                                     // Quantile moving average average - QMA
            ma_qurma,                                                   // Quadruple relative moving average - QURMA
            ma_qrma,                                                    // Quadratic regression average
            ma_qwma,                                                    // Quadratic weighted average
            ma_rlma,                                                    // Relative moving average - RLMA
            ma_rma,                                                     // Rolling moving average - RMA
            ma_rms,                                                     // Root mean square - RMS
            ma_rmta,                                                    // Recursive moving trendline - RMTA
            ma_rwavg,                                                   // Range weighted average - RWAVG
            ma_rwema,                                                   // Range weighted EMA - RWEMA
            ma_rwerema,                                                 // Range weighted Efficiency ratio EMA - RWEREMA
            ma_rwemads,                                                 // Range weighted EMA double smooth - RWDSEMA
            ma_rwerdsema,                                               // Range weighted efficiency ratio DSEMA - RWERDSEMA
            ma_rwrma,                                                   // Range weighted RMA - RWRMA
            ma_rwrmads,                                                 // Range weighted RMA double smooth - RWDSRMA
            ma_sma,                                                     // Simple moving average - SMA
            ma_sid,                                                     // Simple decycler - SDEC
            ma_sine,                                                    // Sine weighted moving average
            ma_smma,                                                    // Smoothed moving average - SMMA
            ma_smoo,                                                    // Smoother
            ma_smoo2,                                                   // Smoother JMA like
            ma_ssm,                                                     // Super smoother
            ma_b3p,                                                     // Three pole Ehlers Butterworth
            ma_s3p,                                                     // Three pole Ehlers smoother
            ma_mt3r,                                                    // Fulks/Matulich T3 r adaptive - MT3R;
            ma_tt3r,                                                    // Tillson T3 R adaptive
            ma_tma,                                                     // Triangular moving average - TMA
            ma_tema,                                                    // Triple exponential moving average - TEMA
            ma_trma,                                                    // Triple relative moving average - TRMA
            ma_tsema2,                                                  // Triple smoothed EMA (variation)
            ma_tserema2,                                                // Triple smoothed efficiency ratio EMA (variation)
            ma_twema,                                                   // Triple wilders exponential moving average - TWEMA
            ma_b2p,                                                     // Two pole Ehlers Butterworth
            ma_s2p,                                                     // Two pole Ehlers smoother
            ma_vidya,                                                   // Vidya
            ma_vema,                                                    // Volume weighted ema
            ma_vfma,                                                    // Volume weighted fast ema
            ma_vrma,                                                    // Volume weighted relative moving average
            ma_vwma,                                                    // Volume weighted moving average - VWMA
            ma_zldema,                                                  // Zero lag dema
            ma_zlhulle,                                                 // Zero lag Hull ema based - ZLHMAe
            ma_zlhullf,                                                 // Zero lag Hull fast ema - ZLHMAf
            ma_zlhulls,                                                 // Zero lag Hull slow ma - ZLHMAs
            ma_zlma,                                                    // Zero lag moving average
            ma_zltema,                                                  // Zero lag tema
            ma_zlertema                                                 // Zero lag efficiency ratio tema
      };  
input enMaTypes           inpMethod       = ma_jur;                     // Ma method(if not using REMA'S)
enum  enPrices
      {
            pr_close,                                                   // Close
            pr_open,                                                    // Open
            pr_high,                                                    // High
            pr_low,                                                     // Low
            pr_median,                                                  // Median
            pr_typical,                                                 // Typical
            pr_weighted,                                                // Weighted
            pr_average,                                                 // Average (high+low+open+close)/4
            pr_medianb,                                                 // Average median body (open+close)/2
            pr_tbiased,                                                 // Trend biased price
            pr_tbiased2,                                                // Trend biased (extreme) price
            pr_haclose,                                                 // Heiken ashi close
            pr_haopen,                                                  // Heiken ashi open
            pr_hahigh,                                                  // Heiken ashi high
            pr_halow,                                                   // Heiken ashi low
            pr_hamedian,                                                // Heiken ashi median
            pr_hatypical,                                               // Heiken ashi typical
            pr_haweighted,                                              // Heiken ashi weighted
            pr_haaverage,                                               // Heiken ashi average
            pr_hamedianb,                                               // Heiken ashi median body
            pr_hatbiased,                                               // Heiken ashi trend biased price
            pr_hatbiased2,                                              // Heiken ashi trend biased (extreme) price
            pr_habclose,                                                // Heiken ashi (better formula) close
            pr_habopen,                                                 // Heiken ashi (better formula) open
            pr_habhigh,                                                 // Heiken ashi (better formula) high
            pr_hablow,                                                  // Heiken ashi (better formula) low
            pr_habmedian,                                               // Heiken ashi (better formula) median
            pr_habtypical,                                              // Heiken ashi (better formula) typical
            pr_habweighted,                                             // Heiken ashi (better formula) weighted
            pr_habaverage,                                              // Heiken ashi (better formula) average
            pr_habmedianb,                                              // Heiken ashi (better formula) median body
            pr_habtbiased,                                              // Heiken ashi (better formula) trend biased price
            pr_habtbiased2                                              // Heiken ashi (better formula) trend biased (extreme) price
      };
input enPrices           inpPrice               = pr_close;              // Price
input int                inpLookBack            = 35;                    // Zone look back
input double             inpUpBandPercent       = 90;                    // Upper band percent
input double             inpMdBandPercent       = 50;                    // Middle band percent
input double             inpDnBandPercent       = 10;                    // Lower band percent
input string             __dis__01              = "";                    //.Display settings
input bool               ShowMidLine            = true;                  // Show channel middle line
enum  enColorOn
      {
            cc_onSlope,                                                  // on slope change
            cc_onMiddle,                                                 // on middle line cross
            cc_onLevels                                                  // on outer levels cross
      };
input enColorOn          inpColorOn             = cc_onSlope;            // Change color:
input string             __alr__00              = "";                    //.Alerts settings
input bool               inpAlertsOn            = false;                 // Alerts on?
input bool               inpAlertsOnCurrent     = true;                  // Alerts open bar?
input bool               inpDivAlert            = true;                  // Divergence alerts on?
input int                inpDivMaxBar           = 2;                     // Divergence alerts for bars less than :
input bool               inpAlertsMessage       = true;                  // Alerts message?
input bool               inpAlertsSound         = false;                 // Alerts sound?
input bool               inpAlertsEmail         = false;                 // Alerts email?
input bool               inpAlertsPush          = false;                 // Alerts notification?
input string             __arr__01              = "";                    //.Arrows settings
input bool               inpDisplayArrows       = true;                  // Arrows on chart?
input string             inpObjID               = "adxt o1";             // Objects unique ID
input bool               inpArrowsOnLast        = true;                  // Arrows on mtf bar?
input color              upArrowClr             = clrBlue;               // Bullish arrow color
input color              dnArrowClr             = clrCrimson;            // Bearish arrow color
enum  enArrowsUp
      {
         arr_00 = 108,                                                   // Ball
         arr_01 = 116,                                                   // Medium diamond      
         arr_02 = 159,                                                   // Dot
         arr_03 = 217,                                                   // Fractal up
         arr_04 = 241,                                                   // Hollow up
         arr_05 = 246,                                                   // Hollow right up
         arr_06 = 225,                                                   // Thin up
         arr_07 = 228,                                                   // Thin right up
         arr_08 = 233,                                                   // Heavy up
         arr_09 = 236,                                                   // Heavy right up
         arr_10 = 200,                                                   // Curled up
         arr_11 = 221                                                    // Up in a circle
                                
      };
input enArrowsUp         upArrowCode            = arr_02;                // Bullish arrows code
enum  enArrowsDn
      {
         ard_00 = 108,                                                   // Ball
         ard_01 = 116,                                                   // Medium diamond   
         ard_02 = 159,                                                   // Dot
         ard_03 = 218,                                                   // Fractal down
         ard_04 = 242,                                                   // Hollow down
         ard_05 = 248,                                                   // Hollow right down
         ard_06 = 226,                                                   // Thin down
         ard_07 = 230,                                                   // Thin right down
         ard_08 = 234,                                                   // Heavy down
         ard_09 = 238,                                                   // Heavy right down
         ard_10 = 202,                                                   // Curled down
         ard_11 = 222                                                    // Down in a circle
                     
      };             
input enArrowsDn         dnArrowCode            = ard_02;                // Bearish arrows code           
input int                arrowsSize             = 2;                     // Arrows size
input string             __div__00              = "";                    //.Divergence settings
input bool               inpDivVisible          = true;                  // Divergence visible?
input bool               inpDivValuesVisible    = true;                  // Indicator divergence visible?
input bool               inpDivChartVisible     = true;                  // Chart divergence visible?
input bool               inpDivArrowsVisible    = true;                  // Divergence arrows visible?
input bool               inpDivRegular          = true;                  // Display regular divergence?
input bool               inpDivHidden           = true;                  // Display hidden divergence?
input int                inpDivArrowsSize       = 1;                     // Divergence arrows size
input int                inpDivLinesWidth       = 2;                     // Regular divergence line width
input enArrowsUp         inpDivArrowsCodeUp     = arr_10;                // Divergence arrows bullish code 
input enArrowsDn         inpDivArrowsCodeDn     = ard_10;                // Divergence arrows bearish code 
input color              inpDivBullishColor     = clrDodgerBlue;         // Divergence bullish color
input color              inpDivBearishColor     = clrDarkOrange;         // Divergence bearish color 
input int                inpNumBars             = 500;                   // Number of bars to display
enum  enIterpolate
      {   
         interolate_yes                         = (int)true,             // Interpolate data when in multi time frame
         interolate_no                          = (int)false             // Do not interpolate data when in multi time frame
      };
input enIterpolate       inpInterpolate         = interolate_yes;        // Interpolation

input string             __butt__00             = "";                     //.Button settings
input int                inpButtWindow          = 0;                      // Window
input ENUM_BASE_CORNER   inpButtCorner          = CORNER_RIGHT_UPPER;     // Corner 
input int                inpButtXPos            = 35;                     // Horizontal shift
input int                inpButtYPos            = 35;                     // Vertical shift
input int                inpButtXSize           = 90;                     // Width
input int                inpButtYSize           = 22;                     // Height
input string             inpButtFont            = "Arial";                // Font
input int                inpButtFontSize        = 10;                     // Font size
input color              inpButtColorBorder     = clrBlack;               // Border color
input color              inpButtColorBack       = clrDimGray;             // Background color
input color              inpButtColorText       = clrLime;                // Text color
input string             inpButtText            = "Dz AdxT";              // Text to display


Thank you <3 love u bro
These users thanked the author LUCAS123 for the post:
mrtools


Re: Various Indicators - (MT5)

403
macd & rsi wrote: Thu Sep 04, 2025 6:59 pm This indicator is repainted , isn't it ?
Yes, the TMA (Triangular Moving Average) Centred indicator typically repaints. This is because it uses a centred calculation that incorporates future price data to determine the current value, causing historical signals to adjust as new data comes in. According to discussions in trading communities, such as those by Mladen on Forex Factory and MQL5, centred TMAs inherently recalculate, making them prone to repainting. This means signals that appeared historically may change or disappear when new price bars form, which can mislead backtesting results.

However, non-repainting versions of TMA indicators exist, such as the TMA Non Repaint Alert indicator or those using LWMA (Linear Weighted Moving Average) instead of centred TMA, which avoid recalculation by not relying on future data. These are often recommended for more reliable trading signals. Always test any indicator thoroughly in your trading environment to confirm its behaviour.
These users thanked the author BeatlemaniaSA for the post (total 3):
macd & rsi, kvak, asgariHoo
BEATS V5 - "Enjoy The Quiet Between Trades”

Improve Your Trading Psychology - NO FEAR, NO DOUBT

Ultimate Risk Management - Maximize Your Trades

Re: Various Indicators - (MT5)

404
kvak wrote: Tue Sep 02, 2025 8:25 am Hello, thank you for testings and kindly words.
Can you check if this version working better for you?
If yes, I will add button and also made NRP version with different averages....
Dear kvak , Thank you for your efforts so far ,

If you have free time , could you please add LWMA ( based on the description in the previous post by Dear BeatlemaniaSA) choice to centered settings ,

Really appreciated !
These users thanked the author macd & rsi for the post (total 2):
BeatlemaniaSA, kvak
Plan your trade
,,
Trade your plan

Re: Various Indicators - (MT5)

405
macd & rsi wrote: Thu Sep 04, 2025 7:59 pm Dear kvak , Thank you for your efforts so far ,

If you have free time , could you please add LWMA ( based on the description in the previous post by Dear BeatlemaniaSA) choice to centered settings ,

Really appreciated !
I replace centered TMA with average pack, you may choose average type for first and also second channel.
It is hard to find useful settings, but you may test it... In first picture is fema/ema both period 36.
I use my first version with all lines visible for now...
Yes, centered TMA recalculate, what I wrote in the indicator description.
These users thanked the author kvak for the post (total 6):
macd & rsi, rudiarius, Krunal Gajjar, RodrigoRT7, Jimmy, SdW25


Re: Various Indicators - (MT5)

406
kvak wrote: Fri Sep 05, 2025 8:40 am I replace centered TMA with average pack, you may choose average type for first and also second channel.
It is hard to find useful settings, but you may test it... In first picture is fema/ema both period 36.
I use my first version with all lines visible for now...
Yes, centered TMA recalculate, what I wrote in the indicator description.
Those words , I think , are golden key for knowing indicators ,

there is no perfect indicator which has a 100% gain .
These users thanked the author macd & rsi for the post:
kvak
Plan your trade
,,
Trade your plan

Re: Various Indicators - (MT5)

407
macd & rsi wrote: Fri Sep 05, 2025 3:55 pm Those words , I think , are golden key for knowing indicators ,

there is no perfect indicator which has a 100% gain .
Yes...it is.
And What I want to said is that you must also made first channel fastest then second, not only by periods but also by type of average, for corrected coloring and also play with multipliers of bands...
These users thanked the author kvak for the post:
macd & rsi

Re: Various Indicators - (MT5)

408
kelvinchase wrote: Tue Sep 09, 2025 4:01 am Hi mrtools~ After reading your reply to me on the forum, I can barely understand those code parameters. I can manage to put the formula in and run tests, but the professional stuff is still a bit too hard for me~
But you must know all about this super well! Since you’ve already laid out the idea, if you think this direction works, could you try to figure out the code and verify it when you have time? That way we can also see how the actual effect is~ Please help me out!
This is what I was saying.
These users thanked the author mrtools for the post (total 2):
kelvinchase, macd & rsi

Re: Various Indicators - (MT5)

409
mrtools wrote: Tue Sep 09, 2025 5:58 am This is what I was saying.
Mr. mrtools! You’re so efficient—you finished the code and even included the source code so quickly! You’re truly professional and thoughtful. Now I can finally run proper tests, and you’ve been such a huge help to me—I’m really touched~ :lmao: If I run into anything I don’t understand, I’ll come back to share updates with you later!

Re: Various Indicators - (MT5)

410
mrtools wrote: Tue Sep 09, 2025 5:58 am This is what I was saying.
Mr. mrtools~ I spent the whole morning and noon observing carefully, and I found that the new MT5 indicator is already quite similar to the original "R252 ANACONDA BO" at key positions!
But I also noticed that the red and blue double lines in the original version aren’t actually fixed—they actually move slowly just like XMA! I never noticed that before~ Even so, there are still some obvious differences between the new indicator and the original MT4 one in certain places (I can’t even guess what special factors were added to the original version), like the spots I circled on the chart.
I wonder if you’ll have time later—could you help tweak it a little more? That way the indicator will be even more polished~ Thanks so much for your help!