Example #1
0
        bool matchesStatusFilter(LiveOrders.LiveOrder o)
        {
            var filter = gui.filter();

            if (filter.Equals("ALL"))
            {
                return(true);
            }
            if (filter.Equals("Not Ferret"))
            {
                return(!o.isFerret());
            }
            if (filter.Equals("Ferret"))
            {
                return(o.isFerret());
            }
            throw Bomb.toss("unknown filter " + filter);
        }
Example #2
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));
            }
        }
Example #3
0
 static string priceString(LiveOrders.LiveOrder o)
 {
     return(o.price() == null ? "" : Strings.nDecimals(6, o.price().doubleValue()));
 }
Example #4
0
 static string simFillTimeString(LiveOrders.LiveOrder o)
 {
     return(o.simFillTime() == null ? "" :  ymdHuman(date(o.simFillTime())));
 }
Example #5
0
 static string submittedTimeString(LiveOrders.LiveOrder o)
 {
     return(o.isFerret() ? ymdHuman(date(o.submittedTime())) : "");
 }
Example #6
0
 public static void onIncomingOrderResponse(LiveOrders.LiveOrder o, Action <Fields> action)
 {
     incomingResponses(o.submittedTime(), o.ferretOrderId()).subscribe(action);
 }