nautechsystems / nautilus_trader

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

Account equity #985

Open cjdsellers opened 1 year ago

cjdsellers commented 1 year ago

The ability to query for account equity is considered basic functionality for any trading platform, and therefore should be added.

One performance consideration to be aware of is that we don't want to continuously calculate account equity (on the fly), as obtaining the unrealized PnL for every tick change causes significant overhead.

A better approach would be to calculate when the relevant method is called, based on latest data.

rsmb7z commented 1 year ago

Out of interest, will this feature provide just calculated or the option to request the equity related info on_demand live from broker also included?

cjdsellers commented 1 year ago

I intended this just to be a manual calculation on demand (when called), based on latest data in the cache (if any).

What you're describing we could implement in a similar way to how we currently use 'calculated account' (whether to listen to account updates from the external API, or recalculate account state based on events). So this would be a separate feature.

EricLi-Dev commented 5 months ago

Hey! Is this issue actively being worked on? If not, I'd love to give it a shot to help out with some contributions!

Troubladore commented 2 weeks ago

@cjdsellers - does this relate to previously created issue #726 ?