Skip to main content

Module models

Module models 

Source
Expand description

Provider-native OANDA v20 models.

Structs§

Account
The full details of a client’s Account. This includes full open Trade, open Position and pending Order representation.
AccountChanges
An AccountChanges Object is used to represent the changes to an Account’s Orders, Trades and Positions since a specified Account TransactionID in the past.
AccountChangesState
An AccountState Object is used to represent an Account’s current price-dependent state. Price-dependent Account state is dependent on OANDA’s current Prices, and includes things like unrealized PL, NAV and Trailing Stop Loss Order state. Fields will be omitted if their value has not changed since the specified transaction ID.
AccountID
Validated OANDA AccountID.
AccountProperties
Properties related to an Account.
AccountSummary
A summary representation of a client’s Account. The AccountSummary does not provide a full specification of pending Orders, open Trades and Positions.
AccumulatedAccountState
The mutable state of a client’s Account.
CalculatedAccountState
The dynamically calculated state of a client’s Account.
CalculatedPositionState
The dynamic (calculated) state of a Position
CalculatedTradeState
The dynamic (calculated) state of an open Trade
CandleSpecification
Validated OANDA CandleSpecification.
Candlestick
The Candlestick representation
CandlestickData
The price data (open, high, low, close) for the Candlestick representation.
CandlestickResponse
Response containing instrument, granularity, and list of candles.
ClientComment
Validated OANDA ClientComment.
ClientConfigureRejectTransaction
A ClientConfigureRejectTransaction represents the rejection of configuration of an Account by a client.
ClientConfigureTransaction
A ClientConfigureTransaction represents the configuration of an Account by a client.
ClientExtensions
A ClientExtensions object allows a client to attach a clientID, tag and comment to Orders and Trades in their Account. Do not set, modify, or delete this field if your account is associated with MT4.
ClientID
Validated OANDA ClientID.
ClientPrice
The specification of an Account-specific Price.
ClientRequestID
Validated OANDA ClientRequestID.
ClientTag
Validated OANDA ClientTag.
CloseTransaction
A CloseTransaction represents the closing of an Account.
ConversionFactor
A ConversionFactor contains information used to convert an amount, from an Instrument’s base or quote currency, to the home currency of an Account.
CreateTransaction
A CreateTransaction represents the creation of an Account.
Currency
Validated OANDA Currency.
DailyFinancingTransaction
A DailyFinancingTransaction represents the daily payment/collection of financing for an Account.
DateTime
UTC instant accepted from RFC3339 or OANDA’s fractional Unix-seconds form.
DelayedTradeClosureTransaction
A DelayedTradeClosure Transaction is created administratively to indicate open trades that should have been closed but weren’t because the open trades’ instruments were untradeable at the time. Open trades listed in this transaction will be closed once their respective instruments become tradeable.
DividendAdjustmentTransaction
A DividendAdjustment Transaction is created administratively to pay or collect dividend adjustment mounts to or from an Account.
DynamicOrderState
The dynamic state of an Order. This is only relevant to TrailingStopLoss Orders, as no other Order type has dynamic state.
FinancingDayOfWeek
A FinancingDayOfWeek message defines a day of the week when financing charges are debited or credited.
FixedPriceOrder
A FixedPriceOrder is an order that is filled immediately upon creation using a fixed price.
FixedPriceOrderTransaction
A FixedPriceOrderTransaction represents the creation of a Fixed Price Order in the user’s account. A Fixed Price Order is an Order that is filled immediately at a specified price.
GuaranteedStopLossDetails
GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed Stop Loss Order is modified directly through the Trade.
GuaranteedStopLossOrder
A GuaranteedStopLossOrder is an order that is linked to an open Trade and created with a price threshold which is guaranteed against slippage that may occur as the market crosses the price set for that order. The Order will be filled (closing the Trade) by the first price that is equal to or worse than the threshold. The price level specified for the GuaranteedStopLossOrder must be at least the configured minimum distance (in price units) away from the entry price for the traded instrument. A GuaranteedStopLossOrder cannot be used to open a new Position.
GuaranteedStopLossOrderEntryData
Details required by clients creating a Guaranteed Stop Loss Order
GuaranteedStopLossOrderLevelRestriction
A GuaranteedStopLossOrderLevelRestriction represents the total position size that can exist within a given price window for Trades with guaranteed Stop Loss Orders attached for a specific Instrument.
GuaranteedStopLossOrderParameters
The current mutability and hedging settings related to guaranteed Stop Loss orders.
GuaranteedStopLossOrderRejectTransaction
A GuaranteedStopLossOrderRejectTransaction represents the rejection of the creation of a GuaranteedStopLoss Order.
GuaranteedStopLossOrderRequest
A GuaranteedStopLossOrderRequest specifies the parameters that may be set when creating a Guaranteed Stop Loss Order. Only one of the price and distance fields may be specified.
GuaranteedStopLossOrderTransaction
A GuaranteedStopLossOrderTransaction represents the creation of a GuaranteedStopLoss Order in the user’s Account.
HomeConversionFactors
A HomeConversionFactors message contains information used to convert amounts, from an Instrument’s base or quote currency, to the home currency of an Account.
HomeConversions
HomeConversions represents the factors to use to convert quantities of a given currency into the Account’s home currency. The conversion factor depends on the scenario the conversion is required for.
Instrument
Full specification of an Instrument.
InstrumentCommission
An InstrumentCommission represents an instrument-specific commission
InstrumentFinancing
Financing data for the instrument.
InstrumentName
Validated OANDA InstrumentName.
InvalidId
Error returned when a provider identifier is empty or contains control characters.
LimitOrder
A LimitOrder is an order that is created with a price threshold, and will only be filled by a price that is equal to or better than the threshold.
LimitOrderRejectTransaction
A LimitOrderRejectTransaction represents the rejection of the creation of a Limit Order.
LimitOrderRequest
A LimitOrderRequest specifies the parameters that may be set when creating a Limit Order.
LimitOrderTransaction
A LimitOrderTransaction represents the creation of a Limit Order in the user’s Account.
LiquidityRegenerationSchedule
A LiquidityRegenerationSchedule indicates how liquidity that is used when filling an Order for an instrument is regenerated following the fill. A liquidity regeneration schedule will be in effect until the timestamp of its final step, but may be replaced by a schedule created for an Order of the same instrument that is filled while it is still in effect.
LiquidityRegenerationScheduleStep
A liquidity regeneration schedule Step indicates the amount of bid and ask liquidity that is used by the Account at a certain time. These amounts will only change at the timestamp of the following step.
MarginCallEnterTransaction
A MarginCallEnterTransaction is created when an Account enters the margin call state.
MarginCallExitTransaction
A MarginCallExitTransaction is created when an Account leaves the margin call state.
MarginCallExtendTransaction
A MarginCallExtendTransaction is created when the margin call state for an Account has been extended.
MarketIfTouchedOrder
A MarketIfTouchedOrder is an order that is created with a price threshold, and will only be filled by a market price that touches or crosses the threshold.
MarketIfTouchedOrderRejectTransaction
A MarketIfTouchedOrderRejectTransaction represents the rejection of the creation of a MarketIfTouched Order.
MarketIfTouchedOrderRequest
A MarketIfTouchedOrderRequest specifies the parameters that may be set when creating a Market-if-Touched Order.
MarketIfTouchedOrderTransaction
A MarketIfTouchedOrderTransaction represents the creation of a MarketIfTouched Order in the user’s Account.
MarketOrder
A MarketOrder is an order that is filled immediately upon creation using the current market price.
MarketOrderDelayedTradeClose
Details for the Market Order extensions specific to a Market Order placed with the intent of fully closing a specific open trade that should have already been closed but wasn’t due to halted market conditions
MarketOrderMarginCloseout
Details for the Market Order extensions specific to a Market Order placed that is part of a Market Order Margin Closeout in a client’s account
MarketOrderPositionCloseout
A MarketOrderPositionCloseout specifies the extensions to a Market Order when it has been created to closeout a specific Position.
MarketOrderRejectTransaction
A MarketOrderRejectTransaction represents the rejection of the creation of a Market Order.
MarketOrderRequest
A MarketOrderRequest specifies the parameters that may be set when creating a Market Order.
MarketOrderTradeClose
A MarketOrderTradeClose specifies the extensions to a Market Order that has been created specifically to close a Trade.
MarketOrderTransaction
A MarketOrderTransaction represents the creation of a Market Order in the user’s account. A Market Order is an Order that is filled immediately at the current market price. Market Orders can be specialized when they are created to accomplish a specific task: to close a Trade, to closeout a Position or to participate in a Margin closeout.
OpenTradeDividendAdjustment
Used to pay or collect a dividend adjustment amount for an open Trade within the Account.
OpenTradeFinancing
OpenTradeFinancing is used to pay/collect daily financing charge for an open Trade within an Account
OrderCancelRejectTransaction
An OrderCancelRejectTransaction represents the rejection of the cancellation of an Order in the client’s Account.
OrderCancelTransaction
An OrderCancelTransaction represents the cancellation of an Order in the client’s Account.
OrderClientExtensionsModifyRejectTransaction
A OrderClientExtensionsModifyRejectTransaction represents the rejection of the modification of an Order’s Client Extensions.
OrderClientExtensionsModifyTransaction
A OrderClientExtensionsModifyTransaction represents the modification of an Order’s Client Extensions.
OrderFillTransaction
An OrderFillTransaction represents the filling of an Order in the client’s Account.
OrderID
Validated OANDA OrderID.
OrderIdentifier
An OrderIdentifier is used to refer to an Order, and contains both the OrderID and the ClientOrderID.
OrderSpecifier
Validated OANDA OrderSpecifier.
Position
The specification of a Position within an Account.
PositionFinancing
OpenTradeFinancing is used to pay/collect daily financing charge for a Position within an Account
PositionSide
The representation of a Position for a single direction (long or short).
PriceBucket
A PriceBucket represents a price available for an amount of liquidity
PricingComponent
Validated OANDA PricingComponent.
PricingHeartbeat
A PricingHeartbeat object is injected into the Pricing stream to ensure that the HTTP connection remains active.
QuoteHomeConversionFactors
QuoteHomeConversionFactors represents the factors that can be used to convert quantities of a Price’s Instrument’s quote currency into the Account’s home currency.
ReopenTransaction
A ReopenTransaction represents the re-opening of a closed Account.
RequestID
Validated OANDA RequestID.
ResetResettablePLTransaction
A ResetResettablePLTransaction represents the resetting of the Account’s resettable PL counters.
StopLossDetails
StopLossDetails specifies the details of a Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through the Trade.
StopLossOrder
A StopLossOrder is an order that is linked to an open Trade and created with a price threshold. The Order will be filled (closing the Trade) by the first price that is equal to or worse than the threshold. A StopLossOrder cannot be used to open a new Position.
StopLossOrderRejectTransaction
A StopLossOrderRejectTransaction represents the rejection of the creation of a StopLoss Order.
StopLossOrderRequest
A StopLossOrderRequest specifies the parameters that may be set when creating a Stop Loss Order. Only one of the price and distance fields may be specified.
StopLossOrderTransaction
A StopLossOrderTransaction represents the creation of a StopLoss Order in the user’s Account.
StopOrder
A StopOrder is an order that is created with a price threshold, and will only be filled by a price that is equal to or worse than the threshold.
StopOrderRejectTransaction
A StopOrderRejectTransaction represents the rejection of the creation of a Stop Order.
StopOrderRequest
A StopOrderRequest specifies the parameters that may be set when creating a Stop Order.
StopOrderTransaction
A StopOrderTransaction represents the creation of a Stop Order in the user’s Account.
Tag
A tag associated with an entity.
TakeProfitDetails
TakeProfitDetails specifies the details of a Take Profit Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly through the Trade.
TakeProfitOrder
A TakeProfitOrder is an order that is linked to an open Trade and created with a price threshold. The Order will be filled (closing the Trade) by the first price that is equal to or better than the threshold. A TakeProfitOrder cannot be used to open a new Position.
TakeProfitOrderRejectTransaction
A TakeProfitOrderRejectTransaction represents the rejection of the creation of a TakeProfit Order.
TakeProfitOrderRequest
A TakeProfitOrderRequest specifies the parameters that may be set when creating a Take Profit Order.
TakeProfitOrderTransaction
A TakeProfitOrderTransaction represents the creation of a TakeProfit Order in the user’s Account.
Trade
The specification of a Trade within an Account. This includes the full representation of the Trade’s dependent Orders in addition to the IDs of those Orders.
TradeClientExtensionsModifyRejectTransaction
A TradeClientExtensionsModifyRejectTransaction represents the rejection of the modification of a Trade’s Client Extensions.
TradeClientExtensionsModifyTransaction
A TradeClientExtensionsModifyTransaction represents the modification of a Trade’s Client Extensions.
TradeID
Validated OANDA TradeID.
TradeOpen
A TradeOpen object represents a Trade for an instrument that was opened in an Account. It is found embedded in Transactions that affect the position of an instrument in the Account, specifically the OrderFill Transaction.
TradeReduce
A TradeReduce object represents a Trade for an instrument that was reduced (either partially or fully) in an Account. It is found embedded in Transactions that affect the position of an instrument in the account, specifically the OrderFill Transaction.
TradeSpecifier
Validated OANDA TradeSpecifier.
TradeSummary
The summary of a Trade within an Account. This representation does not provide the full details of the Trade’s dependent Orders.
TrailingStopLossDetails
TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop Loss Order is modified directly through the Trade.
TrailingStopLossOrder
A TrailingStopLossOrder is an order that is linked to an open Trade and created with a price distance. The price distance is used to calculate a trailing stop value for the order that is in the losing direction from the market price at the time of the order’s creation. The trailing stop value will follow the market price as it moves in the winning direction, and the order will be filled (closing the Trade) by the first price that is equal to or worse than the trailing stop value. A TrailingStopLossOrder cannot be used to open a new Position.
TrailingStopLossOrderRejectTransaction
A TrailingStopLossOrderRejectTransaction represents the rejection of the creation of a TrailingStopLoss Order.
TrailingStopLossOrderRequest
A TrailingStopLossOrderRequest specifies the parameters that may be set when creating a Trailing Stop Loss Order.
TrailingStopLossOrderTransaction
A TrailingStopLossOrderTransaction represents the creation of a TrailingStopLoss Order in the user’s Account.
TransactionHeartbeat
A TransactionHeartbeat object is injected into the Transaction stream to ensure that the HTTP connection remains active.
TransactionID
Validated OANDA TransactionID.
TransferFundsRejectTransaction
A TransferFundsRejectTransaction represents the rejection of the transfer of funds in/out of an Account.
TransferFundsTransaction
A TransferFundsTransaction represents the transfer of funds in/out of an Account.
UnitsAvailable
Representation of how many units of an Instrument are available to be traded by an Order depending on its positionFill option.
UnitsAvailableDetails
Representation of many units of an Instrument are available to be traded for both long and short Orders.
UserAttributes
Contains the attributes of a user.

