Esempio n. 1
0
        // **********************************************************************
        // *                               Сделки                               *
        // **********************************************************************

        void TradeStatusCallback(
            int nMode,
            double trade_id,
            double order_id,
            string classCode,
            string secCode,
            double price,
            int quantity,
            double msum,
            int isSell,
            int tradeDescriptor)
        {
            if (nMode == 0)
            {
                if (isSell != 0)
                {
                    quantity = -quantity;
                }

                string comment = Marshal.PtrToStringAnsi(Trans2Quik.TRADE_BROKERREF(tradeDescriptor));

                if ((comment.EndsWith(cfg.FullProgName) || cfg.u.AcceptAllTrades))
                {
                    mgr.PutOwnTrade(new OwnTrade(Price.GetInt(price), quantity));
                }
            }
        }