Page 76 of 78

Re: Step Indicators for MT4

Posted: Tue Mar 04, 2025 8:05 am
by mrtools
New Step NEMA indicator with Colored Bars

This is a new version of step ma of nema, seems to hug the price better, but remains to be seen if it is an improvement of the last version.

Re: Step Indicators for MT4

Posted: Tue Mar 04, 2025 11:18 am
by Jimmy
mrtools wrote: Tue Mar 04, 2025 8:05 am This is a new version of step ma of nema, seems to hug the price better, but remains to be seen if it is an improvement of the last version.
Now that looks very good. Indeed an even better version than the old one just trying it now πŸ‘

Re: Step Indicators for MT4

Posted: Tue Mar 04, 2025 7:53 pm
by boytoy
mrtools wrote: Tue Mar 04, 2025 8:05 am New Step NEMA indicator
Nothing short of epic but please! Could we get colored candlesticks instead of the old bars? πŸ˜‡

Re: Step Indicators for MT4

Posted: Tue Mar 04, 2025 8:50 pm
by ionone
MrTools

do you have an idea what this indicator is ?
the author said it's WPR, so maybe some kind of OnChart WPR ?
signals are PERFECT !!

thanks so much

Jeff

Re: Step Indicators for MT4

Posted: Wed Mar 05, 2025 1:04 am
by mrtools
boytoy wrote: Tue Mar 04, 2025 7:53 pm Nothing short of epic but please! Could we get colored candlesticks instead of the old bars? πŸ˜‡
New Step NEMA indicator with Colored Candlesticks

Thanks, changed to colored candlesticks instead of bars.
As per the previous post I wrote, this is a new version of step ma of nema, seems to hug the price better, but remains to be seen if it is an improvement of the last version.

What is the NEMA?

NEMA (n-EMA) can calculate up to 49 EMA's and it uses up to 50 calculating buffers internally.

It calculates EMA, DEMA, TEMA and so on depending on NemaDepth parameter. In simple terms, using "3" in the NemaDepth will give you Triple Exponential Moving Averages. Using "40" in the NemaDepth will give you Quadragintuple Exponential Moving Averages.

Nema can calculate all the known variations (offspring) of EMA : EMA, DEMA, TEMA, DecEMA and so on, up to "levels" or "depth" 50 (Quinquagintuple Exponential Moving Average).

Some known depths:
  • 1 (period) equals EMA: Single Exponential Moving Average
  • 2 (period) equals DEMA: A Double Exponential Moving Average
  • 3 period) equals TEMA: Triple Exponential Moving Average
  • 4 period) equals TEMA: Quadruple (Quad) Exponential Moving Average
  • 5 period) equals TEMA: Quintuple Exponential Moving Average
  • 10 (period) equals DecEMA: Decuple Exponential Moving Average
With 50 (period) being the maximal depth calculated by this indicator.

Re: Step Indicators for MT4

Posted: Wed Mar 05, 2025 1:07 am
by mrtools
ionone wrote: Tue Mar 04, 2025 8:50 pm MrTools

do you have an idea what this indicator is ?
the author said it's WPR, so maybe some kind of OnChart WPR ?
signals are PERFECT !!

thanks so much

Jeff

screenshot.964.jpg
Yes, could be an onChart Wpr not sure though!

Re: Step Indicators for MT4

Posted: Wed Mar 05, 2025 3:17 am
by RodrigoRT7
mrtools wrote: Wed Mar 05, 2025 1:07 am Yes, could be an onChart Wpr not sure though!
Hi Mr Tools and @ionone how are you?

This is the indicator code that Ionone mentioned above.

Code: Select all

