bybits = ccxt.bybit({
"apiKey": bybitapi,
"secret": bybitsec,
"enableRateLimit": True, # Rate limit can be enabled if required
"options": {
"defaultType": "future" } # Or "spot" based on your account type
})
print('create order', bybits.create_order('OP/USDT', 'market', 'sell', 9.92))
это был ответ, потому что у меня нет средств в спотовом кошельке, хотя у меня есть 15 долларов в едином торговом кошельке
Это код, который я использую для торговли фьючерсами. [code]bybits = ccxt.bybit({ "apiKey": bybitapi, "secret": bybitsec, "enableRateLimit": True, # Rate limit can be enabled if required "options": { "defaultType": "future" } # Or "spot" based on your account type })
print('create order', bybits.create_order('OP/USDT', 'market', 'sell', 9.92)) [/code] это был ответ, потому что у меня нет средств в спотовом кошельке, хотя у меня есть 15 долларов в едином торговом кошельке [code]InsufficientFunds: bybit {"retCode":170131,"retMsg":"Insufficient balance.","result":{},"retExtInfo":{},"time":1731527180742} [/code] Это ответ на получение баланса. [code]balance {'info': {'retCode': '0', 'retMsg': 'OK', 'result': {'list': [{'totalEquity': '15.07055921', 'accountIMRate': '', 'totalMarginBalance': '', 'totalInitialMargin': '', 'accountType': 'UNIFIED', 'totalAvailableBalance': '', 'accountMMRate': '', 'totalPerpUPL': '0', 'totalWalletBalance': '15.07055921', 'accountLTV': '', 'totalMaintenanceMargin': '', 'coin': [{'availableToBorrow': '', 'bonus': '0', 'accruedInterest': '0', 'availableToWithdraw': '0.02', 'totalOrderIM': '0', 'equity': '0.02', 'totalPositionMM': '0', 'usdValue': '0.03208356', 'unrealisedPnl': '0', 'collateralSwitch': False, 'spotHedgingQty': '0', 'borrowAmount': '0', 'totalPositionIM': '0', 'walletBalance': '0.02', 'cumRealisedPnl': '-0.02', 'locked': '0', 'marginCollateral': True, 'coin': 'OP'}, {'availableToBorrow': '', 'bonus': '0', 'accruedInterest': '0', 'availableToWithdraw': '14.89246534', 'totalOrderIM': '0', 'equity': '14.89246534', 'totalPositionMM': '0', 'usdValue': '15.03847565', 'unrealisedPnl': '0', 'collateralSwitch': True, 'spotHedgingQty': '0', 'borrowAmount': '0', 'totalPositionIM': '0', 'walletBalance': '14.89246534', 'cumRealisedPnl': '0.16818934', 'locked': '0', 'marginCollateral': True, 'coin': 'USDT'}]}]}, 'retExtInfo': {}, 'time': '1731527901118'}, 'timestamp': 1731527901118, 'datetime': '2024-11-13T19:58:21.118Z', 'OP': {'free': 0.02, 'used': 0.0, 'total': 0.02, 'debt': 0.0}, 'USDT': {'free': 14.89246534, 'used': 0.0, 'total': 14.89246534, 'debt': 0.0}, 'free': {'OP': 0.02, 'USDT': 14.89246534}, 'used': {'OP': 0.0, 'USDT': 0.0}, 'total': {'OP': 0.02, 'USDT': 14.89246534}, 'debt': {'OP': 0.0, 'USDT': 0.0}} [/code] Я хочу создавать рыночные и лимитные ордера. пожалуйста, помогите кто-нибудь