Ejemplo n.º 1
0
        void addOrderRow(LiveOrders.LiveOrder o)
        {
            var row = table.NewRow();

            lock (table) {
                var system = o.liveSystem();
                row["system"]        = o.sivName();
                row["pv"]            = system.pv().name();
                row["symbol"]        = o.market();
                row["simFillTime"]   = simFillTimeString(o);
                row["enterExit"]     = o.entryExit() + " " + o.positionDirection();
                row["size"]          = o.size().ToString("N0");
                row["simFillPrice"]  = priceString(o);
                row["details"]       = o.orderDetails();
                row["description"]   = o.description();
                row["hostname"]      = o.hostname();
                row["ferretOrderId"] = o.ferretOrderId();
                row["status"]        = o.isFerret() ? "Submitted" : "";
                row["submittedTime"] = submittedTimeString(o);
                row["liveOrderId"]   = "" + o.id();
                liveOrderRows.Add(o.id(), row);
                table.Rows.InsertAt(row, 0);
            }
            if (FerretControl.canRelease())
            {
                gui.addContextMenu(row);
            }
            else
            {
                gui.removeContextMenu(row);
            }
            if (o.isFerret())
            {
                FerretControl.onIncomingOrderResponse(o, fields => updateStatus(row, fields));
            }
        }