LimitOrderStock

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

LimitOrderStock - LimitOrder for Stock only.

The LimitOrderStock lacks the AssetType parameter and only serves the AssetType Stock.

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

Instantiate a LimitOrderStock.

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
  • AmountType (AmountType (optional)) – the amountType, defaults to Quantity, see AmountType for other options
  • ManualOrder (bool (required)) – flag to identify if an order is from an automated origin, default: False
  • 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,
...          LimitOrderStock)
>>> token = "..."
>>> client = API(access_token=token)
>>> order = tie_account_to_order(
...     AccountKey,
...     LimitOrderStock(Uic=16350, Amount=1000, OrderPrice=28.00))
>>> r = tr.orders.Order(data=order)
>>> rv = client.request(r)
>>> print(json.dumps(rv, indent=2))
{
  "OrderId": "76703539"
}
data

data property.

return the JSON body.

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