Exemple #1
0
 void runSystem(Producer <SystemRunInfo> info, bool goLive)
 {
     try {
         gui.disableRunButton();
         runInfo   = info();
         simulator = runInfo.newSimulator((symbol, definition) => plots.get(symbol).Add(definition));
         each(simulator.symbols, symbol => simulator.addCollectible(symbol));
         simulator.addNewTradeListener(addTrade);
         simulator.processBars();
     } catch (Exception e) {
         gui.logAndAlert("failed during simulation run", e);
         return;
     } finally {
         runThread = null;
         gui.enableRunButton();
     }
     gui.reportResults(this);
     if (goLive)
     {
         simulator.goLive();
     }
 }