예제 #1
0
파일: DataClient.cs 프로젝트: hombrevrc/FDK
        internal virtual bool ProcessMessage(FxMessage message)
        {
            switch (message.Type)
            {
            case Native.FX_MSG_LOGON:
                this.RaiseLogon(message);
                break;

            case Native.FX_MSG_LOGOUT:
                this.RaiseLogout(message);
                break;

            case Native.FX_MSG_SESSION_INFO:
                this.RaiseSessionInfo(message);
                break;

            case Native.FX_MSG_CACHE_UPDATED:
                this.RaiseCacheUpdated(message);
                break;

            case Native.FX_MSG_TWO_FACTOR_AUTH:
                this.RaiseTwoFactorAuth(message);
                break;

            default:
                return(false);
            }

            return(true);
        }
예제 #2
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        internal override bool ProcessMessage(FxMessage message)
        {
            if (base.ProcessMessage(message))
            {
                return(true);
            }
            switch (message.Type)
            {
            case Native.FX_MSG_ACCOUNT_INFO:
                this.RaiseAccountInfo(message);
                break;

            case Native.FX_MSG_EXECUTION_REPORT:
                this.RaiseExecutionReport(message);
                break;

            case Native.FX_MSG_TRADE_TRANSACTION_REPORT:
                this.RaiseTradeTransactionReport(message);
                break;

            case Native.FX_MSG_POSITION_REPORT:
                this.RaisePositionReport(message);
                break;

            case Native.FX_MSG_NOTIFICATION:
                this.RaiseNotification(message);
                break;

            default:
                return(false);
            }

            return(true);
        }
예제 #3
0
 internal DataEventArgs(FxMessage message)
 {
     if (message.SendingTime.HasValue)
     {
         this.SendingTime = message.SendingTime;
     }
     this.ReceivingTime = message.ReceivingTime.Value;
 }
예제 #4
0
        void RaiseCurrencyInfo(FxMessage message)
        {
            var eh = this.CurrencyInfo;

            if (eh != null)
            {
                var e = new CurrencyInfoEventArgs(message);
                eh(this, e);
            }
        }
예제 #5
0
        void RaiseUnsubscribed(FxMessage message)
        {
            var eh = this.Unsubscribed;

            if (eh != null)
            {
                var e = new UnsubscribedEventArgs(message);
                eh(this, e);
            }
        }
예제 #6
0
        void RaiseSymbolInfo(FxMessage message)
        {
            var eh = this.SymbolInfo;

            if (eh != null)
            {
                var e = new SymbolInfoEventArgs(message, this.UsedProtocolVersion);
                eh(this, e);
            }
        }
예제 #7
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        void RaiseAccountInfo(FxMessage message)
        {
            var eh = this.AccountInfo;

            if (eh != null)
            {
                var e = new AccountInfoEventArgs(message);
                eh(this, e);
            }
        }
예제 #8
0
파일: DataClient.cs 프로젝트: hombrevrc/FDK
        void RaiseCacheUpdated(FxMessage message)
        {
            var eh = this.CacheInitialized;

            if (eh != null)
            {
                var e = new CacheEventArgs();
                eh(this, e);
            }
        }
예제 #9
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        void RaiseTradeTransactionReport(FxMessage message)
        {
            var eh = this.TradeTransactionReport;

            if (eh != null)
            {
                var e = new TradeTransactionReportEventArgs(message);
                eh(this, e);
            }
        }
예제 #10
0
파일: DataClient.cs 프로젝트: hombrevrc/FDK
        void RaiseLogout(FxMessage message)
        {
            var eh = this.Logout;

            if (eh != null)
            {
                var e = new LogoutEventArgs(message);
                eh(this, e);
            }
        }
예제 #11
0
파일: DataClient.cs 프로젝트: hombrevrc/FDK
        void RaiseTwoFactorAuth(FxMessage message)
        {
            var eh = this.TwoFactorAuth;

            if (eh != null)
            {
                var e = new TwoFactorAuthEventArgs(message);
                eh(this, e);
            }
        }
예제 #12
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        void RaisePositionReport(FxMessage message)
        {
            var eh = this.PositionReport;

            if (eh != null)
            {
                var e = new PositionReportEventArgs(message);
                eh(this, e);
            }
        }
예제 #13
0
파일: DataClient.cs 프로젝트: hombrevrc/FDK
        void RaiseSessionInfo(FxMessage message)
        {
            var eh = this.SessionInfo;

            if (eh != null)
            {
                var e = new SessionInfoEventArgs(message);
                eh(this, e);
            }
        }
예제 #14
0
        internal unsafe LogoutEventArgs(FxMessage message) : base(message)
        {
            string       text;
            LogoutReason reason;
            int          code;

            message.GetLogoutInfo(out text, out reason, out code);

            this.Text   = text;
            this.Reason = reason;
            this.Code   = code;
        }
예제 #15
0
        void RaiseTick(FxMessage message)
        {
#if LOG_PERFORMANCE
            ulong  timestamp = loggerOut_.GetTimestamp();
            string id        = message.Quote().Id;
            loggerOut_.LogTimestamp(id, timestamp, "Tick");
#endif
            var eh = this.Tick;
            if (eh != null)
            {
                var e = new TickEventArgs(message);
                eh(this, e);
            }
        }
예제 #16
0
파일: DataClient.cs 프로젝트: hombrevrc/FDK
        void SafeProcessMessage(FxMessage message)
        {
#if !DEBUG
            try
            {
#endif
            this.ProcessMessage(message);
#if !DEBUG
        }
        catch
        {
        }
#endif
            this.handle.DispatchMessage(message);
        }
예제 #17
0
        internal override bool ProcessMessage(FxMessage message)
        {
            if (base.ProcessMessage(message))
            {
                return(true);
            }
            switch (message.Type)
            {
            case Native.FX_MSG_SUBSCRIBED:
                this.RaiseSubscribed(message);
                this.RaiseTick(message);
                break;

            case Native.FX_MSG_UNSUBSCRIBED:
                this.RaiseUnsubscribed(message);
                break;

            case Native.FX_MSG_TICK:
                this.RaiseTick(message);
                break;

            case Native.FX_MSG_SYMBOL_INFO:
                this.RaiseSymbolInfo(message);
                break;

            case Native.FX_MSG_NOTIFICATION:
                var notification = message.Notification();
                if (notification.Type == NotificationType.ConfigUpdated)
                {
                    var e = new NotificationEventArgs(notification);
                    this.RaiseNotification(e);
                }
                else
                {
                    return(false);
                }
                break;

            case Native.FX_MSG_CURRENCY_INFO:
                this.RaiseCurrencyInfo(message);
                break;

            default:
                return(false);
            }

            return(true);
        }
예제 #18
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        void RaiseExecutionReport(FxMessage message)
        {
#if LOG_PERFORMANCE
            if (message.ExecutionReport().ExecutionType == ExecutionType.Trade)
            {
                ulong  timestamp = loggerOut_.GetTimestamp();
                string id        = message.ExecutionReport().ClientOrderId;
                loggerOut_.LogTimestamp(id, timestamp, "ExecReport");
            }
#endif
            var eh = this.ExecutionReport;
            if (eh != null)
            {
                var e = new ExecutionReportEventArgs(message);
                eh(this, e);
            }
        }
예제 #19
0
파일: DataTrade.cs 프로젝트: hombrevrc/FDK
        unsafe void RaiseNotification(FxMessage message)
        {
            var notification = message.Notification();

            if (notification.Type == NotificationType.Balance)
            {
                var e = new NotificationEventArgs <BalanceOperation>(notification)
                {
                    Data = new BalanceOperation(notification)
                };

                this.RaiseBalanceOperationNotification(e);
            }
            else
            {
                var e = new NotificationEventArgs(notification);
                this.RaiseNotification(e);
            }
        }
예제 #20
0
        internal unsafe SymbolInfoEventArgs(FxMessage message, string usedProtocolVersion)
        {
            var protocolVersion = new FixProtocolVersion(usedProtocolVersion);

            this.Information = message.Symbols(protocolVersion);
        }
예제 #21
0
 internal unsafe ExecutionReportEventArgs(FxMessage message)
 {
     this.Report = message.ExecutionReport();
 }
예제 #22
0
 internal SubscribedEventArgs(FxMessage message)
     : base(message)
 {
     this.Tick = message.Quote();
 }
예제 #23
0
 internal unsafe CurrencyInfoEventArgs(FxMessage message)
 {
     this.Information = message.Currencies();
 }
 internal unsafe TradeTransactionReportEventArgs(FxMessage message)
 {
     this.Report = message.TradeTransactionReport();
 }
예제 #25
0
 internal unsafe LogonEventArgs(FxMessage message)
     : base(message)
 {
     this.ProtocolVersion = message.ProtocolVersion();
 }
예제 #26
0
 internal unsafe AccountInfoEventArgs(FxMessage message)
 {
     this.Information = message.AccountInfo();
 }
예제 #27
0
 internal UnsubscribedEventArgs(FxMessage message)
     : base(message)
 {
     this.Symbol = message.Symbol();
 }
예제 #28
0
 internal unsafe PositionReportEventArgs(FxMessage message)
 {
     this.Report = message.Position();
 }
예제 #29
0
 internal TwoFactorAuthEventArgs(FxMessage message) : base(message)
 {
     this.TwoFactorAuth = message.TwoFactorAuth();
 }
예제 #30
0
 internal TickEventArgs(FxMessage message)
     : base(message)
 {
     this.Tick = message.Quote();
 }