public QREBridge(SystemArguments arguments, string topicPrefix) { arguments_ = arguments; if (arguments.runMode() == RunMode.LIVE) { liveSystem = arguments.liveSystem(); monitor_ = new LiveTradeMonitor(liveSystem, arguments.symbols, topicPrefix); } else { liveSystem = null; monitor_ = new TradeMonitor(); } each(arguments.symbols, symbol => bars_[symbol] = new BarSpud(manager)); system = System.create <S>(this); interval_ = arguments.interval(); if (!arguments.runInNativeCurrency) { fxRates = new LazyDictionary <Symbol, SymbolSpud <Bar> >(symbol => symbol.fxRateSymbol().bars(bars(symbol)).allowStaleTicks() ); } statistics_ = new StatisticsManager(system, arguments); arguments.logSystemCreation(); }
public void logSystemCreation(SystemArguments arguments) { if (has("systemId")) { LogC.consoleOut("running id(" + get <int>("systemId") + "), system(" + arguments.siv().system() + ")"); } else { LogC.consoleOut("running in research mode(" + systemClassName() + ")"); } if (reDebug()) { LogC.consoleOut("in DEBUG mode (slow)"); } if (isLive()) { LogC.consoleOut("PV = " + pvName()); } else if (isSTO()) { LogC.consoleOut("STO = " + paren(commaSep(stoDir(), stoId(), runNumber()))); } else { logParameters(); } }
public override void addCollectorsTo(SystemArguments arguments, Dictionary <Collectible, StatisticsCollector> collectors) { collectors[this] = new StatisticsCollector(arguments); }
protected PairGenerator(SystemArguments arguments) { this.arguments = arguments; }
public static T create <T>(Type type, SystemArguments arguments) { var c = type.GetConstructor(new[] { typeof(SystemArguments) }); return((T)c.Invoke(new object[] { arguments })); }
public QREBridge(SystemArguments arguments) : this(arguments, OrderTable.prefix) { }
public override void addCollectorsTo(SystemArguments arguments, Dictionary <Collectible, StatisticsCollector> collectors) { forSystems((key, componentSystem) => componentSystem.addCollectorsTo(componentSystem.arguments(), collectors)); }