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

Liqiduitation Even If set stoploss_on_exchange = True #7577

Closed
bleriot14 opened this issue Oct 12, 2022 · 5 comments
Closed

Liqiduitation Even If set stoploss_on_exchange = True #7577

bleriot14 opened this issue Oct 12, 2022 · 5 comments
Labels
Non-spot Non-spot (margin, leverage, futures) related issues and Pull requests Question Questions - will be closed after some period of inactivity.

Comments

@bleriot14
Copy link

Describe your environment
Operating system: Windows 10
Python Version: Python 3.10.4
CCXT version: ------
Freqtrade Version: 2022.9.1

Your question

Hi again. I am using 75x leverage, 0.55 roi and 0.45 stoploss. (Binance Future)

I want to make my bot set stoploss and stop limit(roi) imidiately after entering long or short. So in the documantations, I found this setting=

order_types =
{
"entry": "limit",
"exit": "limit",
"emergency_exit": "market",
"stoploss": "limit",
"stoploss_on_exchange": True
}

Even if I do that, I am being liquidated sometimes. And even if I set stoploss 0,45, my positions ending with %55 loss with normal exit signals(not liquidation). It was more accurate when I didn't set stoploss_on_exchange = True .

What is wrong with this settings?
What should I set also ?

@bleriot14 bleriot14 added the Question Questions - will be closed after some period of inactivity. label Oct 12, 2022
@xmatthias
Copy link
Member

Your setting results in a stop limit order.
This order has 2 prices - a stop price (when the order comes into effect) - and a limit price (what's the worst price you're accepting for the order). the limit price is usually 1% away (configured via stoploss_on_exchange_limit_ratio).

without seeing the details on exchange (stop order price, liquidation, ...) it's difficult to tell - but with such high leverage, it's pretty likely that your stop order is not filled immediately - which is then triggering the liquidation, which is probably just 1-2 ticks below the stop price - so your stoploss is effectively skipped.

with leverage this high, it's single ticks that can cause a position move of several % - causing a liquidation pretty easily.

It's also unclear if it's a real liquidation (exchange liquidated) or one that freqtrade detected and reported as liquidation - which is quite a difference.

@xmatthias xmatthias added the Non-spot Non-spot (margin, leverage, futures) related issues and Pull requests label Oct 12, 2022
@bleriot14
Copy link
Author

So, if I set stoploss_on_exchange_limit_ratio = 0.99 with 75 leverage, does it mean my worst case losing will be %1 ? Or %75 ? (1 × 75)

And can I set stoploss_on_exchange_limit_ratio = 0,998 ? Is it allowed ?

@xmatthias
Copy link
Member

you can use any number between 1 and 0.
I think you've misunderstood the problem though - if you set it to 0.998 - you're pulling the limit price closer to the stoploss - and with that, increasing the chance of a blown stoploss (if price moves past your limit - it'll not get filled until price returns), and with that also of a liquidation.

@bleriot14
Copy link
Author

bleriot14 commented Oct 13, 2022

Can I set limit price imidiately when enter a new position without waiting stop price ?

And, how can I set roi position like stoploss_on_exchange = True

I want to open stop loss and take profit order imidiately when entering new position .

@xmatthias
Copy link
Member

Freqtrade currently doesn't support take profit orders.
Feel free to subscribe to #7499 for updates (don't expect updates on this topic anytime soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non-spot Non-spot (margin, leverage, futures) related issues and Pull requests Question Questions - will be closed after some period of inactivity.
Projects
None yet
Development

No branches or pull requests

2 participants