Table of Contents

Constructor StopLossOrderRequest

Namespace
WhalesSecret.TradeScriptLib.Entities.Orders
Assembly
WhalesSecret.TradeScriptLib.dll

StopLossOrderRequest(string?, SymbolPair, OrderSide, decimal, decimal, bool)

Creates a new instance of the object.

public StopLossOrderRequest(string? clientOrderId, SymbolPair symbolPair, OrderSide side, decimal thresholdPrice, decimal size, bool sizeInBaseSymbol = true)

Parameters

clientOrderId string

Unique client order ID, or null to let the system generate the ID.

symbolPair SymbolPair

Market on the exchange.

side OrderSide

Whether to buy or sell the base symbol.

thresholdPrice decimal

When SymbolPair exchange market reaches the price, the stop-loss order becomes Market order.

size decimal

Amount to buy or sell. Size is by default specified in terms of the base symbol unless specified otherwise using sizeInBaseSymbol.

sizeInBaseSymbol bool

true if the size is specified in terms of the base symbol, false if the order size is specified in terms of the quote symbol.

Remarks

Suppose you place a sell stop-loss order on an exchange with thresholdPrice equal to 15,100 USD/BTC and suppose that the latest price of Bitcoin is 15,000 USD per BTC. In this case, it is possible that you may receive an error from the exchange or the order may be executed (effectively being TakeProfit instead of StopLoss) without throwing an error as order matching engine behavior, in cases like this one, is exchange-specific.

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, or
  • thresholdPrice is not strictly positive number.