Calculating LOT Size In OKX
See original GitHub issueI just started using CCXT few days ago. Just wondering if there’s any easy or direct way to calculate future lot size on OKX or do I have to calculate it manually?
For example, Is there any API which can take the available USDT as an input and give the max lot size in return?
Currently I’m doing something like this,
def fetch_order_qty(symbol):
leverage = 10
balance_req = okx.fetchBalance()
balance = balance_req['free']['USDT']
ticker_req = okx.fetchTicker(symbol)
ticker_cost = ticker_req['bid']
# risking 10% of the available capital
trade_capital = 10/100*balance
ticker_qty = (trade_capital / ticker_cost) * leverage * lot_multiplier
return ticker_qty
print(fetch_order_qty('BTC-USDT-SWAP'))
But every symbol got different kind of lots. So is there any ways to calculate it. Or is there a way to just directly buy the order using USDT margin amount without mentioning any LOT quantity using CCXT (OKX) ?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Calculating OKX LOT Size Using CCXT - Stack Overflow
Just wondering if there's any easy or direct way to calculate future lot size on OKX or do I have to calculate it...
Read more >How to Use Trading Tools (Calculator & Trading Data) - OKX
You need to choose Type: long or short. Enter the leverage level in the Leverage entry. Enter the open price, close price and...
Read more >Lotsize — Indicators and Signals - TradingView
Interactive script to calculate lot and position size when you use TradingView to trade on FTX or OKX. You can also use multi...
Read more >Forex Position Size Calculator (2022) - Securities.io
A forex position size and risk calculator allows you to calculate the suggested lot sizes based on equity, risk percentage, & stop loss....
Read more >How to Calculate Position Size in Crypto | CEX.IO Tutorial
Successful traders often stick to hard rules regarding position sizing so they never risk too much on one trade. Once you decide your...
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
Yes, with OKX you can do that using the params-overrides in the following manner:
Hope that answers your question, let us know if not. Feel free to reopen this issue or just ask further questions if any.
@buckydroid have you checked the
market['contractSize']
?On a sidenote, I’d suggest using the unified contract names: