/// <summary>
        /// Run the indicator in either collection or indicator mode.
        /// </summary>
        /// <param name="collectMode">True to run the indicator in collection mode,
        /// false otherwise.</param>
        public void Run(bool collectMode)
        {
            IMLRegression method;

            if (collectMode)
            {
                method = null;
                Console.WriteLine(@"Ready to collect data from remote indicator.");
            }
            else
            {
                method =
                    (IMLRegression)
                    EncogDirectoryPersistence.LoadObject(FileUtil.CombinePath(new FileInfo(_path), Config.MethodName));
                Console.WriteLine(@"Indicator ready.");
            }

            Console.WriteLine(@"Waiting for connections on port " + Port);

            var server = new IndicatorServer();

            server.AddListener(this);

            server.AddIndicatorFactory(new MyFactory(method, _path));
            server.Start();

            if (collectMode)
            {
                server.WaitForIndicatorCompletion();
            }
            else
            {
                server.WaitForShutdown();
            }
        }
        public void Execute(IExampleInterface app)
        {
            _app = app;
            Console.WriteLine(@"Waiting for connections on port " + Port);

            var server = new IndicatorServer();

            server.AddListener(this);

            server.AddIndicatorFactory(new MyFactory());

            server.Start();
            server.WaitForShutdown();
        }
Exemple #3
0
        public void Execute(IExampleInterface app)
        {
            this.app = app;

            Console.WriteLine(@"Waiting for connections on port " + Port);

            var ind = new DownloadIndicatorFactory(new FileInfo("d:\\ninja.csv"));

            ind.RequestData("HIGH[5]");
            ind.RequestData("LOW[1]");
            ind.RequestData("OPEN[1]");
            ind.RequestData("CLOSE[1]");
            ind.RequestData("VOL[1]");
            ind.RequestData("MACD(12,26,9).Avg[1]");

            var server = new IndicatorServer();

            server.AddListener(this);
            server.AddIndicatorFactory(ind);
            server.Start();
            server.WaitForIndicatorCompletion();
        }