Exemple #1
0
            public override bool Evaluate(DataSet dataSet)
            {
                this.parent.log("Evaluating RouteFillOccurred...");

                EMSXFieldDataPointSource      routeFilledSource     = (EMSXFieldDataPointSource)dataSet.GetDataPoint("RouteFilled").GetSource();
                EMSXFieldDataPointSource      routeLastSharesSource = (EMSXFieldDataPointSource)dataSet.GetDataPoint("RouteLastShares").GetSource();
                EMSXFieldDataPointSource      routeStatusSource     = (EMSXFieldDataPointSource)dataSet.GetDataPoint("RouteStatus").GetSource();
                GenericIntegerDataPointSource lastfill = (GenericIntegerDataPointSource)dataSet.GetDataPoint("LastFillShown").GetSource();

                int currentFilled  = Convert.ToInt32(routeFilledSource.GetValue());
                int previousFilled = Convert.ToInt32(routeFilledSource.GetPreviousValue());

                int currentLastShares  = Convert.ToInt32(routeLastSharesSource.GetValue());
                int previousLastShares = Convert.ToInt32(routeLastSharesSource.GetPreviousValue());

                String currentStatus  = Convert.ToString(routeStatusSource.GetValue());
                String previousStatus = Convert.ToString(routeStatusSource.GetPreviousValue());

                int lastFillShown = Convert.ToInt32(dataSet.GetDataPoint("LastFillShown").GetValue());

                this.parent.log("RouteFillOccurred DataSet values : currentFilled=" + currentFilled + "|previousFilled=" + previousFilled + "|currentLastShares=" + currentLastShares + "|previousLastShares=" + previousLastShares + "|currentStatus=" + currentStatus + "|previousStatus=" + previousStatus);

                bool res = ((currentFilled != previousFilled) && previousStatus != null && currentFilled != lastFillShown);

                this.parent.log("RouteFillOccurred returning value: " + res);

                return(res);
            }
Exemple #2
0
            public override bool Evaluate(DataSet dataSet)
            {
                EMSXFieldDataPointSource idleSource = (EMSXFieldDataPointSource)dataSet.GetDataPoint("OrderIdleAmount").GetSource();
                int idleAmount = Convert.ToInt32(idleSource.GetValue());

                bool res = (idleAmount > 0);

                log("Evaluating HasIdleShares on DataSet: " + dataSet.GetName() + "  result=" + res.ToString());

                return(res);
            }
Exemple #3
0
            public override bool Evaluate(DataSet dataSet)
            {
                IOIFieldDataPointSource  ioiTickerSource   = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioiticker").GetSource();
                EMSXFieldDataPointSource orderTickerSource = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderTicker").GetSource();

                String ioiTicker   = ioiTickerSource.GetValue().ToString() + " Equity";
                String orderTicker = orderTickerSource.GetValue().ToString();

                bool res = (ioiTicker == orderTicker);

                log("Evaluating MatchingTicker for DataSet: " + dataSet.GetName() + " - IOITicker: " + ioiTicker + " - OrderTicker: " + orderTicker + " - result=" + res.ToString());

                return(res);
            }
Exemple #4
0
            public void Execute(DataSet dataSet)
            {
                IOIFieldDataPointSource offerQtySource  = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioiofferquantity").GetSource();
                IOIFieldDataPointSource bidQtySource    = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioibidquantity").GetSource();
                IOIFieldDataPointSource brokerSource    = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioibidquantity").GetSource();
                IOIFieldDataPointSource ioiBrokerSource = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioiroutingbroker").GetSource();

                EMSXFieldDataPointSource orderNumberSource     = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderNumber").GetSource();
                EMSXFieldDataPointSource orderSideSource       = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderSide").GetSource();
                EMSXFieldDataPointSource orderIdleAmountSource = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderIdleAmount").GetSource();
                EMSXFieldDataPointSource orderTickerSource     = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderTicker").GetSource();

                Request req = this.op.emsx.createRequest("RouteEx");

                req.Set("EMSX_SEQUENCE", Convert.ToInt32(orderNumberSource.GetValue()));

                String orderSide = orderSideSource.GetValue().ToString();
                int    qty;

                if (orderSide == "BUY")
                {
                    qty = Convert.ToInt32(offerQtySource.GetValue());
                }
                else
                {
                    qty = Convert.ToInt32(bidQtySource.GetValue());
                }

                req.Set("EMSX_AMOUNT", qty);
                //req.Set("EMSX_BROKER", ioiBrokerSource.GetValue().ToString());
                req.Set("EMSX_BROKER", "BB");
                req.Set("EMSX_HAND_INSTRUCTION", "ANY");
                req.Set("EMSX_ORDER_TYPE", "MKT");
                req.Set("EMSX_TICKER", orderTickerSource.GetValue().ToString());
                req.Set("EMSX_TIF", "DAY");

                log("Sending request: " + req.ToString());

                this.op.emsx.sendRequest(req, this);

                log("Purging all related conflict datasets.");

                this.op.PurgeConflictDataSets(dataSet);
            }
Exemple #5
0
            public override bool Evaluate(DataSet dataSet)
            {
                IOIFieldDataPointSource  offerQtySource        = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioiofferquantity").GetSource();
                IOIFieldDataPointSource  bidQtySource          = (IOIFieldDataPointSource)dataSet.GetDataPoint("ioibidquantity").GetSource();
                EMSXFieldDataPointSource orderSideSource       = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderSide").GetSource();
                EMSXFieldDataPointSource orderIdleAmountSource = (EMSXFieldDataPointSource)dataSet.GetDataPoint("orderIdleAmount").GetSource();

                String orderSide       = orderSideSource.GetValue().ToString();
                int    orderIdleAmount = Convert.ToInt32(orderIdleAmountSource.GetValue());

                int bidQty;

                try
                {
                    bidQty = Convert.ToInt32(bidQtySource.GetValue());
                }
                catch
                {
                    bidQty = 0;
                }

                int offerQty;

                try
                {
                    offerQty = Convert.ToInt32(offerQtySource.GetValue());
                }
                catch
                {
                    offerQty = 0;
                }

                bool res = ((bidQty > 0 && bidQty < orderIdleAmount && orderSide == "SELL") || (offerQty > 0 && offerQty < orderIdleAmount && orderSide == "BUY"));

                log("Evaluating MatchingSideAndAmount for DataSet: " + dataSet.GetName() + " - orderSide=" + orderSide + " orderIdleAmount=" + orderIdleAmount + " bidQty=" + bidQty + " offerQty=" + offerQty + " - result=" + res.ToString());

                return(res);
            }