private void PostInit()
        {
            var accessKey = Program.Accesskey;
            var secretEky = Program.Secretkey;

            ApiData = new ApiData(accessKey, secretEky);
            React   = new React(accessKey, secretEky);

            AlgorithmList  = BotSetting.AlgorithmList;
            CandleTypeList = BotSetting.CandleTypeList;
            CoinList       = BotSetting.CoinList;

            algorithmBindingSource.DataSource  = AlgorithmList;
            candleTypeBindingSource.DataSource = CandleTypeList;
            coinBindingSource.DataSource       = CoinList;

            Algorithm  = AlgorithmList.Where(x => x.Id == Settings.Default.algorithm).FirstOrDefault();
            CandleType = CandleTypeList.Where(x => x.Minute == Settings.Default.candleType).FirstOrDefault();
            Coin       = CoinList.Where(x => x.Ticker.Equals(Settings.Default.coin)).FirstOrDefault();

            FeeRate     = Settings.Default.feeRate;
            OrderRate   = Settings.Default.tradeRate;
            Interval    = Convert.ToInt32(Settings.Default.interval);
            TriggerRate = Settings.Default.triggerRate;
            CandleCount = Convert.ToInt32(Settings.Default.candleCount);
        }
Beispiel #2
0
        private void PreInit()
        {
            AlgorithmList  = BotSetting.AlgorithmList;
            CandleTypeList = BotSetting.CandleTypeList;
            CoinList       = BotSetting.CoinList;

            Algorithm  = AlgorithmList.Where(x => x.Id == Settings.Default.algorithm).FirstOrDefault();
            CandleType = BotSetting.CandleTypeList.Where(x => x.Minute == Settings.Default.candleType).FirstOrDefault();
            Coin       = BotSetting.CoinList.Where(x => x.Ticker.Equals(Settings.Default.coin)).FirstOrDefault();
        }
        private void PostInit()
        {
            var accessKey = Program.Accesskey;
            var secretEky = Program.Secretkey;

            ApiData = new ApiData(accessKey, secretEky);
            React   = new React(accessKey, secretEky);

            AlgorithmList  = BotSetting.AlgorithmList;
            CandleTypeList = BotSetting.CandleTypeList;
            CoinList       = BotSetting.CoinList;

            Algorithm  = AlgorithmList.Where(x => x.Id == Settings.Default.algorithm).FirstOrDefault();
            CandleType = BotSetting.CandleTypeList.Where(x => x.Minute == Settings.Default.candleType).FirstOrDefault();
            Coin       = BotSetting.CoinList.Where(x => x.Ticker.Equals(Settings.Default.coin)).FirstOrDefault();

            algorithmBindingSource.DataSource  = AlgorithmList;
            candleTypeBindingSource.DataSource = CandleTypeList;
            coinBindingSource.DataSource       = CoinList;

            Algorithm  = BotSetting.AlgorithmList.Where(x => x.Id == Settings.Default.algorithm).FirstOrDefault();
            CandleType = new CandleType(Settings.Default.candleType);
            Coin       = BotSetting.CoinList.Where(x => x.Ticker.Equals(Settings.Default.coin)).FirstOrDefault();

            FeeRate     = Settings.Default.feeRate;
            TradeRate   = Settings.Default.tradeRate;
            Interval    = Convert.ToInt32(Settings.Default.interval);
            TriggerRate = Settings.Default.triggerRate;
            CandleCount = Convert.ToInt32(Settings.Default.candleCount);

            cmbAlgorithm.SelectedItem = Algorithm;
            cmbCandle.SelectedItem    = CandleType;
            txtFee.Text          = FeeRate.ToString();
            txtTradeRate.Text    = TradeRate.ToString();
            cmbCoin.SelectedItem = Coin;
            txtInterval.Text     = Interval.ToString();
            txtTriggerRate.Text  = TriggerRate.ToString();
            txtCandleCount.Text  = CandleCount.ToString();
        }
        private void PostInit()
        {
            var accessKey = Program.Accesskey;
            var secretEky = Program.Secretkey;

            ApiData = new ApiData(accessKey, secretEky);
            React   = new React(accessKey, secretEky);

            AlgorithmList  = BotSetting.AlgorithmList;
            CandleTypeList = BotSetting.CandleTypeList;
            CoinList       = BotSetting.CoinList;

            Algorithm  = AlgorithmList.Where(x => x.Id == Settings.Default.algorithm).FirstOrDefault();
            CandleType = BotSetting.CandleTypeList.Where(x => x.Minute == Settings.Default.candleType).FirstOrDefault();
            Coin       = BotSetting.CoinList.Where(x => x.Ticker.Equals(Settings.Default.coin)).FirstOrDefault();


            algorithmBindingSource.DataSource  = AlgorithmList;
            candleTypeBindingSource.DataSource = CandleTypeList;
            coinBindingSource.DataSource       = CoinList;

            //cmbAlgorithm.DataSource = new BindingSource(BotSetting.AlgorithmList, null);
            //cmbAlgorithm.ValueMember = "Id";
            //cmbAlgorithm.DisplayMember = "Name";
            //cmbAlgorithm.SelectedValue = Settings.Default.algorithm;

            //cmbCandle.DataSource = new BindingSource(BotSetting.CandleTypeList, null);
            //cmbCandle.ValueMember = "Minute";
            //cmbCandle.DisplayMember = "Name";
            //cmbCandle.SelectedValue = Settings.Default.candleType;

            //cmbCoin.DataSource = new BindingSource(BotSetting.CoinList, null);
            //cmbCoin.ValueMember = "Ticker";
            //cmbCoin.DisplayMember = "CoinName";
            //cmbCoin.SelectedValue = Settings.Default.coin;
        }