diff --git a/async_v20/definitions/types.py b/async_v20/definitions/types.py index 1135d80..4c95a6e 100644 --- a/async_v20/definitions/types.py +++ b/async_v20/definitions/types.py @@ -305,11 +305,11 @@ class OrderIdentifier(Model): client_order_id: :class:`~async_v20.OrderID` The client-provided client Order ID """ - def __init__(self, order_id: OrderID = sentinel, client_order_id: OrderID = sentinel): + def __init__(self, order_id: OrderID = sentinel, client_order_id: ClientID = sentinel): Model.__init__(**locals()) class QuoteHomeConversionFactors(Model): """QuoteHomeConversionFactors represents the factors that can be used used to @@ -1005,18 +1005,20 @@ class TradeReduce(Model): The number of units that the Trade was reduced by realized_pl: :class:`~async_v20.AccountUnits` The PL realized when reducing the Trade financing: :class:`~async_v20.AccountUnits` The financing paid/collected when reducing the Trade - + client_trade_id: :class:`~async_v20.ClientID` + The ID specified by the client (undocumented by Oanda) """ def __init__(self, trade_id: TradeID = sentinel, units: DecimalNumber = sentinel, realized_pl: AccountUnits = sentinel, financing: AccountUnits = sentinel, price: DecimalNumber = sentinel, guaranteed_execution_fee: AccountUnits = sentinel, - half_spread_cost: AccountUnits = sentinel): + half_spread_cost: AccountUnits = sentinel, + client_trade_id: ClientID = sentinel): Model.__init__(**locals()) class ArrayTradeReduce(Array, contains=TradeReduce): pass @@ -1153,11 +1155,11 @@ class Transaction(Model): account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, type: TransactionType = sentinel, extension_number: int = sentinel, division_id: int = sentinel, site_id: int = sentinel, account_user_id: int = sentinel, account_number: int = sentinel, home_currency: Currency = sentinel, alias: str = sentinel, margin_rate: DecimalNumber = sentinel, reason: Reason = sentinel, trade_ids: TradeID = sentinel, order_id: OrderID = sentinel, - client_order_id: OrderID = sentinel, replaced_by_order_id: OrderID = sentinel, + client_order_id: ClientID = sentinel, replaced_by_order_id: OrderID = sentinel, closed_trade_id: OrderID = sentinel, trade_close_transaction_id: TransactionID = sentinel, client_extensions_modify: ClientExtensions = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel, financing: AccountUnits = sentinel, account_balance: AccountUnits = sentinel, account_financing_mode: AccountFinancingMode = sentinel, position_financings: ArrayPositionFinancing = sentinel, trade_id: TradeID = sentinel, @@ -1831,11 +1833,11 @@ class OrderCancelTransaction(Transaction, type=TransactionType('ORDER_CANCEL')): Transactions in the same batch are applied to the Account simultaneously. request_id: :class:`~async_v20.RequestID` The Request ID of the request which generated the transaction. order_id: :class:`~async_v20.TransactionID` The ID of the Order cancelled - client_order_id: :class:`~async_v20.OrderID` + client_order_id: :class:`~async_v20.ClientID` The reason that the Order was cancelled. reason: :class:`~async_v20.OrderCancelReason` The reason that the Order was cancelled. replaced_by_order_id: :class:`~async_v20.TransactionID` The ID of the Order that replaced this Order @@ -1843,11 +1845,11 @@ class OrderCancelTransaction(Transaction, type=TransactionType('ORDER_CANCEL')): """ def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, - order_id: OrderID = sentinel, client_order_id: OrderID = sentinel, + order_id: OrderID = sentinel, client_order_id: ClientID = sentinel, reason: OrderCancelReason = sentinel, replaced_by_order_id: OrderID = sentinel, closed_trade_id: OrderID = sentinel, trade_close_transaction_id: TransactionID = sentinel): Model.__init__(**locals()) @@ -1881,11 +1883,11 @@ class OrderClientExtensionsModifyTransaction(Transaction, type=TransactionType(' """ def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, order_id: OrderID = sentinel, - client_order_id: OrderID = sentinel, client_extensions_modify: ClientExtensions = sentinel, + client_order_id: ClientID = sentinel, client_extensions_modify: ClientExtensions = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel): Model.__init__(**locals()) class DailyFinancingTransaction(Transaction, type=TransactionType('DAILY_FINANCING')): @@ -2567,11 +2569,11 @@ class OrderCancelRejectTransaction(Transaction, type=TransactionType('ORDER_CANC """ def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, order_id: OrderID = sentinel, - client_order_id: OrderID = sentinel, reason: OrderCancelReason = sentinel, + client_order_id: ClientID = sentinel, reason: OrderCancelReason = sentinel, reject_reason: TransactionRejectReason = sentinel): Model.__init__(**locals()) class OrderClientExtensionsModifyRejectTransaction(Transaction, @@ -2607,11 +2609,11 @@ class OrderClientExtensionsModifyRejectTransaction(Transaction, """ def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, order_id: OrderID = sentinel, - client_order_id: OrderID = sentinel, client_extensions_modify: ClientExtensions = sentinel, + client_order_id: ClientID = sentinel, client_extensions_modify: ClientExtensions = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel, reject_reason: TransactionRejectReason = sentinel): Model.__init__(**locals()) @@ -3252,21 +3254,26 @@ class StopLossOrderTransaction(Transaction, type=TransactionType('STOP_LOSS_ORDE The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order). cancelling_transaction_id: :class:`~async_v20.TransactionID` The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order). - + guaranteed: :class:`bool` + Flag indicating that the Stop Loss Order is guaranteed. The default value + depends on the GuaranteedStopLossOrderMode of the account, if it is + REQUIRED, the default will be true, for DISABLED or ENABLED the default + is false. """ def __init__(self, trade_id: TradeID, price: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel, trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: StopLossOrderReason = sentinel, client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel, - replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel): + replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel, + guaranteed: bool = sentinel): Model.__init__(**locals()) class TrailingStopLossOrderTransaction(Transaction, type=TransactionType('TRAILING_STOP_LOSS_ORDER')): """A TrailingStopLossOrderTransaction represents the creation of a @@ -3656,11 +3663,11 @@ class OrderFillTransaction(Transaction, type=TransactionType('ORDER_FILL')): Transactions in the same batch are applied to the Account simultaneously. request_id: :class:`~async_v20.RequestID` The Request ID of the request which generated the transaction. order_id: :class:`~async_v20.OrderID` The ID of the Order filled. - client_order_id: :class:`~async_v20.OrderID` + client_order_id: :class:`~async_v20.ClientID` The client Order ID of the Order filled (only provided if the client has assigned one). instrument: :class:`~async_v20.InstrumentName` The name of the filled Order's instrument. units: :class:`~async_v20.DecimalNumber` @@ -3710,11 +3717,11 @@ class OrderFillTransaction(Transaction, type=TransactionType('ORDER_FILL')): """ def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel, - order_id: OrderID = sentinel, client_order_id: OrderID = sentinel, + order_id: OrderID = sentinel, client_order_id: ClientID = sentinel, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel, price: PriceValue = sentinel, full_price: ClientPrice = sentinel, reason: OrderFillReason = sentinel, pl: AccountUnits = sentinel, financing: AccountUnits = sentinel, commission: AccountUnits = sentinel, account_balance: AccountUnits = sentinel, trade_opened: TradeOpen = sentinel, trades_closed: ArrayTradeReduce = sentinel, @@ -3931,10 +3938,11 @@ class LimitOrderTransaction(Transaction, type=TransactionType('LIMIT_ORDER')): The ID of the Order that this Order replaces (only provided if this Order replaces an existing Order). cancelling_transaction_id: :class:`~async_v20.TransactionID` The ID of the Transaction that cancels the replaced Order (only provided if this Order replaces an existing Order). + partial_fill: = positionFill (seems to be a mismatch in Oanda documentation) """ def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: TransactionID = sentinel, @@ -3944,11 +3952,11 @@ class LimitOrderTransaction(Transaction, type=TransactionType('LIMIT_ORDER')): position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: LimitOrderReason = sentinel, client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel, trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel, trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel, - cancelling_transaction_id: TransactionID = sentinel): + cancelling_transaction_id: TransactionID = sentinel, partial_fill: OrderPositionFill = sentinel): Model.__init__(**locals()) class TakeProfitOrderRejectTransaction(Transaction, type=TransactionType('TAKE_PROFIT_ORDER_REJECT')): """A TakeProfitOrderRejectTransaction represents the rejection of the creation