コード例 #1
0
ファイル: Researcher.cs プロジェクト: TzarIvan/ratel
        public void run(bool goLive)
        {
            Bomb.unlessNull(runThread, () => "cannot run a system while another one is running");
            var markets    = gui.markets();
            var parameters = nullIfFails(() => gui.parameters(), () => "Parameters contains an invalid value!");

            if (parameters == null)
            {
                return;
            }
            if (hasContent(gui.systemId()) && !gui.systemId().Equals(parameters.get <string>("systemId")))
            {
                gui.alertUser("The system id in the System ID box and systemId in parameters do not match. did you forget to hit Load System?\nIf this was intentional, clear the Id box and run again.");
                return;
            }

            var startDate           = gui.startDate();
            var endDate             = gui.endDate();
            var slippageCalculator  = gui.slippageCalculator();
            var runInNativeCurrency = gui.runInNativeCurrency();

            runThread = new Thread(() => {
                Log.setContext("runSystem");
                runSystem(() => new SystemRunInfo(markets, parameters, startDate, endDate, slippageCalculator, runInNativeCurrency), goLive);
            });
            runThread.Start();
        }
コード例 #2
0
ファイル: Researcher.cs プロジェクト: TzarIvan/ratel
 static SystemRunInfo makeRunInfo(ResearchGUI gui)
 {
     return(new SystemRunInfo(gui.markets(), gui.parameters(), gui.startDate(), gui.endDate(), gui.slippageCalculator(), gui.runInNativeCurrency()));
 }