Esempio n. 1
0
        public virtual void SubscribeAccountInfo(AccountInfoEventArgs accountInfoEventArgs)
        {
            if (accountInfoEventArgs == null)
            {
                throw new ArgumentNullException(nameof(accountInfoEventArgs));
            }

            lock (AccountLock)
            {
                AccountInfo  = accountInfoEventArgs.AccountInfo.Clone();
                PlacingOrder = false;

                if (Strategy == null)
                {
                    return;
                }

                var strategyNotification = new StrategyNotification {
                    Name = Strategy.Name, Message = $"Update {Strategy.Name} performance.", NotificationLevel = NotificationLevel.Account
                };

                StrategyAccountInfoNotification(new StrategyNotificationEventArgs {
                    StrategyNotification = strategyNotification
                });
            }
        }
Esempio n. 2
0
 void OnAccountInfo(object sender, AccountInfoEventArgs e)
 {
     lock (this.synchronizer)
     {
         this.AccountInfo = e.Information;
     }
     this.syncEvent.Set();
 }
Esempio n. 3
0
 void OnAccountInfo(object sender, AccountInfoEventArgs e)
 {
     lock (this.SyncRoot)
     {
         this.updateCallback(null, null, e.Information, null);
         this.processor.WakeUp();
     }
 }
Esempio n. 4
0
        void OnAccountInfo(object sender, AccountInfoEventArgs e)
        {
            var trade = (DataTrade)sender;

            trade.AccountInfo -= this.OnAccountInfo;
            this.eventArgs     = e;
            this.syncEvent.Set();
        }
Esempio n. 5
0
        void RaiseAccountInfo(FxMessage message)
        {
            var eh = this.AccountInfo;

            if (eh != null)
            {
                var e = new AccountInfoEventArgs(message);
                eh(this, e);
            }
        }
Esempio n. 6
0
        public virtual void SubscribeAccountInfo(AccountInfoEventArgs accountInfoEventArgs)
        {
            lock (accountLock)
            {
                accountInfo  = accountInfoEventArgs.AccountInfo.Clone();
                placingOrder = false;

                if (Strategy == null)
                {
                    return;
                }

                var strategyNotification = new StrategyNotification {
                    Name = Strategy.Name, Message = "Update strategy performance.", NotificationLevel = NotificationLevel.Account
                };

                StrategyAccountInfoNotification(new StrategyNotificationEventArgs {
                    StrategyNotification = strategyNotification
                });
            }
        }
Esempio n. 7
0
 void DataTrade_AccountInfo(object sender, AccountInfoEventArgs e)
 {
     this.accountInfoEvent.Set();
 }
Esempio n. 8
0
 static void OnAccountInfo(object sender, AccountInfoEventArgs e)
 {
     Console.WriteLine("OnAccountInfo(): {0}", e.Information);
     Console.WriteLine("Press any key to exit...");
 }
Esempio n. 9
0
 private void OnAccountInfo(object sender, AccountInfoEventArgs e)
 {
     TradeResults = new AccountTradeResults(e.Information.AccountId, _ordersPerSec);
     TradeIsReady.Set();
 }
Esempio n. 10
0
 private void OnAccountInfo(object sender, AccountInfoEventArgs e)
 {
     Console.WriteLine("OnAccountInfo(): {0}", e.Information);
     _account = e.Information;
     TradeIsReady.Set();
 }
Esempio n. 11
0
 public void SubscribeAccountInfo(AccountInfoEventArgs accountInfoEventArgs)
 {
     throw new NotImplementedException();
 }
Esempio n. 12
0
 void OnAccountInfo(object sender, AccountInfoEventArgs e)
 {
     Console.WriteLine("OnAccountInfo(): {0}", e);
 }