diff --git a/bots/controllers/directional_trading/bollinger_v1.py b/bots/controllers/directional_trading/bollinger_v1.py index bfb476b1..3d83eda5 100644 --- a/bots/controllers/directional_trading/bollinger_v1.py +++ b/bots/controllers/directional_trading/bollinger_v1.py @@ -70,8 +70,8 @@ async def update_processed_data(self): interval=self.config.interval, max_records=self.max_records) # Add indicators - df.ta.bbands(length=self.config.bb_length, std=self.config.bb_std, append=True) - bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}"] + df.ta.bbands(length=self.config.bb_length, lower_std=self.config.bb_std, upper_std=self.config.bb_std, append=True) + bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] # Generate signal long_condition = bbp < self.config.bb_long_threshold diff --git a/bots/controllers/directional_trading/bollingrid.py b/bots/controllers/directional_trading/bollingrid.py index 374d3676..2294a181 100644 --- a/bots/controllers/directional_trading/bollingrid.py +++ b/bots/controllers/directional_trading/bollingrid.py @@ -99,9 +99,9 @@ async def update_processed_data(self): interval=self.config.interval, max_records=self.max_records) # Add indicators - df.ta.bbands(length=self.config.bb_length, std=self.config.bb_std, append=True) - bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}"] - bb_width = df[f"BBB_{self.config.bb_length}_{self.config.bb_std}"] + df.ta.bbands(length=self.config.bb_length, lower_std=self.config.bb_std, upper_std=self.config.bb_std, append=True) + bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] + bb_width = df[f"BBB_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] # Generate signal long_condition = bbp < self.config.bb_long_threshold diff --git a/bots/controllers/directional_trading/dman_v3.py b/bots/controllers/directional_trading/dman_v3.py index 8e4ee07e..946195b3 100644 --- a/bots/controllers/directional_trading/dman_v3.py +++ b/bots/controllers/directional_trading/dman_v3.py @@ -161,11 +161,11 @@ async def update_processed_data(self): interval=self.config.interval, max_records=self.max_records) # Add indicators - df.ta.bbands(length=self.config.bb_length, std=self.config.bb_std, append=True) + df.ta.bbands(length=self.config.bb_length, lower_std=self.config.bb_std, upper_std=self.config.bb_std, append=True) # Generate signal - long_condition = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}"] < self.config.bb_long_threshold - short_condition = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}"] > self.config.bb_short_threshold + long_condition = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] < self.config.bb_long_threshold + short_condition = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] > self.config.bb_short_threshold # Generate signal df["signal"] = 0 @@ -179,7 +179,7 @@ async def update_processed_data(self): def get_spread_multiplier(self) -> Decimal: if self.config.dynamic_order_spread: df = self.processed_data["features"] - bb_width = df[f"BBB_{self.config.bb_length}_{self.config.bb_std}"].iloc[-1] + bb_width = df[f"BBB_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"].iloc[-1] return Decimal(bb_width / 200) else: return Decimal("1.0") diff --git a/bots/controllers/directional_trading/macd_bb_v1.py b/bots/controllers/directional_trading/macd_bb_v1.py index f792ecf8..c0835166 100644 --- a/bots/controllers/directional_trading/macd_bb_v1.py +++ b/bots/controllers/directional_trading/macd_bb_v1.py @@ -80,10 +80,10 @@ async def update_processed_data(self): interval=self.config.interval, max_records=self.max_records) # Add indicators - df.ta.bbands(length=self.config.bb_length, std=self.config.bb_std, append=True) + df.ta.bbands(length=self.config.bb_length, lower_std=self.config.bb_std, upper_std=self.config.bb_std, append=True) df.ta.macd(fast=self.config.macd_fast, slow=self.config.macd_slow, signal=self.config.macd_signal, append=True) - bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}"] + bbp = df[f"BBP_{self.config.bb_length}_{self.config.bb_std}_{self.config.bb_std}"] macdh = df[f"MACDh_{self.config.macd_fast}_{self.config.macd_slow}_{self.config.macd_signal}"] macd = df[f"MACD_{self.config.macd_fast}_{self.config.macd_slow}_{self.config.macd_signal}"] diff --git a/bots/controllers/generic/quantum_grid_allocator.py b/bots/controllers/generic/quantum_grid_allocator.py index 09744065..09466382 100644 --- a/bots/controllers/generic/quantum_grid_allocator.py +++ b/bots/controllers/generic/quantum_grid_allocator.py @@ -135,8 +135,8 @@ async def update_processed_data(self): if len(candles) == 0: bb_width = self.config.grid_range else: - bb = ta.bbands(candles["close"], length=self.config.bb_length, std=self.config.bb_std_dev) - bb_width = bb[f"BBB_{self.config.bb_length}_{self.config.bb_std_dev}"].iloc[-1] / 100 + bb = ta.bbands(candles["close"], length=self.config.bb_length, lower_std=self.config.bb_std_dev, upper_std=self.config.bb_std_dev) + bb_width = bb[f"BBB_{self.config.bb_length}_{self.config.bb_std_dev}_{self.config.bb_std_dev}"].iloc[-1] / 100 self.processed_data[trading_pair] = { "bb_width": bb_width }