Exemple #1
0
        /// <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));
            }
        }
Exemple #2
0
        /// <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);
            }
        }