StopLossDetails

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

Representation of the specification for a StopLossOrder.

It is typically used to specify ‘stop loss details’ for the ‘StopLossOnFill’ parameter of an OrderRequest. From the details a Stop order will be created with the specified price. The order gets placed when the underlying order gets filled.

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

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

Instantiate StopLossDetails.

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 datetim (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()