//+------------------------------------------------------------------+
//|                                          Atr_Percent-Shargyn.mq4 |
//|                                  Copyright 2025, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_separate_window
//--- Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌ Π΄Π²Π° Π±ΡƒΡ„Π΅Ρ€Π°:
// ΠŸΠ΅Ρ€Π²Ρ‹ΠΉ Π±ΡƒΡ„Π΅Ρ€ - основная линия, рассчитываСмая ΠΏΠΎ динамичСскому ATR%
// Π’Ρ‚ΠΎΡ€ΠΎΠΉ Π±ΡƒΡ„Π΅Ρ€ - сдвинутая Π½Π° ΠΎΠ΄ΠΈΠ½ Π±Π°Ρ€ вСрсия основной Π»ΠΈΠ½ΠΈΠΈ
#property indicator_buffers 2
//--- Настройки ΠΏΠ΅Ρ€Π²ΠΎΠΉ Π»ΠΈΠ½ΠΈΠΈ (динамичСский ATR%)
#property indicator_color1 clrBlue
#property indicator_width1 2
#property indicator_label1 "Dynamic_ATR_Percent"
//--- Настройки Π²Ρ‚ΠΎΡ€ΠΎΠΉ Π»ΠΈΠ½ΠΈΠΈ (смСщённая Π½Π° 1 Π±Π°Ρ€)
#property indicator_color2 clrRed
#property indicator_width2 2
#property indicator_label2 "Shifted"
//--- Настройка уровня Π»ΠΈΠ½ΠΈΠΈ 0
#property indicator_level1 0
#property indicator_levelcolor clrBlue
#property indicator_levelstyle 2 
//--- Π’Ρ…ΠΎΠ΄Π½Ρ‹Π΅ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ для динамичСского ATR
input int    BasePeriodAtr      = 3;     // Π‘Π°Π·ΠΎΠ²Ρ‹ΠΉ ΠΏΠ΅Ρ€ΠΈΠΎΠ΄ для ATR
input int    VolatilityLookback = 14;    // ΠŸΠ΅Ρ€ΠΈΠΎΠ΄ для расчёта срСднСго Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½Π° (High-Low)
input double ThresholdHigh      = 0.002; // ΠŸΠΎΡ€ΠΎΠ³ высокой Π²ΠΎΠ»Π°Ρ‚ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚ΠΈ (Π΅Π΄ΠΈΠ½ΠΈΡ†Ρ‹ Ρ†Π΅Π½Ρ‹)
input double ThresholdLow       = 0.001; // ΠŸΠΎΡ€ΠΎΠ³ Π½ΠΈΠ·ΠΊΠΎΠΉ Π²ΠΎΠ»Π°Ρ‚ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚ΠΈ (Π΅Π΄ΠΈΠ½ΠΈΡ†Ρ‹ Ρ†Π΅Π½Ρ‹)
input int    ExtraBars          = 2;     // Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΠ΅ ΡƒΠ²Π΅Π»ΠΈΡ‡Π΅Π½ΠΈΠ΅ ΠΏΠ΅Ρ€ΠΈΠΎΠ΄Π° ΠΏΡ€ΠΈ высокой Π²ΠΎΠ»Π°Ρ‚ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚ΠΈ
input int    ReduceBars         = 1;     // Π‘Π½ΠΈΠΆΠ΅Π½ΠΈΠ΅ ΠΏΠ΅Ρ€ΠΈΠΎΠ΄Π° ΠΏΡ€ΠΈ Π½ΠΈΠ·ΠΊΠΎΠΉ Π²ΠΎΠ»Π°Ρ‚ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚ΠΈ
//--- ОбъявляСм Π±ΡƒΡ„Π΅Ρ€Ρ‹ для расчёта Π»ΠΈΠ½ΠΈΠΉ
double DynamicATRBuffer[]; // Π‘ΡƒΡ„Π΅Ρ€ для основной Π»ΠΈΠ½ΠΈΠΈ (ATR%)
double ShiftedBuffer[];    // Π‘ΡƒΡ„Π΅Ρ€ для Π²Ρ‚ΠΎΡ€ΠΎΠΉ Π»ΠΈΠ½ΠΈΠΈ (сдвинутая Π½Π° 1 Π±Π°Ρ€)
//--- БтатичСская пСрСмСнная для ΡΠΊΠΎΠ»ΡŒΠ·ΡΡ‰Π΅ΠΉ суммы Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ΠΎΠ² (High - Low)
// Она ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ для вычислСния срСднСго Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½Π° Π·Π° VolatilityLookback Π±Π°Ρ€ΠΎΠ²
static double currentSumRange = 0.0;
//+------------------------------------------------------------------+
//| Ѐункция ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΈΠ½Π΄ΠΈΠΊΠ°Ρ‚ΠΎΡ€Π°                                 |
//+------------------------------------------------------------------+
int OnInit()
  {
   // ВыдСляСм Π΄Π²Π° Π±ΡƒΡ„Π΅Ρ€Π° для ΠΈΠ½Π΄ΠΈΠΊΠ°Ρ‚ΠΎΡ€Π°
   IndicatorBuffers(2);
   // НастраиваСм ΠΏΠ΅Ρ€Π²ΡƒΡŽ линию: рисуСм линию ΠΈ связываСм с Π±ΡƒΡ„Π΅Ρ€ΠΎΠΌ DynamicATRBuffer
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, DynamicATRBuffer);
   // НастраиваСм Π²Ρ‚ΠΎΡ€ΡƒΡŽ линию: рисуСм линию ΠΈ связываСм с Π±ΡƒΡ„Π΅Ρ€ΠΎΠΌ ShiftedBuffer
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(1, ShiftedBuffer);
   // Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅ΠΌ статус ΡƒΡΠΏΠ΅ΡˆΠ½ΠΎΠΉ ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Основная функция расчёта ΠΈΠ½Π΄ΠΈΠΊΠ°Ρ‚ΠΎΡ€Π°                              |
