当前位置: 首页 > news >正文

成都学校网站制作公司图书网站开发需求文档模板

成都学校网站制作公司,图书网站开发需求文档模板,义乌网图科技有限公司,绍兴网站制作企业Binance_interface API U本位合约交易账户 Github地址PyTed量化交易研究院 1. API U本位合约交易账户接口总览 方法解释Pathset_positionSide_dual更改持仓模式/fapi/v1/positionSide/dualget_positionSide_dual查询持仓模式/fapi/v1/positionSide/dualset_multiAssetsMargi…Binance_interface API U本位合约交易账户 Github地址PyTed量化交易研究院 1. API U本位合约交易账户接口总览 方法解释Pathset_positionSide_dual更改持仓模式/fapi/v1/positionSide/dualget_positionSide_dual查询持仓模式/fapi/v1/positionSide/dualset_multiAssetsMargin更改联合保证金模式/fapi/v1/multiAssetsMarginget_multiAssetsMargin查询联合保证金模式/fapi/v1/multiAssetsMarginset_order下单/fapi/v1/orderset_order_test测试下单接口 (TRADE)/fapi/v1/order/testalter_order修改订单/fapi/v1/orderset_batchOrders批量下单/fapi/v1/batchOrdersalter_batchOrders批量修改订单/fapi/v1/batchOrdersget_orderAmendment查询订单修改历史/fapi/v1/orderAmendmentget_order查询订单/fapi/v1/ordercancel_order撤销订单/fapi/v1/ordercancel_allOpenOrders撤销全部订单/fapi/v1/allOpenOrderscancel_batchOrders批量撤销订单/fapi/v1/batchOrdersset_countdownCancelAll倒计时撤销所有订单/fapi/v1/countdownCancelAllget_openOrder查询当前挂单/fapi/v1/openOrderget_openOrders查看当前全部挂单/fapi/v1/openOrdersget_allOrders查询所有订单(包括历史订单)/fapi/v1/allOrdersget_balance账户余额V2/fapi/v2/balanceget_account账户信息V2/fapi/v2/accountset_leverage调整开仓杠杆/fapi/v1/leverageset_marginType变换逐全仓模式/fapi/v1/marginTypeset_positionMargin调整逐仓保证金/fapi/v1/positionMarginget_positionMargin_history逐仓保证金变动历史/fapi/v1/positionMargin/historyget_positionRisk用户持仓风险V2/fapi/v2/positionRiskget_userTrades账户成交历史/fapi/v1/userTradesget_income获取账户损益资金流水/fapi/v1/incomeget_leverageBracket杠杆分层标准/fapi/v1/leverageBracketget_adlQuantile持仓ADL队列估算/fapi/v1/adlQuantileget_forceOrders用户强平单历史/fapi/v1/forceOrdersget_apiTradingStatus合约交易量化规则指标/fapi/v1/apiTradingStatusget_commissionRate用户手续费率/fapi/v1/commissionRateget_income_asyn获取合约资金流水下载Id/fapi/v1/income/asynget_income_asyn_id通过下载Id获取合约资金流水下载链接/fapi/v1/income/asyn/idget_order_asyn获取合约订单历史下载Id/fapi/v1/order/asynget_order_asyn_id通过下载Id获取合约订单下载链接/fapi/v1/order/asyn/idget_trade_asyn获取合约交易历史下载Id/fapi/v1/trade/asynget_trade_asyn_id通过下载Id获取合约交易历史下载链接/fapi/v1/trade/asyn/id 2. 模型实例化 from binance_interface.api import UM from binance_interface.app.utils import eprint# 转发需搭建转发服务器可参考https://github.com/pyted/binance_resender proxy_host None key xxxx secret xxxxum UM(keykey, secretsecret,proxy_hostproxy_host ) accountTrade um.accountTrade3. 账户相关 3.1 账户余额V2 get_balance balance_result accountTrade.get_balance() eprint(balance_result)输出 {code: 200,data: [{accountAlias: SguXuXmYSgTiSgfW,asset: BTC,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: XRP,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: TUSD,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: BNB,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: ETH,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: USDT,balance: 98.36687032,crossWalletBalance: 98.36687032,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: USDP,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......},{accountAlias: SguXuXmYSgTiSgfW,asset: USDC,balance: 0.00000000,crossWalletBalance: 0.00000000,crossUnPnl: 0.00000000,...: ......}],msg: }3.2 账户信息V2 get_account account_result accountTrade.get_account() eprint(account_result)输出 {code: 200,data: {feeTier: 0,canTrade: True,canDeposit: True,canWithdraw: True,tradeGroupId: -1,updateTime: 0,multiAssetsMargin: False,totalInitialMargin: 0.00000000,totalMaintMargin: 0.00000000,totalWalletBalance: 98.36687032,totalUnrealizedProfit: 0.00000000,totalMarginBalance: 98.36687032,totalPositionInitialMargin: 0.00000000,totalOpenOrderInitialMargin: 0.00000000,totalCrossWalletBalance: 98.36687032,totalCrossUnPnl: 0.00000000,availableBalance: 98.36687032,maxWithdrawAmount: 98.36687032,assets: [{asset: BTC,walletBalance: 0.00000000,unrealizedProfit: 0.00000000,marginBalance: 0.00000000,maintMargin: 0.00000000,...: ......},{asset: XRP,walletBalance: 0.00000000,unrealizedProfit: 0.00000000,marginBalance: 0.00000000,maintMargin: 0.00000000,...: ......},{asset: TUSD,walletBalance: 0.00000000,unrealizedProfit: 0.00000000,marginBalance: 0.00000000,maintMargin: 0.00000000,...: ......},{asset: BNB,walletBalance: 0.00000000,unrealizedProfit: 0.00000000,marginBalance: 0.00000000,maintMargin: 0.00000000,...: ......},{asset: ETH,walletBalance: 0.00000000,unrealizedProfit: 0.00000000,marginBalance: 0.00000000,maintMargin: 0.00000000,...: ......},......],positions: [{symbol: SNTUSDT,initialMargin: 0,maintMargin: 0,unrealizedProfit: 0.00000000,positionInitialMargin: 0,...: ......},{symbol: SNTUSDT,initialMargin: 0,maintMargin: 0,unrealizedProfit: 0.00000000,positionInitialMargin: 0,...: ......},{symbol: SUSHIUSDT,initialMargin: 0,maintMargin: 0,unrealizedProfit: 0.00000000,positionInitialMargin: 0,...: ......},{symbol: SUSHIUSDT,initialMargin: 0,maintMargin: 0,unrealizedProfit: 0.00000000,positionInitialMargin: 0,...: ......},{symbol: BTSUSDT,initialMargin: 0,maintMargin: 0,unrealizedProfit: 0.00000000,positionInitialMargin: 0,...: ......},......]},msg: }3.3 用户手续费率 get_commissionRate commissionRate_result accountTrade.get_commissionRate(symbolMANAUSDT) eprint(commissionRate_result)输出 {code: 200,data: {symbol: MANAUSDT, makerCommissionRate: 0.000200, takerCommissionRate: 0.000500},msg: }3.4 账户成交历史 get_userTrades userTrade_result accountTrade.get_userTrades(symbolMANAUSDT) eprint(userTrade_result, data_length5)输出 {code: 200,data: [{symbol: MANAUSDT,id: 483783770,orderId: 10483040021,side: BUY,price: 0.4742,...: ......},{symbol: MANAUSDT,id: 483848645,orderId: 10484723637,side: BUY,price: 0.4798,...: ......},{symbol: MANAUSDT,id: 483859726,orderId: 10485084149,side: BUY,price: 0.4845,...: ......},{symbol: MANAUSDT,id: 483859777,orderId: 10485085711,side: BUY,price: 0.4843,...: ......},{symbol: MANAUSDT,id: 483859823,orderId: 10485087594,side: BUY,price: 0.4843,...: ......},......],msg: }4. 持仓与杠杆 4.1 更改持仓模式 set_positionSide_dual # true: 双向持仓模式false: 单向持仓模式 # 如果已经是该持仓模式返回{code: -4059, msg: No need to change position side.} accountTrade.set_positionSide_dual(dualSidePositionTrue)输出 {code: -4059, msg: No need to change position side.}4.2 查询持仓模式 get_positionSide_dual accountTrade.get_positionSide_dual()输出 {code: 200, data: {dualSidePosition: True}, msg: }4.3 变换逐全仓模式 set_marginType # 保证金模式 ISOLATED(逐仓), CROSSED(全仓) # 如果已经是该模式返回{code: -4046, msg: No need to change margin type.} accountTrade.set_marginType(symbolMANAUSDT, marginTypeISOLATED)输出 {code: -4046, msg: No need to change margin type.}4.4 调整开仓杠杆 set_leverage set_leverage_result accountTrade.set_leverage(symbolMANAUSDT, leverage1) eprint(set_leverage_result)输出 {code: 200, data: {symbol: MANAUSDT, leverage: 1, maxNotionalValue: 10000000}, msg: }5. 交易与订单 5.1 下单 set_order 5.1.1 限单价开仓 # 开多 set_order_result accountTrade.set_order(symbolMANAUSDT,price0.4,quantity15,sideBUY,typeLIMIT,timeInForceGTC,positionSideLONG, ) eprint(set_order_result)输出 {code: 200,data: {orderId: 10518283927,symbol: MANAUSDT,status: NEW,clientOrderId: LfDRA0odbXwy559agURLiU,price: 0.4000,avgPrice: 0.00,origQty: 15,executedQty: 0,cumQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: False,closePosition: False,side: BUY,positionSide: LONG,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,updateTime: 1706245923758},msg: }5.1.2 市单价开仓 # 开空 set_order_result accountTrade.set_order(symbolMANAUSDT,quantity15,sideSELL,typeMARKET,positionSideSHORT, ) eprint(set_order_result)输出 {code: 200,data: {orderId: 10518286864,symbol: MANAUSDT,status: NEW,clientOrderId: w88GuTXAZy5LB2KDhAJdD2,price: 0.0000,avgPrice: 0.00,origQty: 15,executedQty: 0,cumQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: MARKET,reduceOnly: False,closePosition: False,side: SELL,positionSide: SHORT,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: MARKET,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,updateTime: 1706245988691},msg: }5.1.3 限单价平仓 # 平多 set_order_result accountTrade.set_order(symbolMANAUSDT,price1,quantity12,sideSELL,typeLIMIT,timeInForceGTC,positionSideLONG, ) eprint(set_order_result)输出 {code: 200,data: {orderId: 10518287024,symbol: MANAUSDT,status: NEW,clientOrderId: PQ5ysCRUEYDaejOrKph9ot,price: 1.0000,avgPrice: 0.00,origQty: 12,executedQty: 0,cumQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: True,closePosition: False,side: SELL,positionSide: LONG,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,updateTime: 1706245995585},msg: }5.1.4 市单价平仓 # 平空 set_order_result accountTrade.set_order(symbolMANAUSDT,quantity10,sideBUY,typeMARKET,positionSideSHORT, ) eprint(set_order_result)输出 {code: 200,data: {orderId: 10518287813,symbol: MANAUSDT,status: NEW,clientOrderId: FeGIIggMT0F8R6XPVN7oVQ,price: 0.0000,avgPrice: 0.00,origQty: 10,executedQty: 0,cumQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: MARKET,reduceOnly: True,closePosition: False,side: BUY,positionSide: SHORT,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: MARKET,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,updateTime: 1706246012223},msg: }5.2 当前挂单 get_openOrders openOrderList_result accountTrade.get_openOrders(symbolMANAUSDT) eprint(openOrderList_result,length20)输出 {code: 200,data: [{orderId: 10518287024,symbol: MANAUSDT,status: NEW,clientOrderId: PQ5ysCRUEYDaejOrKph9ot,price: 1,avgPrice: 0,origQty: 12,executedQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: True,closePosition: False,side: SELL,positionSide: LONG,stopPrice: 0,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,...: ......},{orderId: 10518283927,symbol: MANAUSDT,status: NEW,clientOrderId: LfDRA0odbXwy559agURLiU,price: 0.4000,avgPrice: 0,origQty: 15,executedQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: False,closePosition: False,side: BUY,positionSide: LONG,stopPrice: 0,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,...: ......}],msg: }5.3 查询订单 get_order order_result accountTrade.get_order(symbolMANAUSDT,orderId10518287024, ) eprint(order_result)输出 {code: 200,data: {orderId: 10518287024,symbol: MANAUSDT,status: NEW,clientOrderId: PQ5ysCRUEYDaejOrKph9ot,price: 1.0000,avgPrice: 0.00,origQty: 12,executedQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: True,closePosition: False,side: SELL,positionSide: LONG,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,time: 1706245995585,updateTime: 1706245995585},msg: }5.4 修改订单 alter_order alter_order_result accountTrade.alter_order(symbolMANAUSDT,orderId 10518283927,price0.39,sideBUY,quantity 15, ) eprint(alter_order_result)输出 {code: 200,data: {orderId: 10518283927,symbol: MANAUSDT,status: NEW,clientOrderId: LfDRA0odbXwy559agURLiU,price: 0.3900,avgPrice: 0.00,origQty: 15,executedQty: 0,cumQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: False,closePosition: False,side: BUY,positionSide: LONG,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,updateTime: 1706246198094},msg: }5.5 批量下单 set_batchOrders set_batchOrders_result accountTrade.set_batchOrders(batchOrders [dict(symbolMANAUSDT, price0.4, quantity15, sideBUY, typeLIMIT, timeInForceGTC, positionSideLONG,),dict(symbolMANAUSDT, price0.41, quantity15, sideBUY, typeLIMIT, timeInForceGTC, positionSideLONG,),] ) eprint(set_batchOrders_result)输出 {code: 200,data: [{orderId: 10518295761,symbol: MANAUSDT,status: NEW,clientOrderId: MLoDryB4R80vjSw0h4BNZ3,price: 0.4000,...: ......},{orderId: 10518295760,symbol: MANAUSDT,status: NEW,clientOrderId: UG137zRT8db55ks4lbTPZt,price: 0.4100,...: ......}],msg: }5.6 撤销订单 cancel_order cancel_order_result accountTrade.cancel_order(symbolMANAUSDT,orderId10518283927 ) eprint(cancel_order_result)输出 {code: 200,data: {orderId: 10518283927,symbol: MANAUSDT,status: CANCELED,clientOrderId: LfDRA0odbXwy559agURLiU,price: 0.3900,avgPrice: 0.00,origQty: 15,executedQty: 0,cumQty: 0,cumQuote: 0.0000,timeInForce: GTC,type: LIMIT,reduceOnly: False,closePosition: False,side: BUY,positionSide: LONG,stopPrice: 0.0000,workingType: CONTRACT_PRICE,priceProtect: False,origType: LIMIT,priceMatch: NONE,selfTradePreventionMode: NONE,goodTillDate: 0,updateTime: 1706246225477},msg: }5.7 撤销单一交易对的所有挂单 cancel_allOpenOrders cancel_openOrders_result accountTrade.cancel_allOpenOrders(symbolMANAUSDT) eprint(cancel_openOrders_result)输出 {code: 200, msg: The operation of cancel all open order is done.}
http://www.zqtcl.cn/news/291225/

