Exemple #1
0
        public RiskM(MyStrategy s, Dictionary<string, string> pars)
        {
            strategy = s;

            currentCSize = Convert.ToInt32(pars["CSize"]);
            currentRisk = Convert.ToDouble(pars["Risk"]);
        }
Exemple #2
0
        public PoolManager(MyStrategy strategy, TPool pool)
        {
            this.strategy = strategy;
            this.name = pool.Name;

            symbolBench = pool.ManagerParameters["Bench"];
        }
 public void StartStrategy(MyStrategy s)
 {
     qtp = s;
     qtp.MessageHint += OnMessage;
     qtp.OnKBOpenLong += KBBuy;
     qtp.OnKBCloseLong += KBSell;
     Task t = new Task(s.Start);
     t.Start();
 }
Exemple #4
0
        public void ShowData(MyStrategy strategy)
        {
            this.strategy = strategy;

            strategy.TradeCashHeartPusle += new MyStrategy.TradeCashHeartPusleCallback(TradeCash_HeartPusle);

            if (strategy.WebTD == null)
            {
                splitContainer1.Panel2Collapsed = true; ;
                splitContainer2.Panel2Collapsed = true; ;
            }

        }
Exemple #5
0
        public MyBackTest(MyStrategy strategy, Dictionary<string, string> parameters, List<int> periods)
        {
            this.strategy = strategy;
            this.periods = periods;
            this.periods.Remove(1);

            if (parameters.ContainsKey("UseLocal")) useLocal = parameters["UseLocal"] == "1";

            startTime = Convert.ToDateTime(parameters["Start"]);
            endTime = Convert.ToDateTime(parameters["End"]);

            if (parameters.ContainsKey("Interval")) interval = Convert.ToInt32(parameters["Interval"]);
            if (parameters.ContainsKey("Save")) save = parameters["Save"] == "1";
        }
Exemple #6
0
 public Bridge(MyStrategy strategy, TPool pool)
     : base (strategy, pool)
 {
 }
Exemple #7
0
 public void ShowData(MyStrategy strategy)
 {
     this.strategy = strategy;
 }
Exemple #8
0
        public Monitor(MyStrategy strategy, TInstrument target, TAInfo taInfo, string dllName)
        {
            this.strategy = strategy;
            this.target = target;

            this.ta = new TA(this, taInfo, dllName);

            this.barBuffer = new List<Bar>();
            this.tickBuffer = new List<Tick>();
        }
Exemple #9
0
        private void Initialize()
        {
            try
            {
                // DataBase Operation
                TStrategy strategyT = CRUD.GetTStrategy(args[0]);

                // TLogin
                TLogin gmLogin = null;
                if (args.Length == 3)
                    gmLogin = new TLogin(args[1], args[2]);
                else
                    gmLogin = CRUD.GetTLogin();

                strategy = new MyStrategy(strategyT, gmLogin);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                //popup.TaskFinished(ex.Message);
                return;
            }
        
            // new MyStrategy and Prepare preStart Data.
            strategy.InitializeExceptionOccur += new MyStrategy.InitializeExceptionCallback(ProcessInitializeExecption);

            HookStrategyToGUI();
            strategy.Initialize();

            popup.TaskFinished(null);
        }