MarketOrderFxSpot

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

MarketOrderFxSpot - MarketOrder for FxSpot only.

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

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

Instantiate a MarketOrderFxSpot.

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,
...          MarketOrderFxSpot)
>>> token = "..."
>>> client = API(access_token=token)
>>> order = tie_account_to_order(
...               AccountKey,
...               MarketOrderFxSpot(Uic=21, Amount=25000))
>>> r = tr.orders.Order(data=req)
>>> 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()