()
| 2 | |
| 3 | |
| 4 | async function main() { |
| 5 | |
| 6 | const binance = new Binance({ |
| 7 | APIKEY: '', |
| 8 | APISECRET: '', |
| 9 | verbose: true |
| 10 | }); |
| 11 | |
| 12 | const symbol = 'LTCUSDT'; |
| 13 | const side = 'SELL'; |
| 14 | const quantity = 0.1; |
| 15 | |
| 16 | const params = { |
| 17 | // below order |
| 18 | belowType: 'STOP_LOSS_LIMIT', |
| 19 | belowPrice: 51, |
| 20 | belowStopPrice: 50, |
| 21 | belowTimeInForce: 'GTC', |
| 22 | |
| 23 | |
| 24 | // above order |
| 25 | aboveType: 'TAKE_PROFIT_LIMIT', |
| 26 | aboveStopPrice: 160, |
| 27 | abovePrice: 120, |
| 28 | aboveTimeInForce: 'GTC', |
| 29 | } |
| 30 | |
| 31 | const oco1 = await binance.ocoOrder(side, symbol, quantity, params); |
| 32 | console.log('oco1', oco1.orderListId); |
| 33 | console.log(oco1.orderReports[0].orderId) |
| 34 | console.log(oco1.orderReports[1].orderId) |
| 35 | |
| 36 | } |
| 37 | |
| 38 | main() |
| 39 |
no test coverage detected