MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / main

Function main

examples/oco-order.ts:4–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4async 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
38main()
39

Callers 1

oco-order.tsFile · 0.70

Calls 2

ocoOrderMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected