Account

class async_v20.AccountProperties(id: AccountID= sentinel, mt4_account_id: int= sentinel, tags: ArrayStr= sentinel)[source]

Bases: async_v20.definitions.base.Model

Properties related to an Account.

id

AccountID The Account’s identifier

mt4account_id

AccountID The Account’s associated MT4 Account ID. This field will not be present if the Account is not an MT4 account.

tags

( str, …) The Account’s tags

class async_v20.AccountChangesState(unrealized_pl: AccountUnits= sentinel, nav: AccountUnits= sentinel, margin_used: AccountUnits= sentinel, margin_available: AccountUnits= sentinel, position_value: AccountUnits= sentinel, margin_closeout_unrealized_pl: AccountUnits= sentinel, margin_closeout_nav: AccountUnits= sentinel, margin_closeout_margin_used: AccountUnits= sentinel, margin_closeout_percent: DecimalNumber= sentinel, margin_closeout_position_value: DecimalNumber= sentinel, withdrawal_limit: AccountUnits= sentinel, margin_call_margin_used: AccountUnits= sentinel, margin_call_percent: DecimalNumber= sentinel, orders: ArrayDynamicOrderState= sentinel, trades: ArrayCalculatedTradeState= sentinel, positions: ArrayCalculatedPositionState= sentinel, balance: AccountUnits= sentinel, pl: AccountUnits= sentinel, resettable_pl: AccountUnits= sentinel, commission: AccountUnits= sentinel, guaranteed_execution_fees: AccountUnits= sentinel)[source]

Bases: async_v20.definitions.base.Model

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.

unrealized_pl

AccountUnits The total unrealized profit/loss for all Trades currently open in the Account. Represented in the Account’s home currency.

nav

AccountUnits The net asset value of the Account. Equal to Account balance + unrealizedPL. Represented in the Account’s home currency.

margin_used

AccountUnits Margin currently used for the Account. Represented in the Account’s home currency.

margin_available

AccountUnits Margin available for Account. Represented in the Account’s home currency.

position_value

AccountUnits The value of the Account’s open positions represented in the Account’s home currency.

margin_closeout_unrealized_pl

AccountUnits The Account’s margin closeout unrealized PL.

margin_closeout_nav

AccountUnits The Account’s margin closeout NAV.

margin_closeout_margin_used

AccountUnits The Account’s margin closeout margin used.

margin_closeout_percent

DecimalNumber The Account’s margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation.

margin_closeout_position_value

DecimalNumber The value of the Account’s open positions as used for margin closeout calculations represented in the Account’s home currency.

withdrawal_limit

AccountUnits The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account.

margin_call_margin_used

AccountUnits The Account’s margin call margin used.

margin_call_percent

DecimalNumber The Account’s margin call percentage. When this value is 1.0 or above the Account is in a margin call situation.

orders

( DynamicOrderState, …) The price-dependent state of each pending Order in the Account.

trades

( CalculatedTradeState, …) The price-dependent state for each open Trade in the Account.

positions

( CalculatedPositionState, ..) The price-dependent state for each open Position in the Account.

# TODO add documentation for Pl and resettabel_pl
class async_v20.AccountSummary(id: AccountID= sentinel, alias: str= sentinel, currency: Currency= sentinel, balance: AccountUnits= sentinel, created_by_user_id: int= sentinel, created_time: DateTime= sentinel, pl: AccountUnits= sentinel, resettable_pl: AccountUnits= sentinel, resettabled_pl_time: DateTime= sentinel, commission: AccountUnits= sentinel, margin_rate: DecimalNumber= sentinel, margin_call_enter_time: DateTime= sentinel, margin_call_extension_count: int= sentinel, last_margin_call_extension_time: DateTime= sentinel, open_trade_count: int= sentinel, open_position_count: int= sentinel, pending_order_count: int= sentinel, hedging_enabled: bool= sentinel, unrealized_pl: AccountUnits= sentinel, nav: AccountUnits= sentinel, margin_used: AccountUnits= sentinel, margin_available: AccountUnits= sentinel, position_value: AccountUnits= sentinel, margin_closeout_unrealized_pl: AccountUnits= sentinel, margin_closeout_nav: AccountUnits= sentinel, margin_closeout_margin_used: AccountUnits= sentinel, margin_closeout_percent: DecimalNumber= sentinel, margin_closeout_position_value: DecimalNumber= sentinel, withdrawal_limit: AccountUnits= sentinel, margin_call_margin_used: AccountUnits= sentinel, margin_call_percent: DecimalNumber= sentinel, last_transaction_id: TransactionID= sentinel, trades: ArrayTradeSummary= sentinel, positions: ArrayPosition= sentinel, orders: ArrayOrder= sentinel, financing: DecimalNumber= sentinel, guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode= sentinel, resettable_pl_time: DateTime= sentinel, guaranteed_execution_fees: AccountUnits= sentinel)[source]

Bases: async_v20.definitions.base.Model

A summary representation of a client’s Account. The AccountSummary does not provide to full specification of pending Orders, open Trades and Positions.

id

AccountID The Account’s identifier

alias

str Client-assigned alias for the Account. Only provided if the Account has an alias set

currency

Currency The home currency of the Account

balance

AccountUnits The current balance of the Account. Represented in the Account’s home currency.

created_by_user_id

int ID of the user that created the Account.

created_time

DateTime The date/time when the Account was created.

pl

AccountUnits The total profit/loss realized over the lifetime of the Account. Represented in the Account’s home currency.

resettable_pl

AccountUnits The total realized profit/loss for the Account since it was last reset by the client. Represented in the Account’s home currency.

resettabled_pl_time

DateTime The date/time that the Account’s resettablePL was last reset.

commission

AccountUnits The total amount of commission paid over the lifetime of the Account. Represented in the Account’s home currency.

margin_rate

DecimalNumber Client-provided margin rate override for the Account. The effective margin rate of the Account is the lesser of this value and the OANDA margin rate for the Account’s division. This value is only provided if a margin rate override exists for the Account.

margin_call_enter_time

DateTime The date/time when the Account entered a margin call state. Only provided if the Account is in a margin call.

margin_call_extension_count

int The number of times that the Account’s current margin call was extended.

last_margin_call_extension_time

DateTime The date/time of the Account’s last margin call extension.

open_trade_count

int The number of Trades currently open in the Account.

open_position_count

int The number of Positions currently open in the Account.

pending_order_count

int The number of Orders currently pending in the Account.

hedging_enabled

bool Flag indicating that the Account has hedging enabled.

unrealized_pl

AccountUnits The total unrealized profit/loss for all Trades currently open in the Account. Represented in the Account’s home currency.

nav

AccountUnits The net asset value of the Account. Equal to Account balance + unrealizedPL. Represented in the Account’s home currency.

margin_used

AccountUnits Margin currently used for the Account. Represented in the Account’s home currency.

margin_available

AccountUnits Margin available for Account. Represented in the Account’s home currency.

position_value

AccountUnits The value of the Account’s open positions represented in the Account’s home currency.

margin_closeout_unrealized_pl

AccountUnits The Account’s margin closeout unrealized PL.

margin_closeout_nav

AccountUnits The Account’s margin closeout NAV.

margin_closeout_margin_used

AccountUnits The Account’s margin closeout margin used.

margin_closeout_percent

DecimalNumber The Account’s margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation.

margin_closeout_position_value

DecimalNumber The value of the Account’s open positions as used for margin closeout calculations represented in the Account’s home currency.

withdrawal_limit

AccountUnits The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account.

margin_call_margin_used

AccountUnits The Account’s margin call margin used.

margin_call_percent

DecimalNumber The Account’s margin call percentage. When this value is 1.0 or above the Account is in a margin call situation.

last_transaction_id

TransactionID The ID of the last Transaction created for the Account.

class async_v20.Account(id: AccountID= sentinel, alias: str= sentinel, currency: Currency= sentinel, balance: AccountUnits= sentinel, created_by_user_id: int= sentinel, created_time: DateTime= sentinel, pl: AccountUnits= sentinel, resettable_pl: AccountUnits= sentinel, resettabled_pl_time: DateTime= sentinel, commission: AccountUnits= sentinel, margin_rate: DecimalNumber= sentinel, margin_call_enter_time: DateTime= sentinel, margin_call_extension_count: int= sentinel, last_margin_call_extension_time: DateTime= sentinel, open_trade_count: int= sentinel, open_position_count: int= sentinel, pending_order_count: int= sentinel, hedging_enabled: bool= sentinel, unrealized_pl: AccountUnits= sentinel, nav: AccountUnits= sentinel, margin_used: AccountUnits= sentinel, margin_available: AccountUnits= sentinel, position_value: AccountUnits= sentinel, margin_closeout_unrealized_pl: AccountUnits= sentinel, margin_closeout_nav: AccountUnits= sentinel, margin_closeout_margin_used: AccountUnits= sentinel, margin_closeout_percent: DecimalNumber= sentinel, margin_closeout_position_value: DecimalNumber= sentinel, withdrawal_limit: AccountUnits= sentinel, margin_call_margin_used: AccountUnits= sentinel, margin_call_percent: DecimalNumber= sentinel, last_transaction_id: TransactionID= sentinel, trades: ArrayTradeSummary= sentinel, positions: ArrayPosition= sentinel, orders: ArrayOrder= sentinel, financing: DecimalNumber= sentinel, guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode= sentinel, resettable_pl_time: DateTime= sentinel, guaranteed_execution_fees: AccountUnits= sentinel)[source]

Bases: async_v20.definitions.types.AccountSummary

The full details of a client’s Account. This includes full open Trade, open Position and pending Order representation.

id

AccountID The Account’s identifier

alias

str Client-assigned alias for the Account. Only provided if the Account has an alias set

currency

Currency The home currency of the Account

balance

AccountUnits The current balance of the Account. Represented in the Account’s home currency.

created_by_user_id

int ID of the user that created the Account.

created_time

DateTime The date/time when the Account was created.

pl

AccountUnits The total profit/loss realized over the lifetime of the Account. Represented in the Account’s home currency.

resettable_pl

AccountUnits The total realized profit/loss for the Account since it was last reset by the client. Represented in the Account’s home currency.

resettabled_pl_time

DateTime The date/time that the Account’s resettablePL was last reset.

commission

AccountUnits The total amount of commission paid over the lifetime of the Account. Represented in the Account’s home currency.

margin_rate

DecimalNumber Client-provided margin rate override for the Account. The effective margin rate of the Account is the lesser of this value and the OANDA margin rate for the Account’s division. This value is only provided if a margin rate override exists for the Account.

margin_call_enter_time

DateTime The date/time when the Account entered a margin call state. Only provided if the Account is in a margin call.

margin_call_extension_count

int The number of times that the Account’s current margin call was extended.

last_margin_call_extension_time

DateTime The date/time of the Account’s last margin call extension.

open_trade_count

int The number of Trades currently open in the Account.

open_position_count

int The number of Positions currently open in the Account.

pending_order_count

int The number of Orders currently pending in the Account.

hedging_enabled

bool Flag indicating that the Account has hedging enabled.

unrealized_pl

AccountUnits The total unrealized profit/loss for all Trades currently open in the Account. Represented in the Account’s home currency.

nav

AccountUnits The net asset value of the Account. Equal to Account balance + unrealizedPL. Represented in the Account’s home currency.

margin_used

AccountUnits Margin currently used for the Account. Represented in the Account’s home currency.

margin_available

AccountUnits Margin available for Account. Represented in the Account’s home currency.

position_value

AccountUnits The value of the Account’s open positions represented in the Account’s home currency.

margin_closeout_unrealized_pl

AccountUnits The Account’s margin closeout unrealized PL.

margin_closeout_nav

AccountUnits The Account’s margin closeout NAV.

margin_closeout_margin_used

AccountUnits The Account’s margin closeout margin used.

margin_closeout_percent

DecimalNumber The Account’s margin closeout percentage. When this value is 1.0 or above the Account is in a margin closeout situation.

margin_closeout_position_value

DecimalNumber The value of the Account’s open positions as used for margin closeout calculations represented in the Account’s home currency.

withdrawal_limit

AccountUnits The current WithdrawalLimit for the account which will be zero or a positive value indicating how much can be withdrawn from the account.

margin_call_margin_used

AccountUnits The Account’s margin call margin used.

margin_call_percent

DecimalNumber The Account’s margin call percentage. When this value is 1.0 or above the Account is in a margin call situation.

last_transaction_id

TransactionID The ID of the last Transaction created for the Account.

trades

( TradeSummary, …) The details of the Trades currently open in the Account.

positions

( Position, …) The details all Account Positions.

orders

( Order, …) The details of the Orders currently pending in the Account.

class async_v20.AccountChanges(orders_created: ArrayOrder= sentinel, orders_cancelled: ArrayOrder= sentinel, orders_filled: ArrayOrder= sentinel, orders_triggered: ArrayOrder= sentinel, trades_opened: ArrayTradeSummary= sentinel, trades_reduced: ArrayTradeSummary= sentinel, trades_closed: ArrayTradeSummary= sentinel, positions: ArrayPosition= sentinel, transactions: ArrayTransaction= sentinel)[source]

Bases: async_v20.definitions.base.Model

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.

orders_created

( Order, …) The Orders created. These Orders may have been filled, cancelled or triggered in the same period.

orders_cancelled

( Order, …) The Orders cancelled.

orders_filled

( Order, …) The Orders filled.

orders_triggered

( Order, …) The Orders triggered.

trades_opened

( TradeSummary, …) The Trades opened.

trades_reduced

( TradeSummary, …) The Trades reduced.

trades_closed

( TradeSummary, …) The Trades closed.

positions

( Position, …) The Positions changed.

transactions

( Transaction, …) The Transactions that have been generated.