Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bots/controllers/directional_trading/bollinger_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bots/controllers/directional_trading/bollingrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions bots/controllers/directional_trading/dman_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions bots/controllers/directional_trading/macd_bb_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]

Expand Down
4 changes: 2 additions & 2 deletions bots/controllers/generic/quantum_grid_allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down