Example #1
0
 private void textBox2_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         FixMessage msg = new FixMessage(this.textBoxFixMsgInput.Text);
         ViewMessage(msg);
         e.Handled = true;
     }
 }
Example #2
0
        public override bool Pass(FixMessage message)
        {
            string[] words  = this.Value.ToUpper().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            string   raw    = message.Raw.ToUpper();
            int      filter = words
                              .Where(word => !raw.Contains(word))
                              .Count();

            return(filter == 0);
        }
Example #3
0
        protected override void Read(FixMessage msg)
        {
            this.inqId = msg.TagValue(909);
            if (this.inqId.Length > 8)
            {
                this.inqId = this.inqId.Substring(0, 8) + "... ";
            }

            this.total = msg.TagValue(911);
        }
Example #4
0
        protected override void Read(FixMessage msg)
        {
            FixTag reqIdTag = msg.Tags.FirstOrDefault(x => x.Tag == 710);

            this.reqId = reqIdTag == null ? string.Empty : reqIdTag.Value;
            if (this.reqId.Length > 6)
            {
                this.reqId = this.reqId.Substring(0, 6) + "...";
            }
        }
Example #5
0
        public static InstrumentInterpreter ToLegInstrument(FixMessage msg, FixTag[] leg)
        {
            InstrumentInterpreterOPT opt = new InstrumentInterpreterOPT();

            opt.InitLegReading();
            opt.currency = msg[opt.tCurrency].Value;
            opt.Read(leg);
            opt.orderType = OrderTypeInterpreter.FromMessage(msg);
            return(opt);
        }
Example #6
0
 protected override void Read(FixMessage msg)
 {
     if ((msg[40] == null) || (msg[40].Value == null))
     {
         this.orderType = "<undefined ordertype>";
     }
     else
     {
         this.orderType = "OrderType: " + msg[40].Value;
     }
 }
Example #7
0
 public void SetCompare(FixMessage message)
 {
     if (!this.formCompare.Visible)
     {
         this.formCompare.Show();
     }
     if (message != null)
     {
         this.formCompare.SetMessage(message);
     }
 }
Example #8
0
        public override bool Pass(FixMessage message)
        {
            string[] msgTypes =
                this.Value.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(t => t.ToUpperInvariant())
                .ToArray();

            return(string.IsNullOrEmpty(this.Value) ||
                   message[35] != null &&
                   msgTypes.Contains(message[35].Value.ToUpperInvariant()));
        }
Example #9
0
        protected override void Read(FixMessage msg)
        {
            this.inqId = msg.TagValue(909);
            if (this.inqId.Length > 8)
            {
                this.inqId = this.inqId.Substring(0, 8) + "... ";
            }

            this.cash = msg.TagValue(921);

            this.srd = msg.TagValue(7000) == "SRD" ? "Yes" : "No";
        }
Example #10
0
 protected override void Read(FixMessage msg)
 {
     this.text    = msg[58] == null ? "" : msg[58].Value;
     this.refType = msg[372] == null ? "" : msg[372].Value;
     try
     {
         this.reason = (SessionRejectReason)(Byte.Parse((msg[373].Value)));
     }
     catch (Exception)
     {
         this.reason = SessionRejectReason.Others;
     }
 }
Example #11
0
        protected override void Read(FixMessage msg)
        {
            this.clOrdId     = (msg[11] != null) ? msg[11].Value : "";
            this.orderId     = (msg[37] != null) ? msg[37].Value : "";
            this.orderStatus = msg[39] != null?GetOrderStatus(msg[39].Value) : OrderStatus.NotFilled;

            if (msg[150] != null)
            {
                this.execType = GetExecType(msg[150].Value);
            }
            else
            {
                this.execType = ExecType.Unknown;
            }
        }
Example #12
0
        protected override void ReadMessage(FixMessage msg)
        {
            this.symbol = msg[55].Value;
            this.code   = msg[48].Value;
            if (msg[22] != null)
            {
                this.codeType = GetSecuritySourceId(msg[22].Value[0]);
            }
            else
            {
                this.codeType = SecuritySourceId.Unknown0;
            }

            this.orderType = OrderTypeInterpreter.FromMessage(msg);
            this.qty       = Int32.Parse(msg[38].Value);
        }
Example #13
0
        public void SetMessage(FixMessage msg)
        {
            last_set = last_set == 0 ? 1 : 0;

            switch (last_set)
            {
            case 0:
                textBox1.Text = msg.Raw;
                break;

            case 1:
                textBox2.Text = msg.Raw;
                button3_Click(null, null);
                break;
            }
        }
