private List <Message> GenerateMessages()
        {
            List <Message> result = new List <Message>();
            var            ireq   = (IntradayTickRequest)base._request;

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

            if (isResponseError)
            {
                IntradayTickMessage msg = new IntradayTickMessage(base._request.correlationId, ireq.Service);
                result.Add(msg);
            }
            else
            {
                var tickData = new SortedDictionary <DateTime, Types.Tuple3 <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 Types.Tuple3 <string, double, int>("TRADE", Types.RandomDataGenerator.RandomDouble(), Types.RandomDataGenerator.IntradayTickTradeSize());
                            tickData.Add(dtCurrent, value);
                        }
                    }
                }

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

            return(result);
        }
Example #2
0
 internal IntradayTickElementReference(IntradayTickMessage msg)
 {
     this._parent = (IntradayTickElementDataParent)msg.Elements.First();
 }