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); }
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); }
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); }