Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DCA] improve config error messages #1090

Merged
merged 1 commit into from
Oct 26, 2023
Merged
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
10 changes: 8 additions & 2 deletions Trading/Mode/dca_trading_mode/dca_trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ async def create_new_orders(self, symbol, _, state, **kwargs):
use_total_holding=False,
)
else:
self.logger.error(f"Missing {side.value} entry order quantity")
self.logger.error(
f"Missing {side.value} entry order quantity in {self.trading_mode.get_name()} configuration"
f", please set the \"Amount per buy order\" value.")
return []
initial_entry_price = price if self.trading_mode.use_market_entry_orders else \
trading_personal_data.decimal_adapt_price(
Expand All @@ -151,7 +153,11 @@ async def create_new_orders(self, symbol, _, state, **kwargs):
secondary_order_type = trading_enums.TraderOrderType.BUY_LIMIT \
if side is trading_enums.TradeOrderSide.BUY else trading_enums.TraderOrderType.SELL_LIMIT
if not secondary_quantity:
self.logger.error(f"Missing {secondary_order_type.value} secondary order quantity")
self.logger.error(
f"Missing {side.value} secondary entry order quantity in {self.trading_mode.get_name()} "
f"configuration, please set the \"Secondary entry orders amount\" value "
f"when enabling secondary entry orders."
)
else:
for i in range(self.trading_mode.secondary_entry_orders_count):
remaining_funds = initial_available_funds - sum(
Expand Down