qtpylib icon indicating copy to clipboard operation
qtpylib copied to clipboard

[BUG] Find available cash and account value inside strategy.

Open TyrionSnow1911 opened this issue 4 years ago • 1 comments

Been trying for a while now to figure out how to get the cash and account value information from inside the strategy. Been looking through the library code for a while and these functions seem to not exist?

Is there anyway we could get these two features added? Or maybe they already do but it's not obvious?

TyrionSnow1911 avatar Aug 02 '20 15:08 TyrionSnow1911

You can get account details like AvailableFunds etc., by

class Teststrategy(Algo): def on_start(self): account = self.get_account() print(account.get("AvailableFunds"))

get_account method is not documented, it returns dict key value pairs.

SundaresanN avatar Sep 06 '20 16:09 SundaresanN