public Bittrex(string key, string secret, CoinDataList coin_data, CancellationToken shutdown)
     : base(SettingsData.Settings.Bittrex, coin_data, shutdown)
 {
     m_pairs           = new HashSet <CurrencyPair>();
     m_order_id_lookup = new Dictionary <long, Guid>();
     Api = new BittrexApi(key, secret, shutdown, Model.Log);
 }
Beispiel #2
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;
            }
        }
 public Bittrex(CoinDataList coin_data, CancellationToken shutdown)
     : this(string.Empty, string.Empty, coin_data, shutdown)
 {
     ExchSettings.PublicAPIOnly = true;
 }
Beispiel #4
0
 public CrossExchange(IList <Exchange> trading_exchanges, CoinDataList coin_data, CancellationToken shutdown)
     : base(SettingsData.Settings.CrossExchange, coin_data, shutdown)
 {
     Api       = new CrossExchangeApi(shutdown);
     Exchanges = trading_exchanges;
 }
Beispiel #5
0
 public Binance(string key, string secret, CoinDataList coin_data, CancellationToken shutdown)
     : base(SettingsData.Settings.Binance, coin_data, shutdown)
 {
     m_pairs = new HashSet <TradePair>();
     Api     = new BinanceApi(key, secret, shutdown, Model.Log);
 }
 public Poloniex(string key, string secret, CoinDataList coin_data, CancellationToken shutdown)
     : base(SettingsData.Settings.Poloniex, coin_data, shutdown)
 {
     m_pairs = new HashSet <CurrencyPair>();
     Api     = new PoloniexApi(key, secret, shutdown, Model.Log);
 }
 public CoinCollection(Exchange exch, CoinDataList coin_data)
     : base(exch, x => x.Symbol)
 {
     m_coin_data = coin_data;
 }