예제 #1
0
        // **********************************************************************

        void OrderStatusCallback(
            int nMode,
            int tid,
            double order_id,
            string classCode,
            string secCode,
            double price,
            int balance,
            double msum,
            int isSell,
            int status,
            int orderDescriptor)
        {
            if (nMode == 0)
            {
                int filled;

                if (isSell == 0)
                {
                    filled = Trans2Quik.ORDER_QTY(orderDescriptor) - balance;
                }
                else
                {
                    filled  = balance - Trans2Quik.ORDER_QTY(orderDescriptor);
                    balance = -balance;
                }

                if (status == 1)
                {
                    mgr.OrderUpdate((long)order_id, balance, filled);
                }
                else
                {
                    mgr.OrderUpdate((long)order_id, 0, filled);
                }
            }
        }