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

[Exchanges] support spot stop losses #1396

Merged
merged 2 commits into from
Dec 8, 2024
Merged

[Exchanges] support spot stop losses #1396

merged 2 commits into from
Dec 8, 2024

Conversation

GuillaumeDSM
Copy link
Member

No description provided.

trading_enums.ExchangeTypes.SPOT.value: {
# order that should be self-managed by OctoBot
trading_enums.ExchangeSupportedElements.UNSUPPORTED_ORDERS.value: [
# trading_enums.TraderOrderType.STOP_LOSS, # supported on spot (as spot limit)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also allow stop loss limit as it is supported?

Copy link
Member

@Herklos Herklos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

stop_price = price
price = float(decimal.Decimal(str(price)) * self.STOP_LIMIT_ORDER_INSTANT_FILL_PRICE_RATIO)
# use limit stop loss with a "normally instantly" filled price
return await self._create_limit_stop_loss_order(symbol, quantity, price, stop_price, side, params=params)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to use _create_limit_stop_loss_order

@GuillaumeDSM GuillaumeDSM enabled auto-merge (rebase) December 8, 2024 20:13
@GuillaumeDSM GuillaumeDSM merged commit 129f0cc into dev Dec 8, 2024
5 checks passed
@GuillaumeDSM GuillaumeDSM deleted the stop branch December 8, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants