Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QuoteChange"/>.
 /// </summary>
 /// <param name="price">Quote price.</param>
 /// <param name="volume">Quote volume.</param>
 /// <param name="ordersCount">Orders count.</param>
 /// <param name="condition">Quote condition.</param>
 public QuoteChange(decimal price, decimal volume, int?ordersCount = null, QuoteConditions condition = default)
 {
     Price       = price;
     Volume      = volume;
     OrdersCount = ordersCount;
     Condition   = condition;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Quote"/>.
 /// </summary>
 /// <param name="security">The instrument by which the quote is received.</param>
 /// <param name="price">Quote price.</param>
 /// <param name="volume">Quote volume.</param>
 /// <param name="side">Direction (buy or sell).</param>
 /// <param name="ordersCount">Orders count.</param>
 /// <param name="condition">Condition.</param>
 public Quote(Security security, decimal price, decimal volume, Sides side, int?ordersCount = null, QuoteConditions condition = default)
 {
     Security       = security;
     Price          = price;
     Volume         = volume;
     OrderDirection = side;
     OrdersCount    = ordersCount;
     Condition      = condition;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QuoteChange"/>.
        /// </summary>
        /// <param name="price">Quote price.</param>
        /// <param name="volume">Quote volume.</param>
        /// <param name="ordersCount">Orders count.</param>
        /// <param name="condition">Quote condition.</param>
        public QuoteChange(decimal price, decimal volume, int?ordersCount = null, QuoteConditions condition = default)
        {
            Price       = price;
            Volume      = volume;
            OrdersCount = ordersCount;
            Condition   = condition;

            StartPosition = null;
            EndPosition   = null;
            Action        = null;

            BoardCode      = null;
            _extensionInfo = null;
        }
Ejemplo n.º 4
0
        /// <inheritdoc />
        protected override NullableTimeQuoteChange Read(FastCsvReader reader, IMarketDataMetaInfo metaInfo)
        {
            var quote = new NullableTimeQuoteChange
            {
                ServerTime = reader.ReadTime(metaInfo.Date),
            };

            var price  = reader.ReadNullableDecimal();
            var volume = reader.ReadNullableDecimal();

            quote.Side = reader.ReadEnum <Sides>();

            int?ordersCount = null;

            if ((reader.ColumnCurr + 1) < reader.ColumnCount)
            {
                ordersCount = reader.ReadNullableInt();
            }

            QuoteConditions condition = default;

            if ((reader.ColumnCurr + 1) < reader.ColumnCount)
            {
                condition = reader.ReadNullableEnum <QuoteConditions>() ?? default;
            }

            if (price != null)
            {
                var qq = new QuoteChange
                {
                    Price       = price.Value,
                    Volume      = volume ?? 0,
                    OrdersCount = ordersCount,
                    Condition   = condition,
                };

                quote.Quote = qq;

                if ((reader.ColumnCurr + 1) < reader.ColumnCount)
                {
                    qq.StartPosition = reader.ReadNullableInt();
                    qq.EndPosition   = reader.ReadNullableInt();
                    qq.Action        = reader.ReadNullableEnum <QuoteChangeActions>();
                }
            }

            return(quote);
        }
Ejemplo n.º 5
0
        /// <inheritdoc />
        protected override NullableTimeQuoteChange Read(FastCsvReader reader, IMarketDataMetaInfo metaInfo)
        {
            var quote = new NullableTimeQuoteChange
            {
                ServerTime = reader.ReadTime(metaInfo.Date),
            };

            var price  = reader.ReadNullableDecimal();
            var volume = reader.ReadNullableDecimal();

            quote.Side = reader.ReadEnum <Sides>();

            int?ordersCount = null;

            if ((reader.ColumnCurr + 1) < reader.ColumnCount)
            {
                ordersCount = reader.ReadNullableInt();
            }

            QuoteConditions condition = default;

            if ((reader.ColumnCurr + 1) < reader.ColumnCount)
            {
                condition = reader.ReadNullableEnum <QuoteConditions>() ?? default;
            }

            QuoteChange?qq = null;

            if (price != null)
            {
                qq = quote.Quote = new QuoteChange
                {
                    Price       = price.Value,
                    Volume      = volume ?? 0,
                    OrdersCount = ordersCount,
                    Condition   = condition,
                };
            }

            if ((reader.ColumnCurr + 1) < reader.ColumnCount)
            {
                var startPosition = reader.ReadNullableInt();
                var endPosition   = reader.ReadNullableInt();
                var action        = reader.ReadNullableEnum <QuoteChangeActions>();

                if (qq != null)
                {
                    var temp = qq.Value;

                    temp.StartPosition = startPosition;
                    temp.EndPosition   = endPosition;
                    temp.Action        = action;

                    quote.Quote = temp;
                }
            }

            if ((reader.ColumnCurr + 1) < reader.ColumnCount)
            {
                quote.State     = reader.ReadNullableEnum <QuoteChangeStates>();
                quote.SeqNum    = reader.ReadNullableLong();
                quote.BuildFrom = reader.ReadBuildFrom();
            }

            return(quote);
        }