private void OnRspSubMarketData(object sender, CtpSpecificInstrument response, CtpRspInfo info, int requestId, bool last)
 {
     if (response == null)
     {
         return;
     }
     _spi.ProcessLog(new LogField(LogLevel.Debug, $"Ctpse subscribe {response.InstrumentID}"));
 }
Exemple #2
0
        private void DoLogin()
        {
            var info = new CtpReqUserLogin();

            info.BrokerID        = Server.BrokerID;
            info.UserProductInfo = Server.UserProductInfo;
            info.UserID          = User.UserID;
            info.Password        = User.Password;
            if (!Connected)
            {
                _publisher.Post(ConnectionStatus.Logining);
            }
            else
            {
                spi.ProcessLog(new LogField(LogLevel.Debug, $"Ctpse trader({User.UserID}) login"));
            }

            api.ReqUserLogin(info, GetNextRequestId());
        }
        private void ProcessLog(ref ResponseData data)
        {
            var field = PInvokeUtility.PtrToStruct <InternalLogField>(data.Ptr1);

            _spi.ProcessLog(new LogField(field));
        }