예제 #1
0
        public static void sendNewStopOrder2Transaq(NewStopOrder stopOrder)
        {
            StringWriter stream = new StringWriter();
            XmlWriter    writer = XmlWriter.Create(stream, settingsXmlWriter);

            serializer4newStopOrders.Serialize(writer, stopOrder, emptyNamespaces);

            string cmd = stream.ToString();
            string res = TXmlConnector.ConnectorSendCommand(cmd);
        }
예제 #2
0
        public static void processOrder(Order order)
        {
            switch (order.status)
            {
            case "matched":
                Position monitoredPosition = monitoredPositions.Find(p => p.transactionid == order.transactionid);
                if (monitoredPosition != null && monitoredPosition.stopOrderRequested == false)
                {
                    monitoredPosition.stopOrderRequested = true;
                    monitoredPosition.orderno            = order.orderno;
                    monitoredPosition.secid = order.secid;
                    NewStopOrder stopOrder = new NewStopOrder(monitoredPosition);
                    sendNewStopOrder2Transaq(stopOrder);
                }
                monitoredPositions.RemoveAll(o => o.transactionid == order.transactionid);
                break;

            case "none":
            case "active":
            case "forwarding":
            case "inactive":
            case "wait":
            case "watching":
                if (!monitoredOrders.Exists(o => o.transactionid == order.transactionid))
                {
                    monitoredOrders.Add(order);
                }
                break;

            case "cancelled":
            case "denied":
            case "disabled":
            case "expired":
            case "failed":
            case "refused":
            case "removed":
            case "rejected":
                monitoredOrders.RemoveAll(o => o.transactionid == order.transactionid);
                break;

            default:
                break;
            }
        }