Beispiel #1
0
        private void ReadSettings(bool bindControl = true)
        {
            Algorithm   = BotSetting.AlgorithmList.Where(x => x.Id == Settings.Default.algorithm).First();
            CandleType  = new CandleType(Settings.Default.candleType);
            FeeRate     = Settings.Default.fee;
            TradeRate   = Settings.Default.tradeRate;
            Coin        = BotSetting.CoinList.Where(x => x.Ticker.Equals(Settings.Default.coin)).FirstOrDefault();
            Interval    = Convert.ToInt32(Settings.Default.interval);
            Rate        = Convert.ToDouble(Settings.Default.rate);
            CandleCount = Convert.ToInt32(Settings.Default.candleCount);
            ProfitRate  = Settings.Default.profit;

            if (bindControl)
            {
                cmbAlgorithm.SelectedItem = Algorithm;
                cmbCandle.SelectedItem    = CandleType;
                txtFee.Text          = FeeRate.ToString();
                txtTradeRate.Text    = TradeRate.ToString();
                cmbCoin.SelectedItem = Coin;
                txtInterval.Text     = Interval.ToString();
                txtRate.Text         = Rate.ToString();
                txtCandleCount.Text  = CandleCount.ToString();
                txtProfit.Text       = ProfitRate.ToString();
            }
        }
        private void Bot_Load(object sender, EventArgs e)
        {
            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();

            cmbAlgorithm.SelectedItem = Algorithm;
            cmbCandle.SelectedItem    = CandleType;
            cmbCoin.SelectedItem      = Coin;
            txtFee.Text         = FeeRate.ToString();
            txtTradeRate.Text   = TradeRate.ToString();
            txtInterval.Text    = Interval.ToString();
            txtTriggerRate.Text = TriggerRate.ToString();
            txtCandleCount.Text = CandleCount.ToString();
        }
Beispiel #3
0
        public void FeeRateFormatting()
        {
            var fee = new FeeRate(0.5m);

            Assert.Equal("0.5 Sat/B", fee.ToString());
            fee = new FeeRate(1.0m);
            Assert.Equal("1 Sat/B", fee.ToString());
            fee = new FeeRate(0.521748274m);
            Assert.Equal("0.521 Sat/B", fee.ToString());
        }
 private void Bot_Load(object sender, EventArgs e)
 {
     cmbAlgorithm.SelectedItem = Algorithm;
     cmbCandle.SelectedItem    = CandleType;
     cmbCoin.SelectedItem      = Coin;
     txtFee.Text         = FeeRate.ToString();
     txtTradeRate.Text   = TradeRate.ToString();
     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;

            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();
        }