Exemplo n.º 1
0
        public Model(Func <IChartView> create_chart_cb)
        {
            try
            {
                Shutdown                = new CancellationTokenSource();
                Exchanges               = new ExchangeContainer();
                Coins                   = new CoinDataList();
                Funds                   = new FundContainer();
                Bots                    = new BotContainer(this);
                PriceData               = new PriceDataMap(Shutdown.Token);
                Charts                  = new ChartContainer(create_chart_cb);
                Indicators              = new IndicatorContainer();
                SelectedOpenOrders      = new ObservableCollection <Order>();
                SelectedCompletedOrders = new ObservableCollection <OrderCompleted>();
                SelectedTransfers       = new ObservableCollection <Transfer>();
                EditTradeContexts       = new List <EditTradeContext>();

                // Enable settings auto save after everything is up and running
                SettingsData.Settings.AutoSaveOnChanges = true;

                AllowTradesChanged += HandleAllowTradesChanged;
                BackTestingChange  += HandleBackTestingChange;
            }
            catch
            {
                Shutdown?.Cancel();
                Dispose();
                throw;
            }
        }