Table of Contents

Constructor TakeProfitLimitOrderRequest

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

TakeProfitLimitOrderRequest(string?, SymbolPair, OrderSide, decimal, decimal, decimal, TimeInForce)

Creates a new instance of the object.

public TakeProfitLimitOrderRequest(string? clientOrderId, SymbolPair symbolPair, OrderSide side, decimal thresholdPrice, decimal price, decimal size, TimeInForce timeInForce = TimeInForce.GoodTillCancel)

Parameters

clientOrderId string

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

symbolPair SymbolPair

Market on the exchange.

side OrderSide

Specification whether order should buy or sell the asset. Buy take-profit-limit order is specified using Buy value.

thresholdPrice decimal

When SymbolPair exchange market reaches the price, the take-profit-limit order becomes Limit order with price set to price.

price decimal

Price for the order once it becomes Limit order.

size decimal

Amount of symbolPair base symbol to buy or sell.

timeInForce TimeInForce

Specifies how long an order is supposed to be active.

Remarks

Suppose you bought 1 BTC @ $14,000 and suppose that Bitcoin is trading at 13,500 USD/BTC at the moment. Now suppose you request to place a new sell take-profit-limit order on an exchange with the following parameters:

  • thresholdPrice equal to 13,000 USD/BTC, and
  • price is lower than 14,000 USD/BTC.
In this case, it is possible that you may get an error from the exchange because the new order parameters fits StopLimit rather than TakeProfitLimit parameters. The behavior is unfortunately 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
  • price is not strictly positive number, or
  • thresholdPrice is not strictly positive number.