Beispiel #1
0
            internal void UpdateValues(NewOrderSingle fixorder, ExecutionReport rpt)
            {
                try
                {
                    double avgpx = rpt.getAvgPx().getValue();
                    double cumqty = rpt.getCumQty().getValue();
                    double price = rpt.getPrice().getValue();
                    double qty = rpt.getOrderQty().getValue();
                    char status = rpt.getOrdStatus().getValue();
                    //string ordtype = rpt.getOrdType().ToString();
                    switch (status)
                    {
                        case QuickFix.OrdStatus.PARTIALLY_FILLED:
                            base.BackColor = Color.SkyBlue;
                            break;

                        case QuickFix.OrdStatus.FILLED:
                            base.BackColor = Color.Aquamarine;
                            break;

                        case QuickFix.OrdStatus.CANCELED:
                            base.BackColor = Color.Pink;
                            break;
                    }
                    string priceDisplay = "F2";
                    string pctDisplay = "P0";
                    string numDisplay = "N0";
                    double pct = cumqty / order.getOrderQty().getValue();
                    if (rpt.getExecType().getValue() == ExecType.REPLACE)
                    {
                        string clordid = fixorder.getClOrdID().getValue();
                        base.SubItems[0].Text = clordid;
                        base.SubItems[1].Text = rpt.getTransactTime().getValue().ToLocalTime().ToString("HH:mm:ss");
                        this.Name = clordid;
                        this.order = fixorder;
                    }
                    else
                    {
                        base.SubItems[0].Text = this.order.getClOrdID().getValue();
                        base.SubItems[1].Text = order.getTransactTime().getValue().ToLocalTime().ToString("HH:mm:ss");
                    }

                    base.SubItems[2].Text = this.order.getSymbol().getValue();
                    base.SubItems[3].Text = FixDataDictionary.getEnumString(FixDataDictionary.FixField.Side, this.order.getSide().ToString());
                    if (stratidtag != FIELDORDTYPE)
                    {
                        if (order.isSetField(stratidtag))
                        {
                            base.SubItems[4].Text = order.getField(stratidtag);
                        }
                    }
                    else
                    {
                        if (rpt.isSetOrdType())
                        {
                            base.SubItems[4].Text = FixDataDictionary.getEnumString(FixDataDictionary.FixField.OrdType, rpt.getOrdType().ToString());
                        }
                        else
                        {
                            base.SubItems[4].Text = FixDataDictionary.getEnumString(FixDataDictionary.FixField.OrdType, this.order.getOrdType().ToString());
                        }
                    }

                    if (rpt.isSetOrderQty())
                    {
                        base.SubItems[5].Text = qty.ToString(numDisplay);
                    }
                    else
                    {
                        base.SubItems[5].Text = this.order.getOrderQty().getValue().ToString();
                    }
                    if (rpt.isSetPrice())
                    {
                        base.SubItems[6].Text = price.ToString(priceDisplay);
                    }
                    else
                    {
                        base.SubItems[6].Text = this.order.getPrice().getValue().ToString(priceDisplay);
                    }
                    base.SubItems[7].Text = avgpx.ToString(priceDisplay);

                    base.SubItems[8].Text = pct.ToString(pctDisplay);

                    base.SubItems[9].Text = FixDataDictionary.getEnumString(FixDataDictionary.FixField.OrderStatus, status.ToString());
                    ordstatus = status;
                }
                catch (QuickFix.FieldNotFound e)
                {
                    Console.WriteLine("Missing field " + e.field);
                }

                //order.
            }
Beispiel #2
0
 public OrderInfo(NewOrderSingle fixorder)
 {
     rootclordid = fixorder.getClOrdID().getValue();
     order = fixorder;
     ordList = new SortedList();
     //rptlist = new ArrayList();
     ordid = null;
     ordList.Add(order.getClOrdID().getValue(), order);
 }
Beispiel #3
0
 internal OrderViewItem(NewOrderSingle order, int algofield)
     : base(new string[10])
 {
     this.order = order;
     this.Name = order.getClOrdID().getValue();
     stratidtag = algofield;
 }