Skip to content

Commit 7a8a46e

Browse files
committed
[TradingMode] add is_first_trading_mode_on_this_matrix
1 parent aa4704d commit 7a8a46e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

octobot_trading/modes/abstract_trading_mode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,3 +683,7 @@ def get_trading_mode_consumers(self):
683683
for consumer in self.consumers
684684
if isinstance(consumer, abstract_mode_consumer.AbstractTradingModeConsumer)
685685
]
686+
687+
def is_first_trading_mode_on_this_matrix(self) -> bool:
688+
all_trading_modes = modes_util.get_trading_modes_of_this_type_on_this_matrix(self)
689+
return bool(all_trading_modes and all_trading_modes[0] is self)

0 commit comments

Comments
 (0)