Skip to content

Commit 7cdbd00

Browse files
committed
[TV] refactor is_first_trading_mode_on_this_matrix
1 parent 2704f6e commit 7cdbd00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Trading/Mode/trading_view_signals_trading_mode/trading_view_signals_trading.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ def is_compatible_trading_type(cls, parsed_signal: dict, trading_type: trading_e
209209

210210
def _log_error_message_if_relevant(self, parsed_data: dict, signal_data: str):
211211
# only log error messages on one TradingViewSignalsTradingMode instance to avoid logging errors multiple times
212-
all_trading_modes = trading_modes.get_trading_modes_of_this_type_on_this_matrix(self)
213-
if all_trading_modes and all_trading_modes[0] is self:
212+
if self.is_first_trading_mode_on_this_matrix():
213+
all_trading_modes = trading_modes.get_trading_modes_of_this_type_on_this_matrix(self)
214214
# Can log error message: this is the first trading mode on this matrix.
215215
# Each is notified by signals and only this one will log errors to avoid duplicating logs
216216
if not any(

0 commit comments

Comments
 (0)