From e4f58c5f82a5d4ec64c9354c7ca5ee2e004c2494 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Sun, 18 Jan 2026 17:37:26 +0100 Subject: [PATCH] refactor(indicators): Updated with flexible Signal Line --- .../Ehlers/2_Oscillators/Cyber_Cycle_Pro.mq5 | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Indicators/MyIndicators/Authors/Ehlers/2_Oscillators/Cyber_Cycle_Pro.mq5 b/Indicators/MyIndicators/Authors/Ehlers/2_Oscillators/Cyber_Cycle_Pro.mq5 index 4f27d26..19bf959 100644 --- a/Indicators/MyIndicators/Authors/Ehlers/2_Oscillators/Cyber_Cycle_Pro.mq5 +++ b/Indicators/MyIndicators/Authors/Ehlers/2_Oscillators/Cyber_Cycle_Pro.mq5 @@ -3,9 +3,9 @@ //| Copyright 2026, xxxxxxxx| //+------------------------------------------------------------------+ #property copyright "Copyright 2026, xxxxxxxx" -#property version "2.00" // Optimized for incremental calculation +#property version "3.00" // Updated with flexible Signal Line #property description "John Ehlers' Cyber Cycle indicator for identifying market cycles." -#property description "Features O(1) calculation and full Heikin Ashi support." +#property description "Features O(1) calculation and flexible Signal Line options." #property indicator_separate_window #property indicator_buffers 2 @@ -26,13 +26,18 @@ #property indicator_width2 1 #property indicator_level1 0.0 -#property indicator_levelstyle STYLE_DOT #include //--- Input Parameters --- -input double InpAlpha = 0.07; // Smoothing factor -input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_MEDIAN_STD; // Price Source (Default: Median) +input group "Cyber Cycle Settings" +input double InpAlpha = 0.07; // Smoothing factor +input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_MEDIAN_STD; // Price Source + +input group "Signal Line Settings" +input ENUM_CYBER_SIGNAL_TYPE InpSignalType = SIGNAL_DELAY_1BAR; // Signal Type +input int InpSignalPeriod = 3; // Period (if MA) +input ENUM_MA_TYPE InpSignalMethod = SMA; // Method (if MA) //--- Indicator Buffers --- double BufferCycle[]; @@ -58,7 +63,8 @@ int OnInit() g_calculator = new CCyberCycleCalculator(); //--- Initialize - if(CheckPointer(g_calculator) == POINTER_INVALID || !g_calculator.Init(InpAlpha)) + if(CheckPointer(g_calculator) == POINTER_INVALID || + !g_calculator.Init(InpAlpha, InpSignalType, InpSignalPeriod, InpSignalMethod)) { Print("Failed to initialize Cyber Cycle Calculator."); return(INIT_FAILED); @@ -66,7 +72,8 @@ int OnInit() //--- Shortname string type = (InpSourcePrice <= PRICE_HA_CLOSE) ? " HA" : ""; - IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("Cyber Cycle%s(%.2f)", type, InpAlpha)); + string sigStr = (InpSignalType == SIGNAL_DELAY_1BAR) ? "Delay" : EnumToString(InpSignalMethod); + IndicatorSetString(INDICATOR_SHORTNAME, StringFormat("Cyber Cycle%s(%.2f, %s)", type, InpAlpha, sigStr)); PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, 7); PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, 9);