TakeProfitDetails

class saxo_openapi.contrib.orders.onfill.TakeProfitDetails(price, ManualOrder=False, OrderDurationType='GoodTillCancel', GTDDate=None)

Representation of the specification for a TakeProfitOrder.

It is typically used to specify ‘take profit details’ for the ‘TakeProfitOnFill’ parameter of an OrderRequest. From the details a Limit order will be created with the specified price. The order gets placed when the underlying order gets filled.

The other way to create a TakeProfitOrder is to create it afterwards on an existing trade. In that case use TakeProfitOrderRequest on the trade.

ALLOWED_DT = ['GoodTillCancel', 'GoodTillDate', 'DayOrder']
__init__(price, ManualOrder=False, OrderDurationType='GoodTillCancel', GTDDate=None)

Instantiate TakeProfitDetails.

Parameters:
  • price (float or string (required)) – the price to trigger take profit order
  • OrderDurationType (OrderDurationType (required)) – the duration, default is: OrderDurationType.GoodTillCancel
  • ManualOrder (bool (required)) – flag to identify if an order is from an automated origin, default: False
  • GTDDate (string or datetime (optional)) – GTD-datetime is required if OrderDurationType.GoodTillDate
data

data - return the JSON body.

The data property returns a dict representing the JSON-body needed for the API-request. All values that are not set will be left out

toJSON()