Skip to content

Commit

Permalink
[DCA] improve config error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Oct 26, 2023
1 parent 574b632 commit a8e9b0d
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit a8e9b0d

Please sign in to comment.