Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Commit 2fcd4f9

Browse files
committed
[ExchangeConfigData] Don't use realtime timeframe if no realtime evaluator is configured
1 parent 024bc18 commit 2fcd4f9

File tree

7 files changed

+22
-7
lines changed

7 files changed

+22
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.5.12] - 2026-01-30
8+
### Fixed
9+
[ExchangeConfigData] Don't use realtime timeframe if no realtime evaluator is configured
10+
711
## [2.5.11] - 2026-01-29
812
### Fixed
913
[PositionValueHolder] Fix futures open orders value calculation when using symbol instead of currency

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OctoBot-Trading [2.5.11](https://github.com/Drakkar-Software/OctoBot-Trading/blob/master/CHANGELOG.md)
1+
# OctoBot-Trading [2.5.12](https://github.com/Drakkar-Software/OctoBot-Trading/blob/master/CHANGELOG.md)
22
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/903b6b22bceb4661b608a86fea655f69)](https://app.codacy.com/gh/Drakkar-Software/OctoBot-Trading?utm_source=github.com&utm_medium=referral&utm_content=Drakkar-Software/OctoBot-Trading&utm_campaign=Badge_Grade_Dashboard)
33
[![PyPI](https://img.shields.io/pypi/v/OctoBot-Trading.svg)](https://pypi.python.org/pypi/OctoBot-Trading/)
44
[![Coverage Status](https://coveralls.io/repos/github/Drakkar-Software/OctoBot-Trading/badge.svg?branch=master)](https://coveralls.io/github/Drakkar-Software/OctoBot-Trading?branch=master)

octobot_trading/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# License along with this library.
1616

1717
PROJECT_NAME = "OctoBot-Trading"
18-
VERSION = "2.5.11" # major.minor.revision
18+
VERSION = "2.5.12" # major.minor.revision

octobot_trading/exchanges/config/exchange_config_data.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def __init__(self, exchange_manager):
8181
# When False, cancelled orders won't be saved in trades history
8282
self.is_saving_cancelled_orders_as_trade: bool = True
8383

84+
# When True, short timeframes will be added for real-time evaluators
85+
self.realtime_data_fetching: bool = False
86+
8487
self.backtesting_exchange_config = None
8588

8689
async def initialize_impl(self):
@@ -396,10 +399,12 @@ def _set_config_time_frame(self):
396399
for time_frame in time_frame_manager.get_config_time_frame(self.config):
397400
if self.exchange_manager.time_frame_exists(time_frame.value):
398401
self.available_required_time_frames.append(time_frame)
399-
if (
400-
not self.exchange_manager.is_backtesting or
401-
(self.exchange_manager.is_backtesting and self.exchange_manager.exchange.use_accurate_price_time_frame())
402-
) or not self.available_required_time_frames:
402+
if self.realtime_data_fetching and (
403+
(
404+
not self.exchange_manager.is_backtesting or
405+
(self.exchange_manager.is_backtesting and self.exchange_manager.exchange.use_accurate_price_time_frame())
406+
) or not self.available_required_time_frames
407+
):
403408
# add shortest time frame for realtime evaluators
404409
client_shortest_time_frame = time_frame_manager.find_min_time_frame(
405410
self.exchange_manager.client_time_frames,

octobot_trading/exchanges/exchange_builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ def set_auto_start_trading_modes(self, auto_start_trading_modes):
319319
self.auto_start_trading_modes = auto_start_trading_modes
320320
return self
321321

322+
def enable_realtime_data_fetching(self, enabled: bool = True):
323+
self.exchange_manager.exchange_config.realtime_data_fetching = enabled
324+
return self
325+
322326

323327
def create_exchange_builder_instance(config, exchange_name):
324328
return ExchangeBuilder(config, exchange_name)

octobot_trading/octobot_channel_consumer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class OctoBotChannelTradingDataKeys(enum.Enum):
4949
BACKTESTING = "backtesting"
5050
MATRIX_ID = "matrix_id"
5151
TENTACLES_SETUP_CONFIG = "tentacles_setup_config"
52+
ENABLE_REALTIME_DATA_FETCHING = "enable_realtime_data_fetching"
5253

5354

5455
async def octobot_channel_callback(bot_id, subject, action, data) -> None:
@@ -70,6 +71,7 @@ async def _handle_creation(bot_id, action, data):
7071
config = data[OctoBotChannelTradingDataKeys.EXCHANGE_CONFIG.value]
7172
exchange_builder = exchanges.create_exchange_builder_instance(config, exchange_name) \
7273
.has_matrix(data[OctoBotChannelTradingDataKeys.MATRIX_ID.value]) \
74+
.enable_realtime_data_fetching(data.get(OctoBotChannelTradingDataKeys.ENABLE_REALTIME_DATA_FETCHING.value, False)) \
7375
.use_tentacles_setup_config(data[OctoBotChannelTradingDataKeys.TENTACLES_SETUP_CONFIG.value]) \
7476
.set_bot_id(bot_id)
7577
try:

tests/exchanges/test_exchange_config_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def init_default(config=None):
3737
config = load_test_config()
3838

3939
exchange_manager = ExchangeManager(config, TestExchangeConfig.EXCHANGE_NAME)
40-
40+
exchange_manager.exchange_config.realtime_data_fetching = True
4141
await exchange_manager.initialize(exchange_config_by_exchange=None)
4242
return config, exchange_manager
4343

0 commit comments

Comments
 (0)