Constructor StopLimitOrderRequest
- Namespace
- WhalesSecret.TradeScriptLib.Entities.Orders
- Assembly
- WhalesSecret.TradeScriptLib.dll
StopLimitOrderRequest(string?, SymbolPair, OrderSide, decimal, decimal, decimal, TimeInForce)
Creates a new instance of the object.
public StopLimitOrderRequest(string? clientOrderId, SymbolPair symbolPair, OrderSide side, decimal thresholdPrice, decimal price, decimal size, TimeInForce timeInForce = TimeInForce.GoodTillCancel)
Parameters
clientOrderId
stringUnique client order ID, or
null
to let the system generate the ID.symbolPair
SymbolPairMarket on the exchange.
side
OrderSideSpecification whether order should buy or sell the asset. Buy stop-limit order is specified using Buy value.
thresholdPrice
decimalWhen SymbolPair exchange market reaches the price, the stop-limit order becomes Limit order with price set to
price
.price
decimalPrice for the order once it becomes Limit order.
size
decimalAmount of
symbolPair
base symbol to buy or sell.timeInForce
TimeInForceSpecifies how long an order is supposed to be active.
Remarks
Suppose you bought 1 BTC @ $14,000 and suppose that Bitcoin is trading at 15,500 USD/BTC at the moment. Now suppose you request to place a new sell stop-limit order on an exchange with the following parameters:
thresholdPrice
equal to 15,000 USD/BTC, andprice
is larger than 14,000 USD/BTC.
You need to consult an exchange API documentation or contact their support to make sure you understand order processing correctly.
Exceptions
- InvalidArgumentException
Thrown if:
size
is not strictly positive number, orprice
is not strictly positive number, orthresholdPrice
is not strictly positive number.