Enums§

AcceptDatetimeFormat
DateTime header
AccountFinancingMode
The financing mode of an Account
CancellableOrderType
The type of the Order.
CandlestickGranularity
The granularity of a candlestick
DayOfWeek
The DayOfWeek provides a representation of the day of the week.
Direction
In the context of an Order or a Trade, defines whether the units are positive or negative.
FixedPriceOrderReason
The reason that the Fixed Price Order was created
FundingReason
The reason that an Account is being funded.
GuaranteedStopLossOrderMode
The overall behaviour of the Account regarding guaranteed Stop Loss Orders.
GuaranteedStopLossOrderModeForInstrument
The overall behaviour of the Account regarding Guaranteed Stop Loss Orders for a specific Instrument.
GuaranteedStopLossOrderMutability
For Accounts that support guaranteed Stop Loss Orders, describes the actions that can be performed on guaranteed Stop Loss Orders.
GuaranteedStopLossOrderReason
The reason that the Guaranteed Stop Loss Order was initiated
InstrumentType
The type of an Instrument.
LimitOrderReason
The reason that the Limit Order was initiated
MarketIfTouchedOrderReason
The reason that the Market-if-touched Order was initiated
MarketOrderMarginCloseoutReason
The reason that the Market Order was created to perform a margin closeout
MarketOrderReason
The reason that the Market Order was created
Order
Documented Order variants identified by OANDA’s type field.
OrderCancelReason
The reason that an Order was cancelled.
OrderFillReason
The reason that an Order was filled
OrderPositionFill
Specification of how Positions in the Account are modified when the Order is filled.
OrderRequest
Documented OrderRequest variants identified by OANDA’s type field.
OrderState
The current state of the Order.
OrderStateFilter
The state to filter the requested Orders by.
OrderTriggerCondition
Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA’s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order’s trigger condition is set to the default value when indicating the distance from an Order’s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a Guaranteed Stop Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for short trades “DEFAULT” and “ASK” are valid.
OrderType
The type of the Order.
PositionAggregationMode
The way that position values for an Account are calculated and aggregated.
PriceStatus
The status of the Price.
StopLossOrderReason
The reason that the Stop Loss Order was initiated
StopOrderReason
The reason that the Stop Order was initiated
TakeProfitOrderReason
The reason that the Take Profit Order was initiated
TimeInForce
The time-in-force of an Order. TimeInForce describes how long an Order should remain pending before being automatically cancelled by the execution system.
TradePL
The classification of TradePLs.
TradeState
The current state of the Trade.
TradeStateFilter
The state to filter the Trades by
TrailingStopLossOrderReason
The reason that the Trailing Stop Loss Order was initiated
Transaction
Documented Transaction variants identified by OANDA’s type field.
TransactionFilter
A filter that can be used when fetching Transactions
TransactionRejectReason
The reason that a Transaction was rejected.
TransactionType
The possible types of a Transaction
WeeklyAlignment
The day of the week to use for candlestick granularities with weekly alignment.

Type Aliases§

AccountUnits
Exact account-currency units.
DecimalNumber
Exact OANDA decimal number.
PriceValue
Exact provider price.