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;
 }
Пример #3
0
 public FIXServerSymbolHandler(FIXSimulatorSupport fixSimulatorSupport,
                               bool isPlayBack, string symbolString,
                               Func <Yield> onHeartbeat, Func <SymbolInfo, Tick, Yield> onTick,
                               Action <PhysicalFill, int, int, int> onPhysicalFill,
                               Action <PhysicalOrder, string> onRejectOrder)
 {
     this.fixSimulatorSupport = fixSimulatorSupport;
     this.isPlayBack          = isPlayBack;
     this.onHeartbeat         = onHeartbeat;
     this.onTick = onTick;
     this.symbol = Factory.Symbol.LookupSymbol(symbolString);
     reader      = Factory.TickUtil.TickReader();
     reader.Initialize("Test\\MockProviderData", symbolString);
     fillSimulator = Factory.Utility.FillSimulator("FIX", symbol, false);
     fillSimulator.OnPhysicalFill = onPhysicalFill;
     fillSimulator.OnRejectOrder  = onRejectOrder;
     tickSync = SyncTicks.GetTickSync(symbol.BinaryIdentifier);
     tickSync.ForceClear();
     queueTask     = Factory.Parallel.Loop("FIXServerSymbol-" + symbolString, OnException, ProcessQueue);
     firstHearbeat = true;
 }
Пример #4
0
 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);
     }
 }