Пример #1
0
		protected BarFactoryItem(Instrument instrument, BarType barType, long barSize)
		{
			this.factory = null;
			this.instrument = instrument;
			this.barType = barType;
			this.barSize = barSize;
		}
Пример #2
0
 protected BarFactoryItem(Instrument instrument, BarType barType, long barSize)
 {
     this.factory    = null;
     this.instrument = instrument;
     this.barType    = barType;
     this.barSize    = barSize;
 }
Пример #3
0
        public QBProvider()
        {
            timerConnect.Elapsed += new System.Timers.ElapsedEventHandler(timerConnect_Elapsed);
            timerAccount.Elapsed += new System.Timers.ElapsedEventHandler(timerAccount_Elapsed);
            timerPonstion.Elapsed += new System.Timers.ElapsedEventHandler(timerPonstion_Elapsed);

            InitCallbacks();
            InitSettings();

            BarFactory = new BarFactory();
            status = ProviderStatus.Unknown;
            ProviderManager.Add(this);
        }
Пример #4
0
 public EventManager(Framework framework, EventBus bus)
 {
     this.framework    = framework;
     this.bus          = bus;
     this.factory      = new BarFactory(framework);
     this.dispatcher   = new EventDispatcher(framework);
     this.handler[107] = new EventManager.OnEventHandler(this.OnSimulatorStart);
     this.handler[108] = new EventManager.OnEventHandler(this.OnSimulatorStop);
     this.handler[109] = new EventManager.OnEventHandler(this.OnSimulatorProgress);
     this.handler[2]   = new EventManager.OnEventHandler(this.OnBid);
     this.handler[3]   = new EventManager.OnEventHandler(this.OnAsk);
     this.handler[4]   = new EventManager.OnEventHandler(this.OnTrade);
     this.handler[6]   = new EventManager.OnEventHandler(this.OnBar);
     this.handler[8]   = new EventManager.OnEventHandler(this.OnLevel2Snapshot);
     this.handler[9]   = new EventManager.OnEventHandler(this.OnLevel2Update);
     this.handler[23]  = new EventManager.OnEventHandler(this.OnNews);
     this.handler[22]  = new EventManager.OnEventHandler(this.OnFundamental);
     this.handler[13]  = new EventManager.OnEventHandler(this.OnExecutionReport);
     this.handler[116] = new EventManager.OnEventHandler(this.OnOrderStatusChanged);
     this.handler[117] = new EventManager.OnEventHandler(this.OnOrderPartiallyFilled);
     this.handler[118] = new EventManager.OnEventHandler(this.OnOrderFilled);
     this.handler[119] = new EventManager.OnEventHandler(this.OnOrderReplaced);
     this.handler[120] = new EventManager.OnEventHandler(this.OnOrderCancelled);
     this.handler[121] = new EventManager.OnEventHandler(this.OnOrderDone);
     this.handler[113] = new EventManager.OnEventHandler(this.OnFill);
     this.handler[110] = new EventManager.OnEventHandler(this.OnPositionOpened);
     this.handler[111] = new EventManager.OnEventHandler(this.OnPositionClosed);
     this.handler[112] = new EventManager.OnEventHandler(this.OnPositionChanged);
     this.handler[15]  = new EventManager.OnEventHandler(this.OnReminder);
     this.handler[50]  = new EventManager.OnEventHandler(this.OnGroup);
     this.handler[52]  = new EventManager.OnEventHandler(this.OnGroupEvent);
     this.handler[130] = new EventManager.OnEventHandler(this.OnHistoricalData);
     this.handler[131] = new EventManager.OnEventHandler(this.OnHistoricalDataEnd);
     this.handler[140] = new EventManager.OnEventHandler(this.OnAccountData);
     if (bus != null)
     {
         this.thread              = new Thread(new ThreadStart(this.ThreadRun));
         this.thread.Name         = "Event Manager Thread";
         this.thread.IsBackground = true;
         this.thread.Start();
     }
 }
Пример #5
0
		public EventManager(Framework framework, EventBus bus)
		{
			this.framework = framework;
			this.bus = bus;
			this.factory = new BarFactory(framework);
			this.dispatcher = new EventDispatcher(framework);
			this.handler[107] = new EventManager.OnEventHandler(this.OnSimulatorStart);
			this.handler[108] = new EventManager.OnEventHandler(this.OnSimulatorStop);
			this.handler[109] = new EventManager.OnEventHandler(this.OnSimulatorProgress);
			this.handler[2] = new EventManager.OnEventHandler(this.OnBid);
			this.handler[3] = new EventManager.OnEventHandler(this.OnAsk);
			this.handler[4] = new EventManager.OnEventHandler(this.OnTrade);
			this.handler[6] = new EventManager.OnEventHandler(this.OnBar);
			this.handler[8] = new EventManager.OnEventHandler(this.OnLevel2Snapshot);
			this.handler[9] = new EventManager.OnEventHandler(this.OnLevel2Update);
			this.handler[23] = new EventManager.OnEventHandler(this.OnNews);
			this.handler[22] = new EventManager.OnEventHandler(this.OnFundamental);
			this.handler[13] = new EventManager.OnEventHandler(this.OnExecutionReport);
			this.handler[116] = new EventManager.OnEventHandler(this.OnOrderStatusChanged);
			this.handler[117] = new EventManager.OnEventHandler(this.OnOrderPartiallyFilled);
			this.handler[118] = new EventManager.OnEventHandler(this.OnOrderFilled);
			this.handler[119] = new EventManager.OnEventHandler(this.OnOrderReplaced);
			this.handler[120] = new EventManager.OnEventHandler(this.OnOrderCancelled);
			this.handler[121] = new EventManager.OnEventHandler(this.OnOrderDone);
			this.handler[113] = new EventManager.OnEventHandler(this.OnFill);
			this.handler[110] = new EventManager.OnEventHandler(this.OnPositionOpened);
			this.handler[111] = new EventManager.OnEventHandler(this.OnPositionClosed);
			this.handler[112] = new EventManager.OnEventHandler(this.OnPositionChanged);
			this.handler[15] = new EventManager.OnEventHandler(this.OnReminder);
			this.handler[50] = new EventManager.OnEventHandler(this.OnGroup);
			this.handler[52] = new EventManager.OnEventHandler(this.OnGroupEvent);
			this.handler[130] = new EventManager.OnEventHandler(this.OnHistoricalData);
			this.handler[131] = new EventManager.OnEventHandler(this.OnHistoricalDataEnd);
			this.handler[140] = new EventManager.OnEventHandler(this.OnAccountData);
			if (bus != null)
			{
				this.thread = new Thread(new ThreadStart(this.ThreadRun));
				this.thread.Name = "Event Manager Thread";
				this.thread.IsBackground = true;
				this.thread.Start();
			}
		}