Place an order using the Bitmex API. Requires API key.
place_order( symbol = NULL, side = NULL, orderQty = NULL, price = NULL, displayQty = NULL, stopPx = NULL, clOrdID = NULL, pegOffsetValue = NULL, pegPriceType = NULL, ordType = NULL, timeInForce = NULL, execInst = NULL, text = NULL )
symbol | string. Instrument symbol. e.g. 'XBTUSD'. |
---|---|
side | string. Order side. Valid options: Buy, Sell. Defaults to 'Buy' unless |
orderQty | double. Order quantity in units of the instrument (i.e. contracts). |
price | double. Optional limit price for 'Limit', 'StopLimit', and 'LimitIfTouched' orders. |
displayQty | double. Optional quantity to display in the book. Use 0 for a fully hidden order. |
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 |
clOrdID | string. Optional Client Order ID. This clOrdID will come back on the order and any related executions. |
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. |
pegPriceType | string. Optional peg price type. Valid options: LastPeg, MidPricePeg, MarketPeg, PrimaryPeg, TrailingStopPeg. |
ordType | string. Order type. Valid options: Market, Limit, Stop, StopLimit, MarketIfTouched, LimitIfTouched, Pegged.
Defaults to 'Limit' when |
timeInForce | string. Time in force. Valid options: Day, GoodTillCancel, ImmediateOrCancel, FillOrKill. Defaults to 'GoodTillCancel' for 'Limit', 'StopLimit', and 'LimitIfTouched' orders. |
execInst | string. Optional execution instructions. Valid options: ParticipateDoNotInitiate,
AllOrNone, MarkPrice, IndexPrice, LastPrice, Close, ReduceOnly, Fixed.
'AllOrNone' instruction requires |
text | string. Optional order annotation. e.g. 'Take profit'. |
A tibble containing information about the trade that has been placed. See https://www.bitmex.com/api/explorer/#!/Order/Order_new for more details.
if (FALSE) { # place limit order to Buy 10 contracts at a specific price place_order(symbol = "XBTUSD", price = 6000, orderQty = 10) }