StopOrderFxSpot

class saxo_openapi.contrib.orders.stoporder.StopOrderFxSpot(Uic, Amount, OrderPrice, ManualOrder=False, AmountType='Quantity', TakeProfitOnFill=None, StopLossOnFill=None, TrailingStopLossOnFill=None, OrderDurationType='DayOrder', GTDDate=None)

StopOrderFxSpot - StopOrder for FxSpot only.

The StopOrderFxSpot lacks the AssetType parameter and only serves the AssetType FxSpot.

ALLOWED_DT = ['DayOrder', 'GoodTillDate', 'GoodTillCancel']
__init__(Uic, Amount, OrderPrice, ManualOrder=False, AmountType='Quantity', TakeProfitOnFill=None, StopLossOnFill=None, TrailingStopLossOnFill=None, OrderDurationType='DayOrder', GTDDate=None)

Instantiate a StopOrderFxSpot.

Parameters:
  • Uic (int (required)) – the Uic of the instrument to trade
  • Amount (decimal (required)) – the number of lots/shares/contracts or a monetary value if amountType is set to CashAmount
  • OrderPrice (decimal (required)) – the price indicating the limitprice
  • ManualOrder (bool (required)) – flag to identify if an order is from an automated origin, default: False
  • AmountType (AmountType (optional)) – the amountType, defaults to Quantity, see AmountType for other options
  • TakeProfitOnFill (TakeProfitDetails instance or dict) – the take-profit order specification
  • StopLosstOnFill (StopLossDetails instance or dict) – the stoploss order specification
  • TrailingStopLosstOnFill (TrailingStopLossDetails instance or dict) – the Trailingstoploss order specification
  • OrderDurationType (string, default DayOrder) – the order duration type, check SAXO Bank specs. for details
  • GTDDate (datetime string (required if order duration is GoodTillDate)) – the GTD-datetime

Example

>>> from saxo_openapi import API
>>> from saxo_openapi.contrib.orders import (
...          tie_account_to_order,
...          StopOrderFxSpot)
>>> token = "..."
>>> client = API(access_token=token)
>>> order = tie_account_to_order(
...     AccountKey,
...     StopOrderFxSpot(Uic=21, Amount=25000, OrderPrice=1.1025))
>>> r = tr.orders.Order(data=order)
>>> rv = client.request(r)
>>> print(json.dumps(rv, indent=2))
{
  "OrderId": "76703544"
}
data

data property.

return the JSON body.

hndOnFill(TakeProfitOnFill=None, StopLossOnFill=None, TrailingStopLossOnFill=None)
toJSON()