-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Grid] add trailing option #1421
Conversation
self.CONFIG_ENABLE_TRAILING_UP: False, | ||
self.CONFIG_ENABLE_TRAILING_DOWN: False, |
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 False as default value?
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.
trailing up could be true by default indeed.
However, trailing down will sell at a loss, I don't think it should be true by default
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.
Do you think we should enable it by default ? I would say no but we create a default profile with a trailing grid instead
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.
That's a good idea (only for trailing UP I think)
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.
Yes, only trailing up, i'll add it
await asyncio.create_task(_check_open_orders_count(exchange_manager, producer.operational_depth - 1)) # -1 because the very first order can't be at a price <0 | ||
# orders are recreated around 125 | ||
_check_created_orders(producer, trading_api.get_open_orders(exchange_manager), 125) | ||
# now contains buy and sell orders |
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.
👍
cd1637b
to
afd7036
Compare
@@ -1655,6 +1655,81 @@ async def test_order_notification_callback(): | |||
_lock_portfolio_and_create_order_when_possible.assert_called_once() | |||
|
|||
|
|||
async def test_create_mirror_order(): |
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.
👍
08c2b0a
to
cb88979
Compare
up with profile |
_generate_staggered_orders_mock.assert_awaited_once_with(price, ignore_available_funds, trigger_trailing) | ||
_create_not_virtual_orders_mock.assert_awaited_once_with([], price, True) | ||
|
||
# already trailing: skip call |
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-Trading#1170