tn_edit_order: Edit an order (testnet)

View source: R/edit_order.R

tn_edit_orderR Documentation

Edit an order (testnet)

Description

Edit an order that has been placed with the testnet API.

Usage

tn_edit_order(
  orderID = NULL,
  origClOrdID = NULL,
  clOrdID = NULL,
  orderQty = NULL,
  leavesQty = NULL,
  price = NULL,
  stopPx = NULL,
  pegOffsetValue = NULL,
  text = NULL
)

Arguments

orderID

string. Order ID.

origClOrdID

string. The original client order ID

clOrdID

string. Optional new client order ID.

orderQty

double. Order quantity in units of the instrument (i.e. contracts).

leavesQty

string. Optional leaves quantity in units of the instrument (i.e. contracts). Useful for amending partially filled orders.

price

double. Optional limit price for 'Limit', 'StopLimit', and 'LimitIfTouched' orders.

stopPx

double. Optional trigger price for 'Stop', 'StopLimit', 'MarketIfTouched', and 'LimitIfTouched' orders. Use a price below the current price for stop-sell orders and buy-if-touched orders. Use execInst of 'MarkPrice' or 'LastPrice' to define the current price used for triggering.

pegOffsetValue

string. Optional trailing offset from the current price for 'Stop', 'StopLimit', ' MarketIfTouched', and 'LimitIfTouched' orders; use a negative offset for stop-sell orders and buy-if-touched orders. Optional offset from the peg price for 'Pegged' orders.

text

string. Optional amend annotation. e.g. 'Adjust skew'.

Value

A data.frame with information about the amended order. See https://www.bitmex.com/api/explorer/#!/Order/Order_amend for more information.

Examples

## Not run: 

# place an order

tn_place_order(symbol = "XBTUSD", price = 5000, orderQty = 100, clOrdID = "myorderid")

# edit the order

tn_edit_order(origClOrID = "myorderid", orderQty = 200)

## End(Not run)


bitmexr documentation built on Aug. 8, 2023, 1:09 a.m.