public ProviderSimulatorSupport(string mode, ProjectProperties projectProperties, Type fixSimulatorType, Type quoteSimulatorType) { this.mode = mode; partialFillSimulation = projectProperties.Simulator.PartialFillSimulation; this.endTime = projectProperties.Starter.EndTime; fixSimulator = (FIXSimulatorSupport)Factory.Parallel.SpawnPerformer(fixSimulatorType, mode, projectProperties, this); quotesSimulator = (QuoteSimulatorSupport)Factory.Parallel.SpawnPerformer(quoteSimulatorType, mode, projectProperties, this); }
public SimulateSymbolPlayback(FIXSimulatorSupport fixSimulatorSupport, QuoteSimulatorSupport quoteSimulatorSupport, string symbolString, Action <Message, SymbolInfo, Tick> onTick, Action <PhysicalFill, CreateOrChangeOrder> onPhysicalFill, Action <CreateOrChangeOrder, string> onRejectOrder) { log.Register(this); this.fixSimulatorSupport = fixSimulatorSupport; this.quoteSimulatorSupport = quoteSimulatorSupport; this.onTick = onTick; this.symbol = Factory.Symbol.LookupSymbol(symbolString); reader = Factory.TickUtil.TickFile(); this.symbolString = symbolString; reader.Initialize("Test\\MockProviderData", symbolString, TickFileMode.Read); fillSimulator = Factory.Utility.FillSimulator("FIX", Symbol, false, true, null); fillSimulator.EnableSyncTicks = SyncTicks.Enabled; FillSimulator.OnPhysicalFill = onPhysicalFill; FillSimulator.OnRejectOrder = onRejectOrder; }
public SimulateSymbolSyncTicks(FIXSimulatorSupport fixSimulatorSupport, QuoteSimulatorSupport quoteSimulatorSupport, string symbolString, PartialFillSimulation partialFillSimulation, TimeStamp endTime, long id) { log.Register(this); this.id = id; this.fixSimulatorSupport = fixSimulatorSupport; this.quoteSimulatorSupport = quoteSimulatorSupport; this.onTick = quoteSimulatorSupport.OnTick; this.onEndTick = quoteSimulatorSupport.OnEndTick; this.PartialFillSimulation = partialFillSimulation; this.symbolString = symbolString; this.symbol = Factory.Symbol.LookupSymbol(symbolString); fillSimulator = Factory.Utility.FillSimulator("FIX", Symbol, false, true, null); fillSimulator.EnableSyncTicks = SyncTicks.Enabled; FillSimulator.OnPhysicalFill = fixSimulatorSupport.OnPhysicalFill; FillSimulator.OnRejectOrder = fixSimulatorSupport.OnRejectOrder; fillSimulator.PartialFillSimulation = partialFillSimulation; tickSync = SyncTicks.GetTickSync(Symbol.BinaryIdentifier); latency = new LatencyMetric("SimulateSymbolSyncTicks-" + symbolString.StripInvalidPathChars()); diagnoseMetric = Diagnose.RegisterMetric("Simulator"); if (debug) { log.Debug("Opening tick file for reading."); } reader = Factory.TickUtil.TickFile(); try { reader.Initialize("Test\\MockProviderData", symbolString, TickFileMode.Read); reader.EndTime = endTime; } catch (FileNotFoundException ex) { log.Info("File for symbol " + symbolString + " not found: " + ex.Message); } }