MCPcopy Create free account
hub / github.com/ccxt/ccxt / example

Function example

examples/py/create-order-ws-example.py:17–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17async def example():
18 exchange = ccxt.binance({
19 'apiKey': 'MY_API_KEY',
20 'secret': 'MY_SECRET',
21 })
22 exchange.set_sandbox_mode(True)
23 exchange.verbose = True # uncomment for debugging purposes if necessary
24 # load markets
25 await exchange.load_markets()
26 symbol = 'ETH/USDT'
27 type = 'limit'
28 side = 'buy'
29 amount = 0.01
30 price = 1000
31 orders = []
32 for i in range(1, 5):
33 response = await exchange.create_order_ws(symbol, type, side, amount, price)
34 price += i
35 orders.append(response)
36 print(orders)
37
38 await exchange.close()
39
40
41asyncio.run(example())

Callers 1

Calls 6

rangeFunction · 0.50
set_sandbox_modeMethod · 0.45
load_marketsMethod · 0.45
create_order_wsMethod · 0.45
appendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…