Comments (6)
@BingBong1234567898765321 I think you can use this symbol instead BTC/USDT:USDT
.
from ccxt.
@BingBong1234567898765321 I think you can use this symbol instead
BTC/USDT:USDT
.
Hi @sc0Vu, BTC/USDT:USDT is the symbol I am using, I just mentioned BTCUSDT in the question for simplicity. I am attempting to switch from BTC/USD:USD to BTC/USDT:USDT
from ccxt.
@BingBong1234567898765321 have you tried set_margin_mode to 'cross' or 'isolated' to see if that has any effect? or set_position_mode with true
(means hedged) or false
(means one-way)
from ccxt.
@ttodua when I run:
exchange.set_margin_mode("cross", symbol = symbol)
#Note, "symbol" is predefined as "BTC/USDT:USDT"
I get this error:
Error: phemex setMarginMode() supports swap(non USDT based) contracts only
When I run:
exchange.set_position_mode(False, symbol = symbol)
It progresses further than I've been so far, so thank you! But when it gets to the section to create the limit order (code outlined above), I get this error:
Error: phemex {"code":11058,"msg":"TE_QTY_TOO_SMALL","data":null}
Is the contract size (amount) calculated differently for USDT contracts vs. USD? With the code I have above:
new_order_contract_size = round(((((usd_balance * percent_of_holdings_to_enter) * leverage) / new_order_price)*1000),1)
this code works properly for USD but seems to be giving the QTY_TOO_SMALL error with USDT. For example, my available balance being multiplied by .95 (because 100% does not allow enough room for fees) and then multiplied by leverage (ex. 20), divided by the price to place limit order at, times 1000 (I think because USD contracts are in Ep), and then rounded to the first decimal.
#Note, I have tried multiplying by 1000, 10000, and 100000 and they all get the same error.
Thank you for your support.
from ccxt.
@ttodua any update on this topic?
Thank you.
from ccxt.
Update: I discovered the solution. Since BTCUSD is settled in USD and BTCUSDT is settled in BTC and the notation is different, the below contract size formula has fixed the issue:
new_order_contract_size = round((((((usd_balance * percent_of_holdings_to_enter)/new_order_price) * leverage))),5)
from ccxt.
Related Issues (20)
- Bybit CreateOrderWs with bound IP Address HOT 3
- Add Upbit private websocket connection HOT 7
- Coinbase fetch_accounts_v3 limit of 100 breaks deposit() HOT 2
- Support request for Hashkey exchange
- Support request for Backpack exchange
- Robinhood release Crypto Trading API
- The order amount must exceed 0.1 USDT while making a trade of 3 USDT HOT 16
- HTX: authentication error in C# HOT 4
- Binance successfully authenticates with the first request, then authentication error comes with the second request HOT 6
- Bitget WatchOrders for Margin does not work HOT 8
- Bitget Cancel order does not work for Margin orders. HOT 3
- ccxtpro watch_orders missing filled orders HOT 8
- Bybit fetch_trades ignores "since" parameter HOT 2
- C# Bitfinex2: System.InvalidCastException : Unable to cast object of type 'System.Collections.Generic.List`1[System.Object]' to type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' HOT 9
- RequestTimeout: kucoin GET https://api.kucoin.com/api/v3/currencies request timed out (30000 ms) HOT 3
- C# Bitfinex2 CreateOrder -> parseOrder returns empty Order object HOT 3
- i'm try to do a code, it use ccxt to create a bot trading in ftx, but it occur (Exception has occurred: AttributeError module 'ccxt' has no attribute 'ftx'. AttributeError: module 'ccxt' has no attribute 'ftx'). What shuold i do? . My code:exchange = ccxt.ftx({ "apiKey": secret.PUBLIC_KEY, "secret": secret.SECRET_KEY }) HOT 1
- error in ccxt HOT 1
- error when import talib HOT 1
- C# Bitstamp CreateOrder Content-Type header is not accepted + wrong nonce generation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccxt.