I'm running my strategy and doing some analysis on it with Pyfolio. One of the things I would like to be able to know is what was the condition that triggered a buy/sell operation. I know I could probably show this in a log, but I'd prefer to store it somewhere in memory that's later available in an Analyzer.
At the moment I'm accessing the strategy transactions with:
returns, positions, transactions, gross_lev = pyfoliozer.get_pf_items()
What would be the best way to fill (I guess from the Strategy? extending the Analyzer?) more data into the transactions object? Like a new field called "Condition" or maybe some indicator value? I'm sure there may be a cleaner way to obtains this data, but I would prefer not to over-complicate it for now. In any case, I'm all ears.