FinalPositionStatistics#
tradeexecutor.state.statistics.FinalPositionStatistics class.
- class FinalPositionStatistics[source]#
Bases:
object
When position is closed, its final statistics are calculated.
These statistics contain fields that is not present in open positions.
- __init__(calculated_at, trade_count, value_at_open, value_at_max)#
- Parameters
calculated_at (datetime) –
trade_count (int) –
value_at_open (USDollarAmount) –
value_at_max (USDollarAmount) –
- Return type
None
Methods
__init__
(calculated_at, trade_count, ...)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
Real-time clock when these stats were calculated
How many trades we have made
How much was the first purchase
How much was we held at the maximum point of time
- value_at_open: USDollarAmount#
How much was the first purchase
- value_at_max: USDollarAmount#
How much was we held at the maximum point of time
- __init__(calculated_at, trade_count, value_at_open, value_at_max)#
- Parameters
calculated_at (datetime) –
trade_count (int) –
value_at_open (USDollarAmount) –
value_at_max (USDollarAmount) –
- Return type
None