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

Method create_order

python/ccxt/bitvavo.py:1490–1559  ·  view source on GitHub ↗

create a trade order https://docs.bitvavo.com/docs/rest-api/create-order/ :param str symbol: unified symbol of the market to create an order in :param str type: 'market' or 'limit' :param str side: 'buy' or 'sell' :param float amount: how much of cu

(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})

Source from the content-addressed store, hash-verified

1488 return self.extend(request, params)
1489
1490 def create_order(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1491 """
1492 create a trade order
1493
1494 https://docs.bitvavo.com/docs/rest-api/create-order/
1495
1496 :param str symbol: unified symbol of the market to create an order in
1497 :param str type: 'market' or 'limit'
1498 :param str side: 'buy' or 'sell'
1499 :param float amount: how much of currency you want to trade in units of base currency
1500 :param float price: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1501 :param dict [params]: extra parameters specific to the bitvavo api endpoint
1502 :param str [params.timeInForce]: "GTC", "IOC", or "PO"
1503 :param float [params.stopPrice]: Alias for triggerPrice
1504 :param float [params.triggerPrice]: The price at which a trigger order is triggered at
1505 :param bool [params.postOnly]: If True, the order will only be posted to the order book and not executed immediately
1506 :param float [params.stopLossPrice]: The price at which a stop loss order is triggered at
1507 :param float [params.takeProfitPrice]: The price at which a take profit order is triggered at
1508 :param str [params.triggerType]: "price"
1509 :param str [params.triggerReference]: "lastTrade", "bestBid", "bestAsk", "midPrice" Only for stop orders: Use self to determine which parameter will trigger the order
1510 :param str [params.selfTradePrevention]: one of EXPIRE_BOTH, cancelOldest, cancelNewest or decrementAndCancel
1511 :param bool [params.disableMarketProtection]: don't cancel if the next fill price is 10% worse than the best fill price
1512 :param bool [params.responseRequired]: Set self to 'false' when only an acknowledgement of success or failure is required, self is faster.
1513 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
1514 """
1515 self.load_markets()
1516 market = self.market(symbol)
1517 request = self.create_order_request(symbol, type, side, amount, price, params)
1518 response = self.privatePostOrder(request)
1519 #
1520 # {
1521 # "orderId":"dec6a640-5b4c-45bc-8d22-3b41c6716630",
1522 # "market":"DOGE-EUR",
1523 # "created":1654789135146,
1524 # "updated":1654789135153,
1525 # "status":"new",
1526 # "side":"buy",
1527 # "orderType":"stopLossLimit",
1528 # "amount":"200",
1529 # "amountRemaining":"200",
1530 # "price":"0.07471",
1531 # "triggerPrice":"0.0747",
1532 # "triggerAmount":"0.0747",
1533 # "triggerType":"price",
1534 # "triggerReference":"lastTrade",
1535 # "onHold":"14.98",
1536 # "onHoldCurrency":"EUR",
1537 # "filledAmount":"0",
1538 # "filledAmountQuote":"0",
1539 # "feePaid":"0",
1540 # "feeCurrency":"EUR",
1541 # "fills":[ # filled with market orders only
1542 # {
1543 # "id":"b0c86aa5-6ed3-4a2d-ba3a-be9a964220f4",
1544 # "timestamp":1590505649245,
1545 # "amount":"0.249825",
1546 # "price":"183.49",
1547 # "taker":true,

Callers

nothing calls this directly

Calls 5

create_order_requestMethod · 0.95
parse_orderMethod · 0.95
privatePostOrderMethod · 0.65
load_marketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected