nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
1.93k stars 438 forks source link

Performance Stats in streaming feather #1041

Open rsmb7z opened 1 year ago

rsmb7z commented 1 year ago

Feature Request

It would be nice to have Performance Stats (engine.portfolio.analyzer.get_performance_stats_returns()) in streaming feather. This will help analyse how the strategy is performing over-time in rolling manner.

Also allowing to specifiy the custom period will be allow more flexibility to request updated stats within Strategy and include performance in decision making i.e. in case the Strategy is under-performing.

limx0 commented 1 year ago

Hey @rsmb7z yep this is a great idea. Chris and I have spoken about something kind of similar.

We just need to decide where it gets calculated. While we decide, and If you wanted something sooner, I think you could achieve something similar with an actor.

cjdsellers commented 1 year ago

We could probably add some portfolio configuration to calculate and publish performance stats continuously on some interval. It has access to the message bus, will have a think.

rsmb7z commented 1 year ago

@cjdsellers thanks for taking this. Yes interval shall be okay once a day (or configurable timedelta). I was having thought on while trading specially Live, we will have single portfolio, so if we can have these stats per strategy.