|
vor 1 Woche | |
---|---|---|
.. | ||
README.md | vor 1 Woche | |
openPosition_usage.md | vor 1 Woche | |
positionSide_explanation.md | vor 1 Woche | |
timeInForce_explanation.md | vor 1 Woche |
openPosition_usage.md
- 开仓功能详细使用说明
positionSide_explanation.md
- 仓位方向详解
timeInForce_explanation.md
- 订单时效类型
src/exchanges/binance/
BinanceAdapter.ts
- 统一适配器接口实现FutureConnector.ts
- 期货交易连接器BINANCE_API_KEY=your_api_key
BINANCE_SECRET_KEY=your_secret_key
BINANCE_TESTNET=false # 是否使用测试网
import { BinanceAdapter } from '../src/exchanges/binance/BinanceAdapter'
const adapter = new BinanceAdapter({
apiKey: process.env.BINANCE_API_KEY,
apiSecret: process.env.BINANCE_SECRET_KEY,
})
// 下市价单
const marketOrder = await adapter.placeOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'MARKET',
quantity: '0.001',
})
// 下限价单
const limitOrder = await adapter.placeOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'LIMIT',
quantity: '0.001',
price: '50000',
timeInForce: 'GTC',
})
// 查看当前仓位
const positions = await adapter.positions()
// 设置杠杆
await adapter.setLeverage('BTCUSDT', 10)
// 查询余额
const balances = await adapter.balances()
📚 更多资源: