Positions¶
-
class
async_v20.
Position
(instrument: InstrumentName= sentinel, pl: AccountUnits= sentinel, unrealized_pl: AccountUnits= sentinel, resettable_pl: AccountUnits= sentinel, commission: AccountUnits= sentinel, long: PositionSide= sentinel, short: PositionSide= sentinel, financing: DecimalNumber= sentinel, margin_used: AccountUnits= sentinel, guaranteed_execution_fees: AccountUnits= sentinel)[source]¶ Bases:
async_v20.definitions.base.Model
The specification of a Position within an Account.
-
instrument
¶ InstrumentName
The Position’s Instrument.
-
pl
¶ AccountUnits
Profit/loss realized by the Position over the lifetime of the Account.
-
unrealized_pl
¶ AccountUnits
The unrealized profit/loss of all open Trades that contribute to this Position.
-
resettable_pl
¶ AccountUnits
Profit/loss realized by the Position since the Account’s resettablePL was last reset by the client.
-
commission
¶ AccountUnits
The total amount of commission paid for this instrument over the lifetime of the Account. Represented in the Account’s home currency.
-
long
¶ PositionSide
The details of the long side of the Position.
-
short
¶ PositionSide
The details of the short side of the Position.
-
-
class
async_v20.
PositionSide
(units: DecimalNumber= sentinel, average_price: PriceValue= sentinel, trade_ids: ArrayTradeID= sentinel, pl: AccountUnits= sentinel, unrealized_pl: AccountUnits= sentinel, resettable_pl: AccountUnits= sentinel, financing: DecimalNumber= sentinel, guaranteed_execution_fees: AccountUnits= sentinel)[source]¶ Bases:
async_v20.definitions.base.Model
The representation of a Position for a single direction (long or short).
-
units
¶ DecimalNumber
Number of units in the position (negative value indicates short position, positive indicates long position).
-
average_price
¶ PriceValue
Volume-weighted average of the underlying Trade open prices for the Position.
-
pl
¶ AccountUnits
Profit/loss realized by the PositionSide over the lifetime of the Account.
-
unrealized_pl
¶ AccountUnits
The unrealized profit/loss of all open Trades that contribute to this PositionSide.
-
resettable_pl
¶ AccountUnits
Profit/loss realized by the PositionSide since the Account’s resettablePL was last reset by the client.
-
-
class
async_v20.
CalculatedPositionState
(instrument: InstrumentName= sentinel, net_unrealized_pl: AccountUnits= sentinel, long_unrealized_pl: AccountUnits= sentinel, short_unrealized_pl: AccountUnits= sentinel, margin_used: AccountUnits= sentinel)[source]¶ Bases:
async_v20.definitions.base.Model
The dynamic (calculated) state of a Position
-
instrument
¶ InstrumentName
The Position’s Instrument.
-
net_unrealized_pl
¶ AccountUnits
The Position’s net unrealized profit/loss
-
long_unrealized_pl
¶ AccountUnits
The unrealized profit/loss of the Position’s long open Trades
-
short_unrealized_pl
¶ AccountUnits
The unrealized profit/loss of the Position’s short open Trades
-
Margin_used
¶ Margin currently used by the Position
-