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.ModelThe specification of a Position within an Account.
-
instrument¶ InstrumentNameThe Position’s Instrument.
-
pl¶ AccountUnitsProfit/loss realized by the Position over the lifetime of the Account.
-
unrealized_pl¶ AccountUnitsThe unrealized profit/loss of all open Trades that contribute to this Position.
-
resettable_pl¶ AccountUnitsProfit/loss realized by the Position since the Account’s resettablePL was last reset by the client.
-
commission¶ AccountUnitsThe total amount of commission paid for this instrument over the lifetime of the Account. Represented in the Account’s home currency.
-
long¶ PositionSideThe details of the long side of the Position.
-
short¶ PositionSideThe 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.ModelThe representation of a Position for a single direction (long or short).
-
units¶ DecimalNumberNumber of units in the position (negative value indicates short position, positive indicates long position).
-
average_price¶ PriceValueVolume-weighted average of the underlying Trade open prices for the Position.
-
pl¶ AccountUnitsProfit/loss realized by the PositionSide over the lifetime of the Account.
-
unrealized_pl¶ AccountUnitsThe unrealized profit/loss of all open Trades that contribute to this PositionSide.
-
resettable_pl¶ AccountUnitsProfit/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.ModelThe dynamic (calculated) state of a Position
-
instrument¶ InstrumentNameThe Position’s Instrument.
-
net_unrealized_pl¶ AccountUnitsThe Position’s net unrealized profit/loss
-
long_unrealized_pl¶ AccountUnitsThe unrealized profit/loss of the Position’s long open Trades
-
short_unrealized_pl¶ AccountUnitsThe unrealized profit/loss of the Position’s short open Trades
-
Margin_used¶ Margin currently used by the Position
-