From da33aa51d9136c1710351e5431c8540ae6863719 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Thu, 22 Jan 2026 06:58:49 +0100 Subject: [PATCH] refactor(indicators): INDICATOR_DIGITS --- Indicators/MyIndicators/DMIStochastic_Pro.mq5 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Indicators/MyIndicators/DMIStochastic_Pro.mq5 b/Indicators/MyIndicators/DMIStochastic_Pro.mq5 index 074955b..f358653 100644 --- a/Indicators/MyIndicators/DMIStochastic_Pro.mq5 +++ b/Indicators/MyIndicators/DMIStochastic_Pro.mq5 @@ -1,9 +1,9 @@ //+------------------------------------------------------------------+ //| DMIStochastic_Pro.mq5 | -//| Copyright 2025, xxxxxxxx| +//| Copyright 2026, xxxxxxxx| //+------------------------------------------------------------------+ -#property copyright "Copyright 2025, xxxxxxxx" -#property version "2.10" // Separate Signal MA Type +#property copyright "Copyright 2026, xxxxxxxx" +#property version "2.20" // Added fixed digits precision #property description "Barbara Star's DMI Stochastic Oscillator. Supports Standard and Heikin Ashi sources." //--- Indicator Window and Plot Properties --- @@ -43,7 +43,6 @@ input int InpFastKPeriod = 10; // Stochastic %K input int InpSlowKPeriod = 3; // Stochastic %K Slowing input ENUM_MA_TYPE InpStochMethod = SMA; // MA Method for %K input int InpSmoothPeriod = 3; // Stochastic %D Period (Signal) -// NEW: Separate MA Type for Signal input ENUM_MA_TYPE InpSignalMethod = SMA; // MA Method for %D //--- Indicator Buffers --- @@ -70,7 +69,6 @@ int OnInit() g_calculator = new CDMIStochasticCalculator(); } -// Pass both MA types to Init if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpDMIPeriod, InpFastKPeriod, InpSlowKPeriod, InpSmoothPeriod, InpStochMethod, InpSignalMethod, InpOscType)) { Print("Failed to create or initialize DMI Stochastic Calculator."); @@ -86,6 +84,9 @@ int OnInit() PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, draw_begin); PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, draw_begin); +//--- Set fixed precision for oscillator (0-100 range) + IndicatorSetInteger(INDICATOR_DIGITS, 2); + return(INIT_SUCCEEDED); }