/// <summary> /// Returns StateInfo representation of current state. /// </summary> /// <returns></returns> public StateInfo GetState() { lock (this.calculator) { IDictionary <string, Asset> assets; if (this.account.Type != AccountType.Cash) { assets = this.account.Assets; } else { assets = new CashAssets(this.trade.Cache.AccountInfo.Assets, this.account, this.Calculator.MarketState).AsDictionary(); } return(new StateInfo(this.account, assets, this.calculator.Prices.ToDictionary(), this.calculatorQuotes, this.calculator.Symbols, this.processor.Generation)); } }
/// <summary> /// Returns StateInfo representation of current state. /// </summary> /// <returns></returns> public StateInfo GetState() { lock (this.calculator) { IDictionary<string, Asset> assets; if (this.account.Type != AccountType.Cash) assets = this.account.Assets; else assets = new CashAssets(this.trade.Cache.AccountInfo.Assets, this.account, this.Calculator.MarketState).AsDictionary(); return new StateInfo(this.account, assets, this.calculator.Prices.ToDictionary(), this.calculatorQuotes, this.calculator.Symbols, this.processor.Generation); } }