相关文章:

  • 网站添加文章机械代加工厂家
  • 学做各种糕点的网站cn网站建设多少钱
  • 首页网站关键词优化教程如何查询网站点击率
  • 文章类型的网站模版北京朝阳区房价2023年最新房价
  • wap网站发布注销主体和注销网站
  • 微信小程序 做网站满足客户的分销管理系统
  • 高佣联盟做成网站怎么做wordpress 更新版本
  • 杭州营销网站建设公司成都网站排名优化报价
  • 网站建设设计哪家好太原新建火车站
  • 医疗网站建设信息cps推广平台有哪些
  • rp怎么做网站备案 添加网站
  • 汕尾手机网站设计淘宝客做网站怎么做
  • 营口公司网站建设网站百度seo关键词优化
  • 网站开发命名规范汉中网站制作
  • 嘉定网站建设公司泗水做网站ys178
  • 邯郸网站设计招聘网齐家网和土巴兔装修哪家好
  • 京东网站推广方式jquery网页设计成品
  • 做本地网站卖四川省建设科技协会网站首页
  • 注册网站引流wordpress5.0.2图集怎么发布
  • 360产品展示网站哈尔滨个人建站模板
  • 怎么做网站的浏览量陕西省住房和建设厅官方网站
  • 上海网站 备案查询平面设计接单网站有哪些
  • 用别人的公司名字做网站想自己做网站推广
  • 百度智能建站平台建设工程信息网官网入口查询
  • 比价网站源码整站程序服务器怎么发布网站
  • html插件代码大全济南网站关键词优化公司
  • 优秀的手机网站设计网站推广的特点
  • 滨州北京网站建设电子商务网站规划与管理
  • 如何注册公司网站域名中国有几大网站
  • php网站留言板怎么做wordpress 相关文章推荐