bybit limit close/sell/tp order creates short order
See original GitHub issueHi,
This code created a close/sell order
a few days ago but with the latest ccxt version it creates a short order
:
exchange.createOrder({
symbol,
'limit',
'sell',
position,
price
})
Maybe this is bybit related issue. A change in their API ?
How to place a short vs a sell with createOrder
?
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Limit Order - Bybit Learn
A limit order is a function in cryptocurrency trading that allows you to establish the exact price range for selling or buying your...
Read more >Market , Limit and Conditional Order - Bybit Official Help
Limit Order allows traders to set the order price, and the order will be filled at the order price or an executed price...
Read more >Explained: What Are Stop-Loss and Stop-Limit Orders?
A stop-loss order is a universal risk management technique applicable in stocks or even crypto trading to effectively limit potential losses.
Read more >Quick trading functions - Bybit Official Help
The Quick Open limit order is located on the price scale of the trading chart. By clicking the + button, you can set...
Read more >How to Close a Trade on Bybit
Would you like to close a position in order to realize a profit or a loss ... by clicking on either the Close...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@carlosmiei hmm thanks for the explanation.
It seems indeed that the
reduce_only
did the trick. Putting it to true creates a limit close instead of a limit short. I wonder if other exchanges will work to with this setup but this i will test later.Thanks for the help
@flieks It is not a TP limit order, it is a “limit order” only. TP/SL orders are a different thing but I think I get what you meant, by closing the current position you might have a profit or a loss.
If you have an open long position and want to close it yes you should issue an order in the opposite direction (sell in this case) and you should also provide the ‘reduce_only’ flag as true.
Please check out this example that demontrastes precisely that: https://github.com/ccxt/ccxt/blob/master/examples/py/bybit-updated.py#L54