PortfolioStatistics#

tradeexecutor.state.statistics.PortfolioStatistics class.

class PortfolioStatistics[source]#

Bases: object

PortfolioStatistics(calculated_at: datetime.datetime, total_equity: tradingstrategy.types.USDollarAmount, free_cash: tradingstrategy.types.USDollarAmount, open_position_count: int, open_position_equity: tradingstrategy.types.USDollarAmount, frozen_position_count: int, frozen_position_equity: tradingstrategy.types.USDollarAmount, closed_position_count: int, unrealised_profit_usd: tradingstrategy.types.USDollarAmount, first_trade_at: datetime.datetime, last_trade_at: datetime.datetime, realised_profit_usd: tradingstrategy.types.USDollarAmount = 0)

__init__(calculated_at, total_equity, free_cash, open_position_count, open_position_equity, frozen_position_count, frozen_position_equity, closed_position_count, unrealised_profit_usd, first_trade_at, last_trade_at, realised_profit_usd=0)#
Parameters
Return type

None

Methods

__init__(calculated_at, total_equity, ...[, ...])

from_dict(kvs, *[, infer_missing])

from_json(s, *[, parse_float, parse_int, ...])

schema(*[, infer_missing, only, exclude, ...])

to_dict([encode_json])

to_json(*[, skipkeys, ensure_ascii, ...])

Attributes

realised_profit_usd

calculated_at

Real-time clock when these stats were calculated

total_equity

free_cash

open_position_count

open_position_equity

frozen_position_count

frozen_position_equity

closed_position_count

unrealised_profit_usd

first_trade_at

last_trade_at

calculated_at: datetime#

Real-time clock when these stats were calculated

__init__(calculated_at, total_equity, free_cash, open_position_count, open_position_equity, frozen_position_count, frozen_position_equity, closed_position_count, unrealised_profit_usd, first_trade_at, last_trade_at, realised_profit_usd=0)#
Parameters
Return type

None