From c72eadc91c2ebdcdb470bca239fca93037888204 Mon Sep 17 00:00:00 2001 From: mikasoukhov Date: Wed, 16 Jul 2025 20:26:09 +0300 Subject: [PATCH] Small changes. --- .../common/indicator_extensions.py | 23 ++++++++++++++++++- .../01_MultiConnect/MainPanel.xaml.cs | 4 ++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Algo.Analytics.Python/common/indicator_extensions.py b/Algo.Analytics.Python/common/indicator_extensions.py index e4740f95c..d60723210 100644 --- a/Algo.Analytics.Python/common/indicator_extensions.py +++ b/Algo.Analytics.Python/common/indicator_extensions.py @@ -109,4 +109,25 @@ def create_empty_value(indicator, time): :param time: The time of the value (DateTimeOffset). :return: The empty indicator value (IIndicatorValue). """ - return IndicatorHelper.CreateEmptyValue(indicator, time) \ No newline at end of file + return IndicatorHelper.CreateEmptyValue(indicator, time) + +def process_float(indicator, value, time, is_final=True): + """ + Process the indicator with a numeric value. + :param indicator: The indicator (IIndicator). + :param value: The numeric value (Decimal). + :param time: The time of the value (DateTimeOffset). + :param is_final: Whether the value is final (default is True). + :return: The new value of the indicator (IIndicatorValue). + """ + decimal_value = Decimal(value) + return IndicatorHelper.Process(indicator, decimal_value, time, is_final) + +def process_candle(indicator, candle): + """ + Process the indicator with a candle. + :param indicator: The indicator (IIndicator). + :param candle: The candle (ICandleMessage). + :return: The new value of the indicator (IIndicatorValue). + """ + return IndicatorHelper.Process(indicator, candle) \ No newline at end of file diff --git a/Samples/09_Advanced/01_MultiConnect/MainPanel.xaml.cs b/Samples/09_Advanced/01_MultiConnect/MainPanel.xaml.cs index fcb6c33c1..73e476ab7 100644 --- a/Samples/09_Advanced/01_MultiConnect/MainPanel.xaml.cs +++ b/Samples/09_Advanced/01_MultiConnect/MainPanel.xaml.cs @@ -166,8 +166,8 @@ public partial class MainPanel Connector.Disconnected += () => this.GuiAsync(() => ChangeConnectStatus(false)); - Connector.ConnectionLost += a => Connector.AddErrorLog(LocalizedStrings.ConnectionLost); ; - Connector.ConnectionRestored += a => Connector.AddInfoLog(LocalizedStrings.ConnectionRestored); ; + Connector.ConnectionLost += a => Connector.AddErrorLog(LocalizedStrings.ConnectionLost); + Connector.ConnectionRestored += a => Connector.AddInfoLog(LocalizedStrings.ConnectionRestored); // subscribe on error event //Connector.Error += error =>