コード例 #1
0
ファイル: IQFeed.cs プロジェクト: afcarl/QuantDeveloper
        private void ProcessPort5009(object o, BufferArgs args)
        {
            //Console.WriteLine( "*" + args.Line + "*" );

            args.items = args.Line.Split(chDelim);

            switch (args.items[0])
            {
            case "Q":
                if ("Not Found" == args.items[3])
                {
                    Console.WriteLine("Symbol not found, number of items: {0} {1}", args.items[1], args.items.Length);
                    if (null != HandleWatchSymbolNotFound)
                    {
                        HandleWatchSymbolNotFound(this, new WatchSymbolNotFoundMessageEventArgs(args.items[1]));
                    }
                }
                else
                {
                    UpdateMessage update = new UpdateMessage(args.items);
                    if (null != HandleUpdateMessage)
                    {
                        HandleUpdateMessage(this, new UpdateMessageEventArgs(update));
                    }
                    //if (null != HandleQ) HandleQ(this, args);
                }
                break;

            case "P":
                SummaryMessage summary = new SummaryMessage(args.items);
                if (null != HandleSummaryMessage)
                {
                    HandleSummaryMessage(this, new SummaryMessageEventArgs(summary));
                }
                //if (null != HandleP) HandleP(this, args);
                break;

            case "F":
                FundamentalMessage fundamental = new FundamentalMessage(args.items);
                if (null != HandleFundamentalMessage)
                {
                    HandleFundamentalMessage(this, new FundamentalMessageEventArgs(fundamental));
                }
                //if (null != HandleF) HandleF(this, args);
                break;

            case "N":

                int pos;                                         // extract headline just in case it has commas in it
                pos           = args.Line.IndexOf(",", 2);       // just prior story id
                pos           = args.Line.IndexOf(",", pos + 1); // just prior symbol list
                pos           = args.Line.IndexOf(",", pos + 1); // just prior datetime
                pos           = args.Line.IndexOf(",", pos + 1); // just prior headline
                args.headline = args.Line.Substring(pos + 1);    // get rest of line

                NewsMessage news = new NewsMessage(args.items, args.headline);
                if (null != HandleNewsMessage)
                {
                    HandleNewsMessage(this, new NewsMessageEventArgs(news));
                }
                //if (null != HandleN) HandleN(this, args);
                break;

            case "T":
                CheckTime(args);
                //if (null != HandleT) HandleT(this, args);
                break;

            case "S":
                Console.WriteLine("*" + args.Line + "*");
                SystemMessage system = new SystemMessage(args.items);
                if (null != HandleSystemMessage)
                {
                    HandleSystemMessage(this, new SystemMessageEventArgs(system));
                }
                //HandleS(e);
                break;
            }
        }
コード例 #2
0
 public FundamentalMessageEventArgs(FundamentalMessage Message)
 {
     this.Message = Message;
 }