예제 #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));
            }
        }
예제 #2
0
파일: StateCalculator.cs 프로젝트: ifzz/FDK
        /// <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);
            }
        }