MarketOrderStock

class saxo_openapi.contrib.orders.MarketOrderStock(Uic, Amount, ManualOrder=False, AmountType='Quantity', TakeProfitOnFill=None, StopLossOnFill=None, TrailingStopLossOnFill=None)

MarketOrderStock - MarketOrder for Stock only.

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

__init__(Uic, Amount, ManualOrder=False, AmountType='Quantity', TakeProfitOnFill=None, StopLossOnFill=None, TrailingStopLossOnFill=None)

Instantiate a MarketOrderStock.

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
  • 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

Example

>>> from saxo_openapi import API
>>> from saxo_openapi.contrib.orders import (
...          tie_account_to_order,
...          MarketOrderStock)
>>> token = "..."
>>> client = API(access_token=token)
>>> order = tie_account_to_order(
...               AccountKey,
...               MarketOrderStock(Uic=16350, Amount=1000))
>>> r = tr.orders.Order(data=req)
>>> 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()