Beispiel #1
0
 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();
 }
Beispiel #2
0
 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();
     }
 }
Beispiel #3
0
 public override void addCollectorsTo(SystemArguments arguments, Dictionary <Collectible, StatisticsCollector> collectors)
 {
     collectors[this] = new StatisticsCollector(arguments);
 }
Beispiel #4
0
 protected PairGenerator(SystemArguments arguments)
 {
     this.arguments = arguments;
 }
Beispiel #5
0
        public static T create <T>(Type type, SystemArguments arguments)
        {
            var c = type.GetConstructor(new[] { typeof(SystemArguments) });

            return((T)c.Invoke(new object[] { arguments }));
        }
Beispiel #6
0
 public QREBridge(SystemArguments arguments) : this(arguments, OrderTable.prefix)
 {
 }
Beispiel #7
0
 public override void addCollectorsTo(SystemArguments arguments, Dictionary <Collectible, StatisticsCollector> collectors)
 {
     forSystems((key, componentSystem) => componentSystem.addCollectorsTo(componentSystem.arguments(), collectors));
 }