In the attached algo, stocks are ranked using the following:
df['rank_long'] = df['pe_ratio'] * df['pb_ratio']
Can someone tell me how to print or log the following after each transaction?
- Stock symbol (currently showing up under 'Placing Order')
- "rank_long" value
- pe ratio
- pb ratio
Currently, the logs look like this:
2015-02-02rebalance:153INFOPlacing order: Equity(3450 [MNST])
I would like the logs to look like this (or similar as long as the data are shown):
2015-02-02rebalance:153INFOPlacing order: Equity(3450 [MNST]), rank_long=xxx, pe_ratio = xxx, pb_ratio = xxx
Edit: It looks like changing the ranking factors (pe ratio & pb ratio) do not have an impact on performance, so there must be a bust in the algo. If anyone could help a beginner out to get this working I'd appreciate it.
Thanks.
Troy