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

Stop Loss feature #89

Open
bludnic opened this issue Dec 23, 2024 · 1 comment
Open

Stop Loss feature #89

bludnic opened this issue Dec 23, 2024 · 1 comment
Labels

Comments

@bludnic
Copy link
Member

bludnic commented Dec 23, 2024

Some exchanges support native stop loss https://docs.ccxt.com/#/?id=stop-loss-orders

Since not all exchanges have support for native SL, we need a configuration for each connector to handle the SL on the bot side:

class Exchange {
  features = {
    // One cancels the other: 
    // - Entry order handled by the bot
    // - Exit order (TP + SL) handled by the exchange
    oco: true,
    // Same as above, but entry order is also handled by the exchange
    ocoAttached: true, // Entry order + OCO (TP + SL)
    // If OCO is unsupported, we can use StopOrder. However, only one order can be placed at a time (due to locked funds), 
    // either TP or SL. Workflow: Place SL order immediately after entry, then monitor the ticker. Once the price nears TP, 
    // cancel SL and place the TP order.
    stopOrder: true,
    // If neither OCO nor StopOrder is supported, TP and SL must be managed on the bot side.
    // Simulate the Stop order for SL: monitor the ticker, and when it hits the stop price, place the SL order on the exchange.
  }
@bludnic
Copy link
Member Author

bludnic commented Dec 24, 2024

Handling SL with CCXT ccxt/ccxt#14595 (comment)

bludnic added a commit that referenced this issue Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant