public void OnEvent(Event e) { if (this.queue != null) { this.queue.Enqueue(e); return; } this.OnEvent_(e); }
public GroupEvent(Event obj, Group group) { this.Obj = obj; this.Group = group; if (group != null) { this.GroupId = group.Id; return; } this.GroupId = -1; }
public override void OnEvent(Event e) { if (e != null && e.TypeId != 2 && e.TypeId != 3 && e.TypeId != 4 && e.TypeId != 6) { Console.WriteLine(string.Concat(new object[] { "Event ", e.TypeId, " ", e.GetType() })); } }
public override void OnEvent(Event e) { if (this.filter[(int)e.TypeId]) { if (e.dateTime < this.dateTime) { Console.WriteLine(string.Concat(new object[] { "!", e, " = ", e.dateTime, " <> ", this.dateTime })); return; } this.dateTime = e.dateTime; this.series.Add((DataObject)e); } }
private void OnGroupEvent(Event e) { this.framework.groupManager.OnGroupEvent((GroupEvent)e); }
private void OnPositionChanged(Event e) { OnPositionChanged onPositionChanged = (OnPositionChanged)e; this.framework.strategyManager.OnPositionChanged(onPositionChanged.portfolio, onPositionChanged.position); }
private void OnOrderDone(Event e) { this.framework.strategyManager.OnOrderDone(((OnOrderDone)e).order); }
private void OnOrderPartiallyFilled(Event e) { this.framework.strategyManager.OnOrderPartiallyFilled(((OnOrderPartiallyFilled)e).order); }
private void OnAccountData(Event e) { AccountData data = (AccountData)e; this.framework.accountDataManager.OnAccountData(data); }
private void OnNews(Event e) { this.data_count += 1L; News news = (News)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = news.dateTime; } else { news.dateTime = this.framework.clock.DateTime; } this.framework.dataManager.OnNews(news); this.framework.strategyManager.OnNews(news); }
private void OnSimulatorStart(Event e) { OnSimulatorStart arg_06_0 = (OnSimulatorStart)e; if (this.bus != null) { this.bus.ResetCounts(); } this.count = 0L; this.data_count = 0L; this.watch.Reset(); this.watch.Start(); }
public void OnEvent(Event e) { if (this.status == EventManagerStatus.Paused && this.step_enabled && (this.step_typeId == 0 || this.step_typeId == e.TypeId)) { Console.WriteLine(DateTime.Now + " Event : " + e); this.step_enabled = false; } this.count += 1L; if (this.filter != null && this.filter.Filter(e) == null) { return; } if (this.handler[(int)e.TypeId] != null) { this.handler[(int)e.TypeId](e); } if (this.dispatcher != null) { this.dispatcher.OnEvent(e); } if (this.logger != null) { this.logger.OnEvent(e); } }
private void OnEvent_(Event e) { byte typeId = e.TypeId; if (typeId <= 21) { switch (typeId) { case 2: if (this.Bid != null) { this.Bid(this, (Bid)e); return; } break; case 3: if (this.Ask != null) { this.Ask(this, (Ask)e); return; } break; case 4: if (this.Trade != null) { this.Trade(this, (Trade)e); return; } break; case 5: break; case 6: if (this.Bar != null) { this.Bar(this, (Bar)e); return; } break; default: switch (typeId) { case 13: if (this.ExecutionReport != null) { this.ExecutionReport(this, (ExecutionReport)e); return; } break; case 14: if (this.ExecutionCommand != null) { this.ExecutionCommand(this, (ExecutionCommand)e); return; } break; default: if (typeId != 21) { return; } if (this.ProviderError != null) { this.ProviderError(this, new ProviderErrorEventArgs((ProviderError)e)); return; } break; } break; } } else { switch (typeId) { case 50: if (this.NewGroup != null) { this.NewGroup(this, new GroupEventAgrs((Group)e)); return; } break; case 51: if (this.NewGroupUpdate != null) { this.NewGroupUpdate(this, new GroupUpdateEventAgrs((GroupUpdate)e)); return; } break; case 52: if (this.NewGroupEvent != null) { this.NewGroupEvent(this, new GroupEventEventAgrs((GroupEvent)e)); return; } break; default: switch (typeId) { case 99: if (this.FrameworkCleared != null) { this.FrameworkCleared(this, new FrameworkEventArgs(((OnFrameworkCleared)e).framework)); return; } break; case 100: if (this.InstrumentAdded != null) { this.InstrumentAdded(this, new InstrumentEventArgs(((OnInstrumentAdded)e).instrument)); return; } break; case 101: if (this.InstrumentDeleted != null) { this.InstrumentDeleted(this, new InstrumentEventArgs(((OnInstrumentDeleted)e).instrument)); return; } break; case 102: if (this.ProviderAdded != null) { this.ProviderAdded(this, new ProviderEventArgs(((OnProviderAdded)e).provider)); return; } break; case 103: if (this.ProviderRemoved != null) { this.ProviderRemoved(this, new ProviderEventArgs(((OnProviderRemoved)e).provider)); return; } break; case 104: if (this.ProviderConnected != null) { this.ProviderConnected(this, new ProviderEventArgs(((OnProviderConnected)e).provider)); return; } break; case 105: if (this.ProviderDisconnected != null) { this.ProviderDisconnected(this, new ProviderEventArgs(((OnProviderDisconnected)e).provider)); return; } break; case 106: if (this.ProviderStatusChanged != null) { this.ProviderStatusChanged(this, new ProviderEventArgs(((OnProviderStatusChanged)e).provider)); return; } break; case 107: case 114: case 115: case 116: case 117: case 118: case 119: case 120: case 121: case 125: case 126: case 132: case 133: case 134: case 135: case 136: case 137: case 138: case 139: break; case 108: if (this.SimulatorStop != null) { this.SimulatorStop(this, EventArgs.Empty); return; } break; case 109: if (this.SimulatorProgress != null) { this.SimulatorProgress(this, new SimulatorProgressEventArgs(((OnSimulatorProgress)e).count, ((OnSimulatorProgress)e).percent)); return; } break; case 110: if (this.PositionOpened != null) { this.PositionOpened(this, new PositionEventArgs(((OnPositionOpened)e).portfolio, ((OnPositionOpened)e).position)); return; } break; case 111: if (this.PositionClosed != null) { this.PositionClosed(this, new PositionEventArgs(((OnPositionClosed)e).portfolio, ((OnPositionClosed)e).position)); return; } break; case 112: if (this.PositionChanged != null) { this.PositionChanged(this, new PositionEventArgs(((OnPositionChanged)e).portfolio, ((OnPositionChanged)e).position)); return; } break; case 113: if (this.Fill != null) { this.Fill(this, (OnFill)e); return; } break; case 122: if (this.OrderManagerCleared != null) { this.OrderManagerCleared(this, (OnOrderManagerCleared)e); return; } break; case 123: if (this.InstrumentDefinition != null) { this.InstrumentDefinition(this, new InstrumentDefinitionEventArgs(((OnInstrumentDefinition)e).definition)); return; } break; case 124: if (this.InstrumentDefinitionEnd != null) { this.InstrumentDefinitionEnd(this, new InstrumentDefinitionEndEventArgs(((OnInstrumentDefinitionEnd)e).end)); return; } break; case 127: if (this.PortfolioAdded != null) { this.PortfolioAdded(this, new PortfolioEventArgs(((OnPortfolioAdded)e).portfolio)); return; } break; case 128: if (this.PortfolioDeleted != null) { this.PortfolioDeleted(this, new PortfolioEventArgs(((OnPortfolioDeleted)e).portfolio)); return; } break; case 129: if (this.PortfolioParentChanged != null) { this.PortfolioParentChanged(this, new PortfolioEventArgs(((OnPortfolioParentChanged)e).portfolio)); return; } break; case 130: if (this.HistoricalData != null) { this.HistoricalData(this, new HistoricalDataEventArgs((HistoricalData)e)); return; } break; case 131: if (this.HistoricalDataEnd != null) { this.HistoricalDataEnd(this, new HistoricalDataEndEventArgs((HistoricalDataEnd)e)); return; } break; case 140: if (this.AccountData != null) { this.AccountData(this, new AccountDataEventArgs((AccountData)e)); return; } break; default: switch (typeId) { case 207: if (this.EventManagerStarted != null) { this.EventManagerStarted(this, EventArgs.Empty); return; } break; case 208: if (this.EventManagerStopped != null) { this.EventManagerStopped(this, EventArgs.Empty); return; } break; case 209: if (this.EventManagerPaused != null) { this.EventManagerPaused(this, EventArgs.Empty); return; } break; case 210: if (this.EventManagerResumed != null) { this.EventManagerResumed(this, EventArgs.Empty); return; } break; case 211: if (this.EventManagerStep != null) { this.EventManagerStep(this, EventArgs.Empty); } break; default: return; } break; } break; } } }
internal GroupEvent(Event obj, int groupId) { this.Obj = obj; this.GroupId = groupId; }
public void OnEvent(Event e) { this.framework.eventManager.OnEvent(e); }
private void OnLevel2Update(Event e) { this.data_count += 1L; Level2Update level2Update = (Level2Update)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = level2Update.dateTime; } else { level2Update.dateTime = this.framework.Clock.DateTime; } this.framework.dataManager.OnLevel2Update(level2Update); this.framework.providerManager.executionSimulator.OnLevel2(level2Update); this.framework.StrategyManager.OnLevel2(level2Update); }
private void OnFundamental(Event e) { this.data_count += 1L; Fundamental fundamental = (Fundamental)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = fundamental.dateTime; } else { fundamental.dateTime = this.framework.clock.DateTime; } this.framework.dataManager.OnFundamental(fundamental); this.framework.strategyManager.OnFundamental(fundamental); }
private void OnSimulatorStop(Event e) { OnSimulatorStop arg_06_0 = (OnSimulatorStop)e; this.framework.strategyManager.Stop(); this.watch.Stop(); long elapsedMilliseconds = this.watch.ElapsedMilliseconds; if (elapsedMilliseconds != 0L) { Console.WriteLine(string.Concat(new object[] { DateTime.Now, " Data run done, count = ", this.data_count, " ms = ", this.watch.ElapsedMilliseconds, " event/sec = ", this.data_count / elapsedMilliseconds * 1000L })); } else { Console.WriteLine(string.Concat(new object[] { DateTime.Now, " Data run done, count = ", this.data_count, " ms = 0" })); } this.framework.Mode = FrameworkMode.Realtime; }
private void OnExecutionReport(Event e) { ExecutionReport executionReport = (ExecutionReport)e; if (this.framework.Clock.Mode == ClockMode.Realtime) { executionReport.dateTime = this.framework.Clock.DateTime; } this.framework.orderManager.OnExecutionReport(executionReport); this.framework.portfolioManager.OnExecutionReport(executionReport); this.framework.strategyManager.OnExecutionReport(executionReport); }
private void OnSimulatorProgress(Event e) { OnSimulatorProgress arg_06_0 = (OnSimulatorProgress)e; }
private void OnOrderStatusChanged(Event e) { this.framework.strategyManager.OnOrderStatusChanged(((OnOrderStatusChanged)e).order); }
private void OnBid(Event e) { this.data_count += 1L; Bid bid = (Bid)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = bid.dateTime; } else { bid.dateTime = this.framework.clock.DateTime; } this.factory.OnData(bid); this.framework.dataManager.OnBid(bid); this.framework.instrumentManager.GetById(bid.instrumentId).bid = bid; this.framework.providerManager.executionSimulator.OnBid(bid); this.framework.strategyManager.OnBid(bid); }
private void OnOrderCancelled(Event e) { this.framework.strategyManager.OnOrderCancelled(((OnOrderCancelled)e).order); }
private void OnAsk(Event e) { this.data_count += 1L; Ask ask = (Ask)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = ask.DateTime; } else { ask.dateTime = this.framework.clock.DateTime; } this.factory.OnData(ask); this.framework.dataManager.OnAsk(ask); this.framework.instrumentManager.GetById(ask.instrumentId).ask = ask; this.framework.providerManager.executionSimulator.OnAsk(ask); this.framework.strategyManager.OnAsk(ask); }
private void OnFill(Event e) { this.framework.strategyManager.OnFill((OnFill)e); }
private void OnTrade(Event e) { this.data_count += 1L; Trade trade = (Trade)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = trade.dateTime; } else { trade.dateTime = this.framework.clock.DateTime; } this.factory.OnData(trade); this.framework.dataManager.OnTrade(trade); this.framework.instrumentManager.GetById(trade.instrumentId).trade = trade; this.framework.providerManager.executionSimulator.OnTrade(trade); this.framework.strategyManager.OnTrade(trade); }
private void OnReminder(Event e) { if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = e.dateTime; } ((Reminder)e).Execute(); }
private void OnBar(Event e) { this.data_count += 1L; Bar bar = (Bar)e; this.framework.dataManager.OnBar(bar); this.framework.providerManager.executionSimulator.OnBar(bar); this.framework.strategyManager.OnBar(bar); }
private void OnHistoricalDataEnd(Event e) { this.framework.dataManager.OnHistoricalDataEnd((HistoricalDataEnd)e); }
private void OnLevel2Snapshot(Event e) { this.data_count += 1L; Level2Snapshot level2Snapshot = (Level2Snapshot)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = level2Snapshot.dateTime; } else { level2Snapshot.dateTime = this.framework.Clock.DateTime; } this.framework.dataManager.OnLevel2Snapshot(level2Snapshot); this.framework.providerManager.executionSimulator.OnLevel2(level2Snapshot); this.framework.strategyManager.OnLevel2(level2Snapshot); }