Esempio n. 1
0
 public void loadOnto(ResearchGUI gui)
 {
     LogC.info("loading " + this + " onto gui");
     if (parameters.has("systemId"))
     {
         gui.setSystemId(parameters.get <string>("systemId"));
     }
     if (parameters.has("RunNumber"))
     {
         gui.setRunNumberEnabled(true);
         gui.setRunNumber(parameters.get <string>("RunNumber"));
     }
     gui.setMarkets(markets);
     gui.setParameters(parameters);
     gui.setStartDate(startDate);
     gui.setEndDate(endDate);
     gui.setSlippageCalculator(slippageCalculatorName);
     gui.setRunInNativeCurrency(runInNativeCurrency);
 }
Esempio n. 2
0
 public static void loadSystem(ResearchGUI gui)
 {
     try {
         var        systemId = int.Parse(gui.systemId());
         var        details  = Parameters.details(systemId);
         Parameters parameters;
         if (details.hasPv())
         {
             parameters = new Parameters {
                 { "systemId", systemId },
                 { "RunMode", (double)RunMode.LIVE }
             };
             gui.setMarkets(convert(list <Market>(details.liveSystem().markets()), market => market.name()));
         }
         else if (hasContent(gui.runNumber()))
         {
             parameters = new Parameters {
                 { "systemId", systemId },
                 { "RunNumber", int.Parse(gui.runNumber()) },
                 { "RunMode", (double)RunMode.STO }
             };
             gui.setMarkets(list <string>(MsivBacktestTable.BACKTEST.markets(details.siv(), details.stoId())));
         }
         else
         {
             parameters = new Parameters {
                 { "systemId", systemId },
                 { "RunMode", (double)RunMode.RIGHTEDGE }
             };
             each(list <string>(StrategyParameters.NAMES.names(details.siv().system())), name => parameters.Add(name, 0));
             gui.setMarkets(list <string>(MsivBacktestTable.BACKTEST.markets(details.siv(), details.stoId())));
         }
         gui.setRunNumberEnabled(details.hasValidStoDir());
         gui.setRunInNativeCurrency(details.runInNativeCurrency());
         gui.setParameters(parameters);
     } catch (Exception e) {
         gui.logAndAlert("failed to load system", e);
     }
 }