Esempio n. 1
0
        public void OnMessage(QuickFix.FIX44.Quote quote, SessionID s)
        {
            try
            {
                Console.WriteLine("Received Quote Message.");

                QuickFix.FIX44.ExecutionReport exec = new QuickFix.FIX44.ExecutionReport();

                exec.SetField(new OrderID(quote.QuoteID.getValue()));
                exec.SetField(new ClOrdID(quote.QuoteReqID.getValue()));
                exec.SetField(new Side(quote.Side.getValue()));
                exec.SetField(new Symbol(quote.Symbol.getValue()));
                exec.SetField(new Currency(quote.Currency.getValue()));
                exec.SetField(new SecurityType(quote.SecurityType.getValue()));
                exec.SetField(new CFICode(quote.CFICode.getValue()));

                if (quote.BidPx.getValue() > 0)
                {
                    exec.SetField(new Price(quote.OfferPx.getValue()));
                }
                else
                {
                    exec.SetField(new Price(quote.BidPx.getValue()));
                }

                exec.SetField(new OrderQty(quote.OrderQty.getValue()));
                exec.SetField(new TransactTime(DateTime.Now.Date));
                exec.SetField(new SettlDate(quote.SettlDate.getValue()));
                exec.SetField(new Account(quote.Account.getValue()));

                _session.Send(exec);

                Console.WriteLine(exec.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Esempio n. 2
0
        public void FromString_Groups_NoFactory()
        {
            // issue 179
            var dd = new QuickFix.DataDictionary.DataDictionary();

            dd.Load("../../../spec/fix/FIX44.xml");

            string[] msgFields =
            {
                // header
                "8=FIX.4.4",              "9=638",          "35=8",             "34=360",          "49=BLPTSOX",                  "52=20130321-15:21:23", "56=THINKTSOX",         "57=6804469",                "128=ZERO",
                // non-group body fields
                "6=122.255",              "11=61101189",    "14=1990000",       "15=GBP",          "17=VCON:20130321:50018:5:12", "22=4",                 "31=122.255",           "32=1990000",
                "37=116",                 "38=1990000",     "39=2",             "48=GB0032452392", "54=1",                        "55=[N/A]",             "60=20130321-15:21:23", "64=20130322",               "75=20130321",
                "106=UK TSY 4 1/4% 2036", "118=2436321.85", "150=F",            "151=0",           "157=15",                      "159=3447.35",          "192=0",                "198=3739:20130321:50018:5",
                "223=0.0425",             "228=1",          "236=0.0291371041", "238=0",           "381=2432874.5",               "423=1",                "470=GB",               "541=20360307",
                // NoPartyIDs
                "453=6",
                "448=VCON",               "447=D",          "452=1",            "802=1",           "523=14",                      "803=4",
                "448=TFOLIO:6804469",     "447=D",          "452=12",
                "448=TFOLIO",             "447=D",          "452=11",
                "448=THINKFOLIO LTD",     "447=D",          "452=13",
                "448=SXT",                "447=D",          "452=16",
                "448=TFOLIO:6804469",     "447=D",          "452=36",
                "10=152"
            };
            string msgStr = String.Join(Message.SOH, msgFields) + Message.SOH;

            QuickFix.FIX44.ExecutionReport msg = new QuickFix.FIX44.ExecutionReport();
            msg.FromString(msgStr, true, dd, dd, null); // <-- null factory!

            Console.WriteLine(msg.ToString());

            QuickFix.FIX44.ExecutionReport.NoPartyIDsGroup partyGroup = new QuickFix.FIX44.ExecutionReport.NoPartyIDsGroup();
            msg.GetGroup(2, partyGroup);

            Assert.False(partyGroup.IsSetNoPartySubIDs());
        }
Esempio n. 3
0
        public void FromString_Groups_NoFactory()
        {
            // issue 179
            var dd = new QuickFix.DataDictionary.DataDictionary();
            dd.Load("../../../spec/fix/FIX44.xml");

            string[] msgFields = {
                // header
                "8=FIX.4.4","9=638", "35=8", "34=360", "49=BLPTSOX", "52=20130321-15:21:23", "56=THINKTSOX", "57=6804469", "128=ZERO",
                // non-group body fields
                "6=122.255", "11=61101189", "14=1990000", "15=GBP", "17=VCON:20130321:50018:5:12", "22=4", "31=122.255", "32=1990000",
                "37=116", "38=1990000", "39=2", "48=GB0032452392", "54=1", "55=[N/A]", "60=20130321-15:21:23", "64=20130322", "75=20130321",
                "106=UK TSY 4 1/4% 2036", "118=2436321.85", "150=F", "151=0", "157=15", "159=3447.35", "192=0", "198=3739:20130321:50018:5",
                "223=0.0425", "228=1", "236=0.0291371041", "238=0", "381=2432874.5", "423=1", "470=GB", "541=20360307",
                // NoPartyIDs
                "453=6",
                "448=VCON", "447=D", "452=1", "802=1", "523=14", "803=4",
                "448=TFOLIO:6804469", "447=D", "452=12",
                "448=TFOLIO", "447=D", "452=11",
                "448=THINKFOLIO LTD", "447=D", "452=13",
                "448=SXT", "447=D", "452=16",
                "448=TFOLIO:6804469", "447=D", "452=36",
                "10=152"
            };
            string msgStr = String.Join(Message.SOH, msgFields) + Message.SOH;

            QuickFix.FIX44.ExecutionReport msg = new QuickFix.FIX44.ExecutionReport();
            msg.FromString(msgStr, true, dd, dd, null); // <-- null factory!

            Console.WriteLine(msg.ToString());

            QuickFix.FIX44.ExecutionReport.NoPartyIDsGroup partyGroup = new QuickFix.FIX44.ExecutionReport.NoPartyIDsGroup();
            msg.GetGroup(2, partyGroup);

            Assert.False(partyGroup.IsSetNoPartySubIDs());
        }
Esempio n. 4
0
 public void OnMessage(QuickFix.FIX44.ExecutionReport m, SessionID s)
 {
     Logger.Instance().Log($"REPLY (ExecutionReport) => {m.ToString()}");
 }