//+------------------------------------------------------------------+
int OnCalculate(const int      rates_total, const int prev_calculated,
                const datetime &time[],     const double      &open[],
                const double   &high[],     const double       &low[],
                const double   &close[],    const long &tick_volume[],
                const long     &volume[],   const int       &spread[])
  {
   // ΠŸΡ€ΠΎΠ²Π΅Ρ€ΡΠ΅ΠΌ, Ρ‡Ρ‚ΠΎ имССтся достаточно Π±Π°Ρ€ΠΎΠ² для расчёта
   if(rates_total < VolatilityLookback + 1)
      return(0);
      
   // ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅ΠΌ Π³Ρ€Π°Π½ΠΈΡ‡Π½ΠΎΠ΅ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΎΠΊΠ½ΠΎ суммирования (Π±Π°Ρ€ΠΎΠ² для VolatilityLookback)
   // ΠΏΠΎΠ»Π½ΠΎΡΡ‚ΡŒΡŽ ΡƒΠΊΠ»Π°Π΄Ρ‹Π²Π°Π»ΠΎΡΡŒ Π² историчСских Π΄Π°Π½Π½Ρ‹Ρ…
   int limit = rates_total - VolatilityLookback - 1;
   
   // ΠŸΠ΅Ρ€Π΅ΡΡ‡ΠΈΡ‚Ρ‹Π²Π°Π΅ΠΌ ΡΠΊΠΎΠ»ΡŒΠ·ΡΡ‰ΡƒΡŽ сумму для ΠΏΠ΅Ρ€Π²ΠΎΠ³ΠΎ ΠΎΠ±Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°Π΅ΠΌΠΎΠ³ΠΎ Π±Π°Ρ€Π°
   // Π‘ΡƒΠΌΠΌΠΈΡ€ΡƒΠ΅ΠΌ разности (high - low) для Π±Π°Ρ€ΠΎΠ² с индСксами ΠΎΡ‚ 1 Π΄ΠΎ VolatilityLookback
   currentSumRange = 0.0;
   for(int j = 1; j <= VolatilityLookback && j < rates_total; j++)
      currentSumRange += ( high[j] - low[j] );
   
   // Основной Ρ†ΠΈΠΊΠ» расчёта ΠΏΠΎ всСм Π±Π°Ρ€Π°ΠΌ ΠΎΡ‚ 0 Π΄ΠΎ limit
   for(int i = 0; i < limit; i++)
   {
      // 1. ВычисляСм срСдний Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Π·Π° VolatilityLookback Π±Π°Ρ€ΠΎΠ²,
      //    начиная с Π±Π°Ρ€Π° с индСксом i+1
      double avgRange = currentSumRange / VolatilityLookback;
      
      // 2. ΠžΠΏΡ€Π΅Π΄Π΅Π»ΡΠ΅ΠΌ динамичСский ΠΏΠ΅Ρ€ΠΈΠΎΠ΄ ATR:
      //    НачинаСм с Π±Π°Π·ΠΎΠ²ΠΎΠ³ΠΎ ΠΏΠ΅Ρ€ΠΈΠΎΠ΄Π° BasePeriodAtr ΠΈ ΠΊΠΎΡ€Ρ€Π΅ΠΊΡ‚ΠΈΡ€ΡƒΠ΅ΠΌ Π΅Π³ΠΎ
      //    Π² зависимости ΠΎΡ‚ Ρ‚ΠΎΠ³ΠΎ, насколько avgRange Π²Ρ‹ΡˆΠ΅ ΠΏΠΎΡ€ΠΎΠ³Π° ThresholdHigh
      //    ΠΈΠ»ΠΈ Π½ΠΈΠΆΠ΅ ΠΏΠΎΡ€ΠΎΠ³Π° ThresholdLow.
      int dynamicPeriod = BasePeriodAtr;
      if(avgRange > ThresholdHigh)
         dynamicPeriod = BasePeriodAtr + ExtraBars;
      else if(avgRange < ThresholdLow)
         dynamicPeriod = BasePeriodAtr - ReduceBars;
      if(dynamicPeriod < 1)
         dynamicPeriod = 1;
      
      // 3. ВычисляСм ATR с динамичСским ΠΏΠ΅Ρ€ΠΈΠΎΠ΄ΠΎΠΌ для Ρ‚Π΅ΠΊΡƒΡ‰Π΅Π³ΠΎ Π±Π°Ρ€Π° i
      //    Ѐункция iATR Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ATR для Π·Π°Π΄Π°Π½Π½ΠΎΠ³ΠΎ ΠΏΠ΅Ρ€ΠΈΠΎΠ΄Π° ΠΈ Π±Π°Ρ€Π°
      double atrValue = iATR(_Symbol, PERIOD_CURRENT, dynamicPeriod, i);
      
      // 4. РассчитываСм ΠΏΡ€ΠΎΡ†Π΅Π½Ρ‚Π½ΠΎΠ΅ ΠΎΡ‚ΠΊΠ»ΠΎΠ½Π΅Π½ΠΈΠ΅ ATR ΠΎΡ‚ срСднСго Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½Π°:
      //    ((atrValue / avgRange) - 1) * 100
      double percentDeviation = 0.0;
      if(avgRange != 0)
         percentDeviation = ((atrValue / avgRange) - 1) * 100;
      
      // БохраняСм вычислСнноС Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ Π² Π±ΡƒΡ„Π΅Ρ€ основной Π»ΠΈΠ½ΠΈΠΈ
      DynamicATRBuffer[i] = percentDeviation;
      
      // 5. Π€ΠΎΡ€ΠΌΠΈΡ€ΡƒΠ΅ΠΌ Π²Ρ‚ΠΎΡ€ΡƒΡŽ линию ΠΊΠ°ΠΊ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΏΡ€Π΅Π΄Ρ‹Π΄ΡƒΡ‰Π΅Π³ΠΎ Π±Π°Ρ€Π° основной Π»ΠΈΠ½ΠΈΠΈ.
      //    Если i > 0, Ρ‚ΠΎΠ³Π΄Π° Π±Π΅Ρ€Π΅ΠΌ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΈΠ· DynamicATRBuffer[i-1], ΠΈΠ½Π°Ρ‡Π΅ – Ρ‚Π΅ΠΊΡƒΡ‰Π΅Π΅ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅.
      if(i > 0)
         ShiftedBuffer[i] = DynamicATRBuffer[i-1];
      else
         ShiftedBuffer[i] = DynamicATRBuffer[i];
      
      // 6. ОбновляСм ΡΠΊΠΎΠ»ΡŒΠ·ΡΡ‰ΡƒΡŽ сумму для ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅Π³ΠΎ Π±Π°Ρ€Π°:
      //    - Π’Ρ‹Ρ‡ΠΈΡ‚Π°Π΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Π±Π°Ρ€Π° с индСксом i+1
      //    - ΠŸΡ€ΠΈΠ±Π°Π²Π»ΡΠ΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Π±Π°Ρ€Π° с индСксом i+VolatilityLookback+1 (Ссли ΠΎΠ½ доступСн)
      if(i < limit - 1)
      {
         int removeIndex = i + 1;
         int addIndex = i + VolatilityLookback + 1;
         if(addIndex < rates_total)
         {
            currentSumRange = currentSumRange - (high[removeIndex] - low[removeIndex])
                                              + (high[addIndex] - low[addIndex]);
         }
      }
   }   
   // Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅ΠΌ ΠΎΠ±Ρ‰Π΅Π΅ количСство Π±Π°Ρ€ΠΎΠ², ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Π°Π½Π½Ρ‹Ρ… ΠΈΠ½Π΄ΠΈΠΊΠ°Ρ‚ΠΎΡ€ΠΎΠΌ
"This indicator calculates dynamic ATR% - the percentage deviation of the moving ATR value (with a dynamic period depending on volatility) from the average range (High–Low) for a given period. The first line shows the resulting ATR% value, and the second line is the same value, shifted one bar back. Thus, the indicator allows you to assess market volatility by taking into account the adaptive period and visually display a delayed signal"

credits to Sharg.yn

Re: Step Indicators for MT4

Posted: Wed Mar 05, 2025 6:56 pm
by boytoy
mrtools wrote: Wed Mar 05, 2025 1:04 am New Step NEMA indicator with Colored Candlesticks
Candlesticks and lines arent working when you turn off Auto Candlestick Width option can we get a fix please... super eager to use this over the old Step nema

Re: Step Indicators for MT4

Posted: Thu Mar 06, 2025 2:28 am
by mrtools
boytoy wrote: Wed Mar 05, 2025 6:56 pm Candlesticks and lines arent working when you turn off Auto Candlestick Width option can we get a fix please... super eager to use this over the old Step nema
Thanks again, something weird was going on when turning off auto width and using filtered price, so changed a lot of stuff and it seems to be working now when auto width off, tried most of the other options and seems good now, hopefully! Posted the fixed version in the last post and sorry for the hassle! TBH never figured out exactly what was causing the error was something had never seen before.

Re: Step Indicators for MT4

Posted: Thu Mar 06, 2025 4:33 am
by vvFish