From cfe1d3d82b89ad36abe8b905cb83e265b97fa8ae Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Sat, 20 Dec 2025 18:39:07 +0100 Subject: [PATCH] refactor: Full Engine Integration --- Indicators/MyIndicators/TSI_Pro.mq5 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Indicators/MyIndicators/TSI_Pro.mq5 b/Indicators/MyIndicators/TSI_Pro.mq5 index ede9d42..b163a54 100644 --- a/Indicators/MyIndicators/TSI_Pro.mq5 +++ b/Indicators/MyIndicators/TSI_Pro.mq5 @@ -3,13 +3,13 @@ //| Copyright 2025, xxxxxxxx| //+------------------------------------------------------------------+ #property copyright "Copyright 2025, xxxxxxxx" -#property version "3.00" // Refactored to use MovingAverage_Engine -#property description "Professional True Strength Index (TSI) with a signal line and" -#property description "selectable price source (Standard and Heikin Ashi)." +#property version "4.00" // Full Engine Integration +#property description "Professional True Strength Index (TSI) with fully customizable" +#property description "smoothing methods and selectable price source." //--- Indicator Window and Plot Properties --- #property indicator_separate_window -#property indicator_buffers 2 // TSI and Signal Line +#property indicator_buffers 2 #property indicator_plots 2 //--- Plot 1: TSI Line @@ -31,16 +31,18 @@ #property indicator_level3 0.0 #property indicator_levelstyle STYLE_DOT -//--- Include the calculator engine --- #include //--- Input Parameters --- +input group "TSI Calculation Settings" input int InpSlowPeriod = 25; +input ENUM_MA_TYPE InpSlowMAType = EMA; // Default: EMA (Classic TSI) input int InpFastPeriod = 13; +input ENUM_MA_TYPE InpFastMAType = EMA; // Default: EMA (Classic TSI) input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD; + input group "Signal Line Settings" input int InpSignalPeriod = 13; -// UPDATED: Use ENUM_MA_TYPE input ENUM_MA_TYPE InpSignalMAType = EMA; //--- Indicator Buffers --- @@ -71,7 +73,8 @@ int OnInit() IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("TSI(%d,%d,%d)", InpSlowPeriod, InpFastPeriod, InpSignalPeriod)); } - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpSlowPeriod, InpFastPeriod, InpSignalPeriod, InpSignalMAType)) + if(CheckPointer(g_calculator) == POINTER_INVALID || + !g_calculator.Init(InpSlowPeriod, InpSlowMAType, InpFastPeriod, InpFastMAType, InpSignalPeriod, InpSignalMAType)) { Print("Failed to create or initialize TSI Calculator object."); return(INIT_FAILED);