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.
- Account
Changes - 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.
- Account
Changes State - 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.
- Account
Properties - Properties related to an Account.
- Account
Summary - A summary representation of a client’s Account. The AccountSummary does not provide a full specification of pending Orders, open Trades and Positions.
- Accumulated
Account State - The mutable state of a client’s Account.
- Calculated
Account State - The dynamically calculated state of a client’s Account.
- Calculated
Position State - The dynamic (calculated) state of a Position
- Calculated
Trade State - The dynamic (calculated) state of an open Trade
- Candle
Specification - Validated OANDA CandleSpecification.
- Candlestick
- The Candlestick representation
- Candlestick
Data - The price data (open, high, low, close) for the Candlestick representation.
- Candlestick
Response - Response containing instrument, granularity, and list of candles.
- Client
Comment - Validated OANDA ClientComment.
- Client
Configure Reject Transaction - A ClientConfigureRejectTransaction represents the rejection of configuration of an Account by a client.
- Client
Configure Transaction - A ClientConfigureTransaction represents the configuration of an Account by a client.
- Client
Extensions - 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.
- Client
Price - The specification of an Account-specific Price.
- Client
RequestID - Validated OANDA ClientRequestID.
- Client
Tag - Validated OANDA ClientTag.
- Close
Transaction - A CloseTransaction represents the closing of an Account.
- Conversion
Factor - A ConversionFactor contains information used to convert an amount, from an Instrument’s base or quote currency, to the home currency of an Account.
- Create
Transaction - A CreateTransaction represents the creation of an Account.
- Currency
- Validated OANDA Currency.
- Daily
Financing Transaction - A DailyFinancingTransaction represents the daily payment/collection of financing for an Account.
- Date
Time - UTC instant accepted from RFC3339 or OANDA’s fractional Unix-seconds form.
- Delayed
Trade Closure Transaction - 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.
- Dividend
Adjustment Transaction - A DividendAdjustment Transaction is created administratively to pay or collect dividend adjustment mounts to or from an Account.
- Dynamic
Order State - The dynamic state of an Order. This is only relevant to TrailingStopLoss Orders, as no other Order type has dynamic state.
- Financing
DayOf Week - A FinancingDayOfWeek message defines a day of the week when financing charges are debited or credited.
- Fixed
Price Order - A FixedPriceOrder is an order that is filled immediately upon creation using a fixed price.
- Fixed
Price Order Transaction - 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.
- Guaranteed
Stop Loss Details - 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.
- Guaranteed
Stop Loss Order - 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.
- Guaranteed
Stop Loss Order Entry Data - Details required by clients creating a Guaranteed Stop Loss Order
- Guaranteed
Stop Loss Order Level Restriction - 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.
- Guaranteed
Stop Loss Order Parameters - The current mutability and hedging settings related to guaranteed Stop Loss orders.
- Guaranteed
Stop Loss Order Reject Transaction - A GuaranteedStopLossOrderRejectTransaction represents the rejection of the creation of a GuaranteedStopLoss Order.
- Guaranteed
Stop Loss Order Request - 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.
- Guaranteed
Stop Loss Order Transaction - A GuaranteedStopLossOrderTransaction represents the creation of a GuaranteedStopLoss Order in the user’s Account.
- Home
Conversion Factors - A HomeConversionFactors message contains information used to convert amounts, from an Instrument’s base or quote currency, to the home currency of an Account.
- Home
Conversions - 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.
- Instrument
Commission - An InstrumentCommission represents an instrument-specific commission
- Instrument
Financing - Financing data for the instrument.
- Instrument
Name - Validated OANDA InstrumentName.
- Invalid
Id - Error returned when a provider identifier is empty or contains control characters.
- Limit
Order - 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.
- Limit
Order Reject Transaction - A LimitOrderRejectTransaction represents the rejection of the creation of a Limit Order.
- Limit
Order Request - A LimitOrderRequest specifies the parameters that may be set when creating a Limit Order.
- Limit
Order Transaction - A LimitOrderTransaction represents the creation of a Limit Order in the user’s Account.
- Liquidity
Regeneration Schedule - 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.
- Liquidity
Regeneration Schedule Step - 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.
- Margin
Call Enter Transaction - A MarginCallEnterTransaction is created when an Account enters the margin call state.
- Margin
Call Exit Transaction - A MarginCallExitTransaction is created when an Account leaves the margin call state.
- Margin
Call Extend Transaction - A MarginCallExtendTransaction is created when the margin call state for an Account has been extended.
- Market
IfTouched Order - 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.
- Market
IfTouched Order Reject Transaction - A MarketIfTouchedOrderRejectTransaction represents the rejection of the creation of a MarketIfTouched Order.
- Market
IfTouched Order Request - A MarketIfTouchedOrderRequest specifies the parameters that may be set when creating a Market-if-Touched Order.
- Market
IfTouched Order Transaction - A MarketIfTouchedOrderTransaction represents the creation of a MarketIfTouched Order in the user’s Account.
- Market
Order - A MarketOrder is an order that is filled immediately upon creation using the current market price.
- Market
Order Delayed Trade Close - 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
- Market
Order Margin Closeout - 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
- Market
Order Position Closeout - A MarketOrderPositionCloseout specifies the extensions to a Market Order when it has been created to closeout a specific Position.
- Market
Order Reject Transaction - A MarketOrderRejectTransaction represents the rejection of the creation of a Market Order.
- Market
Order Request - A MarketOrderRequest specifies the parameters that may be set when creating a Market Order.
- Market
Order Trade Close - A MarketOrderTradeClose specifies the extensions to a Market Order that has been created specifically to close a Trade.
- Market
Order Transaction - 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.
- Open
Trade Dividend Adjustment - Used to pay or collect a dividend adjustment amount for an open Trade within the Account.
- Open
Trade Financing - OpenTradeFinancing is used to pay/collect daily financing charge for an open Trade within an Account
- Order
Cancel Reject Transaction - An OrderCancelRejectTransaction represents the rejection of the cancellation of an Order in the client’s Account.
- Order
Cancel Transaction - An OrderCancelTransaction represents the cancellation of an Order in the client’s Account.
- Order
Client Extensions Modify Reject Transaction - A OrderClientExtensionsModifyRejectTransaction represents the rejection of the modification of an Order’s Client Extensions.
- Order
Client Extensions Modify Transaction - A OrderClientExtensionsModifyTransaction represents the modification of an Order’s Client Extensions.
- Order
Fill Transaction - An OrderFillTransaction represents the filling of an Order in the client’s Account.
- OrderID
- Validated OANDA OrderID.
- Order
Identifier - An OrderIdentifier is used to refer to an Order, and contains both the OrderID and the ClientOrderID.
- Order
Specifier - Validated OANDA OrderSpecifier.
- Position
- The specification of a Position within an Account.
- Position
Financing - OpenTradeFinancing is used to pay/collect daily financing charge for a Position within an Account
- Position
Side - The representation of a Position for a single direction (long or short).
- Price
Bucket - A PriceBucket represents a price available for an amount of liquidity
- Pricing
Component - Validated OANDA PricingComponent.
- Pricing
Heartbeat - A PricingHeartbeat object is injected into the Pricing stream to ensure that the HTTP connection remains active.
- Quote
Home Conversion Factors - 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.
- Reopen
Transaction - A ReopenTransaction represents the re-opening of a closed Account.
- RequestID
- Validated OANDA RequestID.
- Reset
ResettablePL Transaction - A ResetResettablePLTransaction represents the resetting of the Account’s resettable PL counters.
- Stop
Loss Details - 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.
- Stop
Loss Order - 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.
- Stop
Loss Order Reject Transaction - A StopLossOrderRejectTransaction represents the rejection of the creation of a StopLoss Order.
- Stop
Loss Order Request - 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.
- Stop
Loss Order Transaction - A StopLossOrderTransaction represents the creation of a StopLoss Order in the user’s Account.
- Stop
Order - 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.
- Stop
Order Reject Transaction - A StopOrderRejectTransaction represents the rejection of the creation of a Stop Order.
- Stop
Order Request - A StopOrderRequest specifies the parameters that may be set when creating a Stop Order.
- Stop
Order Transaction - A StopOrderTransaction represents the creation of a Stop Order in the user’s Account.
- Tag
- A tag associated with an entity.
- Take
Profit Details - 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.
- Take
Profit Order - 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.
- Take
Profit Order Reject Transaction - A TakeProfitOrderRejectTransaction represents the rejection of the creation of a TakeProfit Order.
- Take
Profit Order Request - A TakeProfitOrderRequest specifies the parameters that may be set when creating a Take Profit Order.
- Take
Profit Order Transaction - 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.
- Trade
Client Extensions Modify Reject Transaction - A TradeClientExtensionsModifyRejectTransaction represents the rejection of the modification of a Trade’s Client Extensions.
- Trade
Client Extensions Modify Transaction - A TradeClientExtensionsModifyTransaction represents the modification of a Trade’s Client Extensions.
- TradeID
- Validated OANDA TradeID.
- Trade
Open - 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.
- Trade
Reduce - 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.
- Trade
Specifier - Validated OANDA TradeSpecifier.
- Trade
Summary - The summary of a Trade within an Account. This representation does not provide the full details of the Trade’s dependent Orders.
- Trailing
Stop Loss Details - 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.
- Trailing
Stop Loss Order - 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.
- Trailing
Stop Loss Order Reject Transaction - A TrailingStopLossOrderRejectTransaction represents the rejection of the creation of a TrailingStopLoss Order.
- Trailing
Stop Loss Order Request - A TrailingStopLossOrderRequest specifies the parameters that may be set when creating a Trailing Stop Loss Order.
- Trailing
Stop Loss Order Transaction - A TrailingStopLossOrderTransaction represents the creation of a TrailingStopLoss Order in the user’s Account.
- Transaction
Heartbeat - A TransactionHeartbeat object is injected into the Transaction stream to ensure that the HTTP connection remains active.
- TransactionID
- Validated OANDA TransactionID.
- Transfer
Funds Reject Transaction - A TransferFundsRejectTransaction represents the rejection of the transfer of funds in/out of an Account.
- Transfer
Funds Transaction - A TransferFundsTransaction represents the transfer of funds in/out of an Account.
- Units
Available - Representation of how many units of an Instrument are available to be traded by an Order depending on its positionFill option.
- Units
Available Details - Representation of many units of an Instrument are available to be traded for both long and short Orders.
- User
Attributes - Contains the attributes of a user.
Enums§
- Accept
Datetime Format - DateTime header
- Account
Financing Mode - The financing mode of an Account
- Cancellable
Order Type - The type of the Order.
- Candlestick
Granularity - The granularity of a candlestick
- DayOf
Week - 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.
- Fixed
Price Order Reason - The reason that the Fixed Price Order was created
- Funding
Reason - The reason that an Account is being funded.
- Guaranteed
Stop Loss Order Mode - The overall behaviour of the Account regarding guaranteed Stop Loss Orders.
- Guaranteed
Stop Loss Order Mode ForInstrument - The overall behaviour of the Account regarding Guaranteed Stop Loss Orders for a specific Instrument.
- Guaranteed
Stop Loss Order Mutability - For Accounts that support guaranteed Stop Loss Orders, describes the actions that can be performed on guaranteed Stop Loss Orders.
- Guaranteed
Stop Loss Order Reason - The reason that the Guaranteed Stop Loss Order was initiated
- Instrument
Type - The type of an Instrument.
- Limit
Order Reason - The reason that the Limit Order was initiated
- Market
IfTouched Order Reason - The reason that the Market-if-touched Order was initiated
- Market
Order Margin Closeout Reason - The reason that the Market Order was created to perform a margin closeout
- Market
Order Reason - The reason that the Market Order was created
- Order
- Documented Order variants identified by OANDA’s
typefield. - Order
Cancel Reason - The reason that an Order was cancelled.
- Order
Fill Reason - The reason that an Order was filled
- Order
Position Fill - Specification of how Positions in the Account are modified when the Order is filled.
- Order
Request - Documented OrderRequest variants identified by OANDA’s
typefield. - Order
State - The current state of the Order.
- Order
State Filter - The state to filter the requested Orders by.
- Order
Trigger Condition - 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.
- Order
Type - The type of the Order.
- Position
Aggregation Mode - The way that position values for an Account are calculated and aggregated.
- Price
Status - The status of the Price.
- Stop
Loss Order Reason - The reason that the Stop Loss Order was initiated
- Stop
Order Reason - The reason that the Stop Order was initiated
- Take
Profit Order Reason - The reason that the Take Profit Order was initiated
- Time
InForce - 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.
- Trade
State - The current state of the Trade.
- Trade
State Filter - The state to filter the Trades by
- Trailing
Stop Loss Order Reason - The reason that the Trailing Stop Loss Order was initiated
- Transaction
- Documented Transaction variants identified by OANDA’s
typefield. - Transaction
Filter - A filter that can be used when fetching Transactions
- Transaction
Reject Reason - The reason that a Transaction was rejected.
- Transaction
Type - The possible types of a Transaction
- Weekly
Alignment - The day of the week to use for candlestick granularities with weekly alignment.
Type Aliases§
- Account
Units - Exact account-currency units.
- Decimal
Number - Exact OANDA decimal number.
- Price
Value - Exact provider price.