Exemplo n.º 1
0
        private List <Message> GenerateMessages()
        {
            List <Message> result = new List <Message>();
            var            ireq   = (RequestIntradayTick)base._request;

            var tickData = new Dictionary <DateTime, Tuple <string, double, int> >();

            if (ireq.DtStart.HasValue)
            {
                foreach (var dtCurrent in ireq.GetDates())
                {
                    if ((dtCurrent.DayOfWeek != DayOfWeek.Sunday) && (dtCurrent.DayOfWeek != DayOfWeek.Saturday))
                    {
                        var value = new Tuple <string, double, int>("TRADE", Types.RandomDataGenerator.RandomDouble(), Types.RandomDataGenerator.IntradayTickTradeSize());
                        tickData.Add(dtCurrent, value);
                    }
                }
            }

            MessageIntradayTick msg = new MessageIntradayTick(base._request.correlationId, tickData, ireq.IncludeConditionCodes, ireq.Service);

            result.Add(msg);

            return(result);
        }
Exemplo n.º 2
0
        private List<Message> GenerateMessages()
        {
            List<Message> result = new List<Message>();
            var ireq = (RequestIntradayTick)base._request;

            string security = ireq.Security;
            bool isResponseError = Types.Rules.IsSecurityError(security);

            if (isResponseError)
            {
                MessageIntradayTick msg = new MessageIntradayTick(base._request.correlationId, ireq.Service);
                result.Add(msg);
            }
            else
            {
                var tickData = new Dictionary<DateTime, Tuple<string, double, int>>();

                if (ireq.DtStart.HasValue)
                {
                    foreach (var dtCurrent in ireq.GetDates())
                    {
                        if ((dtCurrent.DayOfWeek != DayOfWeek.Sunday) && (dtCurrent.DayOfWeek != DayOfWeek.Saturday))
                        {
                            var value = new Tuple<string, double, int>("TRADE", Types.RandomDataGenerator.RandomDouble(), Types.RandomDataGenerator.IntradayTickTradeSize());
                            tickData.Add(dtCurrent, value);
                        }
                    }
                }

                MessageIntradayTick msg = new MessageIntradayTick(base._request.correlationId, ireq.Service, tickData, ireq.IncludeConditionCodes);
                result.Add(msg);
            }

            return result;
        }
Exemplo n.º 3
0
 internal ElementReference(MessageIntradayTick msg)
 {
     this._parent = (ElementIntradayTickDataParent)msg.Elements.First();
 }
Exemplo n.º 4
0
 internal ElementReference(MessageIntradayTick msg)
 {
     this._parent = (ElementIntradayTickDataParent)msg.Elements.First();
 }