Problem with Transactions analyzer
-
The Transactions analyzer does not allow to fully reproduce the cash, value series.
It stores only non-zeros accumulated positions at the end of each bar.
See analyzers/transactions.py lines 97-98
It can be a problem when e.g. there are two opposite transactions (size s and -s) during the same bar at two different prices.
In this case, the resulting position is null but there are commisions and PnL generated, which are not reported in the transactions analysis. -
@adrtod said in Problem with Transactions analyzer:
The resulting position is null but there are commisions and PnL
To start with, the
Transactions
analyzer does report neither commissions nor PnL.May you be talking about something else?
-
I was expecting that two opposite size transactions during the same bar would be reported in the analysis (instead of nothing).
-
The analyzer, as it is, was simply meant to ease the integration with
pyfolio
. Feel free to extend its functionality if you are issuing multiple counteracting orders during a single bar. -
I see. Thanks @backtrader for the answer and for the amazing work!