-
Notifications
You must be signed in to change notification settings - Fork 75
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][Staggered] init health check #1114
Conversation
await producer.trigger_staggered_orders_creation() | ||
return created_orders | ||
|
||
async def _should_rebalance_orders(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -42,6 +42,7 @@ class GridTradingMode(staggered_orders_trading.StaggeredOrdersTradingMode): | |||
USER_COMMAND_PAUSE_ORDER_MIRRORING = "pause orders mirroring" | |||
USER_COMMAND_TRADING_PAIR = "trading pair" | |||
USER_COMMAND_PAUSE_TIME = "pause length in seconds" | |||
SUPPORTS_HEALTH_CHECK = False # WIP # set True when self.health_check is implemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't it the same implementation as staggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staggered have min and max prices boundaries, it makes orders "grid" translation much more complicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I see
title="Health check: when enabled, OctoBot will automatically sell traded assets that are not associated " | ||
"to a sell order and that represent at least the 'Health check threshold' part of the " | ||
"portfolio. Health check can be useful to avoid inactive funds, for example if a buy order got " | ||
"filled but no sell order was created. Requires a common quote market for each traded pair. " | ||
"Warning: will sell any asset associated to a trading pair that is not covered by a sell order, " | ||
"even if not bought by OctoBot or this trading mode.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
if ( | ||
self.exchange_manager.is_backtesting | ||
or common_quote is None | ||
or not (self.use_take_profit_exit_orders or self.use_stop_loss) | ||
): | ||
# skipped when: | ||
# - backtesting | ||
# - common_quote is unset | ||
# - not using take profit or stop losses, health check should not be used | ||
return [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we override should_trigger_health_check
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should_trigger_health_check renamed in Drakkar-Software/OctoBot-Trading#1006
assert sell_order.origin_quantity == eth_holdings | ||
assert portfolio["ETH"].total == trading_constants.ZERO | ||
after_eth_usdt_portfolio = portfolio["USDT"].total | ||
assert after_eth_usdt_portfolio > after_btc_usdt_portfolio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
requires Drakkar-Software/OctoBot#2476