In the OnBarsUpdate method of a strategy, I want to get the cash balance of the current account that is being used for the strategy so that I can calculate the number of contracts I can purchase.
I understand that Account is the current account associated with the strategy. I try to get account details as follows as instructed in some other posts.
var cash = Account.Get(AccountItem.CashValue, Currency.UsDollar);
What is the proper way to access or calculate the current account value while a strategy is running on historical data?
I am only backtesting on historical data at this point so I'm interested particularly in behavior during a backtest, not real-time.
Thanks,
Comment