Exemple #1
0
        private int messageInterval = 40;       // 30s
        #endregion

        #region Public methods

        public StrategyQTP(TStrategy s, RiskM t, NLog log)
        {
            strategyT = s;

            t.SetStrategy(this);
            risk = t;
            
            this.log = log;

            monitors = new Dictionary<string, Monitor>();
        }
Exemple #2
0
        // Create
        public MyStrategy(TStrategy s, TLogin login)
        {
            strategyT = s;
            this.gmLogin = login;

            // pm manager
            pm = (PoolManager)Activator.CreateInstance(strategyT.Pool.ManagerType, this, strategyT.Pool);
            // monitors
            TAInfo info = new TAInfo(strategyT.TAInfoParameters);           
            monitors = new Dictionary<string, Monitor>();
            foreach (TInstrument ins in strategyT.Instruments)
            {
                Monitor monitor = new Monitor(this, ins, info, strategyT.DLLName);

                symbols += ins.Symbol + ",";
                monitors.Add(ins.Symbol, monitor);

                if (monitor.Target.Symbol == pm.SymbolBench)
                    monitor.IsBench = true;
            }

            // RiskM
            riskM = new RiskM(this, strategyT.RiskMInfoParameters);

            // heartTimer
            heartTimer = new System.Timers.Timer();
            heartTimer.Elapsed += new System.Timers.ElapsedEventHandler(heartTimer_Elapsed);
            heartTimer.Interval = 1000;     // 1s
        }