Exemplo n.º 1
0
        private void TryUpdateDepth(Subscription subscription, MarketDepth depth)
        {
            if (!_quotesWindows.TryGetValue(depth.Security, out var wnd))
            {
                return;
            }

            wnd.Update(depth.ImpliedVolatility(Connector, Connector, _model.ExchangeInfoProvider, depth.LastChangeTime));
        }
Exemplo n.º 2
0
        private void TryUpdateDepth(MarketDepth depth)
        {
            if (!_quotesWindows.TryGetValue(depth.Security, out var wnd))
            {
                return;
            }

            wnd.Update(depth.ImpliedVolatility(Connector, Connector, depth.LastChangeTime));
        }
Exemplo n.º 3
0
        /// <summary>
        /// To create the volatility order book from usual order book.
        /// </summary>
        /// <param name="depth">The order book quotes of which will be changed to volatility quotes.</param>
        /// <param name="securityProvider">The provider of information about instruments.</param>
        /// <param name="dataProvider">The market data provider.</param>
        /// <param name="currentTime">The current time.</param>
        /// <param name="riskFree">The risk free interest rate.</param>
        /// <param name="dividend">The dividend amount on shares.</param>
        /// <returns>The order book volatility.</returns>
        public static MarketDepth ImpliedVolatility(this MarketDepth depth, ISecurityProvider securityProvider, IMarketDataProvider dataProvider, DateTimeOffset currentTime, decimal riskFree = 0, decimal dividend = 0)
        {
            if (depth == null)
            {
                throw new ArgumentNullException(nameof(depth));
            }

            return(depth.ImpliedVolatility(new BlackScholes(depth.Security, securityProvider, dataProvider)
            {
                RiskFree = riskFree, Dividend = dividend
            }, currentTime));
        }
Exemplo n.º 4
0
 private void OnQuotesChanged()
 {
     DepthCtrl.UpdateDepth(_depth.ImpliedVolatility(Connector, Connector, Connector.CurrentTime));
 }