Exemplo n.º 1
0
        protected override void OnStart()
        {
            // Initialize NEWS
            news = new List <string>();

            // initialize c-bot link
            botLink        = new cBotLink();
            botLink.SubKey = "Software\\cAlgo4u\\News Manager\\Alerts";

            // set up container for all paused robots
            pausedRobots = new List <cAlgo4u.Robot>();

            // iterate through enums
            CurrencyList = Enum.GetValues(typeof(Currencies));

            // reset the instrument flags to false, no news
            foreach (Currencies currency in CurrencyList)
            {
                botLink.Write(currency.ToString(), false);
            }

            if (IncludeNewsReleaseStop)
            {
                InitialiseNewsRelease();
            }

            // setup timer to invoke method each minute
            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 60000;
            aTimer.Enabled  = true;

            Print(cAlgoVersion);
        }
Exemplo n.º 2
0
 protected override void OnStop()
 {
     botLink = null;
     fxNews  = null;
 }