Esempio n. 1
0
        public void Start(IList<string> rates, decimal summ, string ratesFolder, DateTime dtStart, DateTime? dtEnd,string activeStrategy)
        {
            _summ = summ;
            _rates = rates;
            _ratesFolder = ratesFolder;
            _dtEnd = dtEnd;
            _dtStart = dtStart;

            _orderController = new OrderController(activeStrategy, summ, new List<string>() { "EUR/USD" });
            _orderController.MessageEvent += SendMessageEvent;
            _orderController.OpenOrderEvent += SendOpenOrderEvent;
            _orderController.CloseOrderEvent += SendCloseOrderEvent;

            _strategyController = new StrategyController(_orderController, new List<IStrategyProvider>() { new Sperandeo() });
            _rateController = new RateController(rates, dtStart, dtEnd);
            _rateController.HistoryEvent += OnHistoryEvent;
            _rateController.MessageEvent += SendMessageEvent;
            _rateController.NewRatesEvent += OnNewRatesEvent;
            _rateController.StopEvent += SendStopEvent;

            _rateController.Start();
        }