Example #14
0
        protected override void Read(FixMessage msg)
        {
            FixTag reqIdTag = msg.Tags.FirstOrDefault(x => x.Tag == 710);

            this.reqId = reqIdTag == null ? string.Empty : reqIdTag.Value;
            if (this.reqId.Length > 6)
            {
                this.reqId = this.reqId.Substring(0, 6) + "...";
            }

            FixTag isinTag = msg.Tags.FirstOrDefault(x => x.Tag == 48);

            this.isin = isinTag == null ? "?" : isinTag.Value;

            FixTag srdTag = msg.Tags.FirstOrDefault(x => x.Tag == 7000);

            this.srdInd = srdTag == null ? "?" : (srdTag.Value == "SRD" ? "Yes" : "No");
        }
Example #15
0
        protected override void Read(FixMessage msg)
        {
            this.clOrdId = msg[11].Value;
            if (msg[54] == null)
            {
                this.side = OrderSide.Undefined;
            }
            else if (msg[54].Value == "1")
            {
                this.side = OrderSide.Buy;
            }
            else
            {
                this.side = OrderSide.Sell;
            }


            this.instrument = InstrumentInterpreter.FromMessage(msg);
        }
Example #16
0
        public static OrderTypeInterpreter FromMessage(FixMessage msg)
        {
            OrderTypeInterpreter intr = null;

            if ((msg[40] != null) && (msg[40].Value != null))
            {
                Type t = Type.GetType("FixAnalyzer.OrderTypeInterpreter" + msg[40].Value);
                if (t != null)
                {
                    intr = (OrderTypeInterpreter)Activator.CreateInstance(t);
                }
            }

            if (intr == null)
            {
                intr = new OrderTypeInterpreterUnknown();
            }
            intr.Read(msg);
            return(intr);
        }
Example #17
0
        public static InstrumentInterpreter FromMessage(FixMessage msg)
        {
            InstrumentInterpreter intr = null;

            if ((msg[167] != null) && (msg[167].Value != null))
            {
                Type t = Type.GetType("FixAnalyzer.InstrumentInterpreter" + msg[167].Value);
                if (t != null)
                {
                    intr = (InstrumentInterpreter)Activator.CreateInstance(t);
                }
            }

            if (intr == null)
            {
                intr = new InstrumentInterpreterUnknown();
            }

            intr.ReadMessage(msg);
            return(intr);
        }
Example #18
0
        public static FixInterpreter FromMessage(FixMessage msg)
        {
            FixInterpreter intr;

            if ((msg == null) || (msg[35] == null))
            {
                intr = new FixInterpreterUnknown();
            }
            else
            {
                Type t = Type.GetType("FixAnalyzer.FixInterpreter" + msg[35].Value);

                if (t == null)
                {
                    t = typeof(FixInterpreterUnknown);
                }
                intr = (FixInterpreter)Activator.CreateInstance(t);
            }


            intr.SetMessage(msg);
            return(intr);
        }
Example #19
0
 public static void CopyHtmlToClipboard(FixMessage msg)
 {
     HtmlFragment.CopyToClipboard((new TableViewer(msg)).ToHtml());
 }
Example #20
0
 public static void CopyToClipboard(FixMessage msg)
 {
     (new TableViewer(msg)).ToClipboard();
 }
Example #21
0
 protected override void Read(FixMessage msg)
 {
     this.orgClOrdId = msg[41].Value;
     this.clOrdId    = msg[11].Value;
 }
Example #22
0
 protected override void Read(FixMessage msg)
 {
     //
 }
Example #23
0
 private void SetMessage(FixMessage msg)
 {
     this.message = msg;
     Read(msg);
 }
Example #24
0
 protected abstract void Read(FixMessage msg);
Example #25
0
 public LegInterpreter(FixMessage msg, FixTag[] legTags)
 {
     this.instrument = InstrumentInterpreterOPT.ToLegInstrument(msg, legTags);
 }
Example #26
0
 protected override void ReadMessage(FixMessage msg)
 {
     this.symbol = msg.TagValue(55).Trim(); // get symbol
     int.TryParse(msg.TagValue(22), out this.idSource);
     this.security_id = msg.TagValue(48);
 }
Example #27
0
 public TableViewer(FixMessage message)
 {
     this.message = message;
 }
Example #28
0
 protected override void ReadMessage(FixMessage msg)
 {
     this.orderType = OrderTypeInterpreter.FromMessage(msg);
     Read(msg.Tags);
 }
Example #29
0
 public IDictionary <FixTag, Rectangle> Draw(FixMessage message, Graphics g, Rectangle rect,
                                             int height, FixTag activeTag)
 {
     return(Draw(message, g, rect, height, activeTag, null));
 }
Example #30
0
 protected override void Read(FixMessage msg)
 {
     // no interpretation
 }