コード例 #1
0
        private static string ToHumanReadableString(this IndicatorTime time)
        {
            switch (time)
            {
            case IndicatorTime.ThreeMinutes:
                return("3m");

            case IndicatorTime.FiveMinutes:
                return("5m");

            case IndicatorTime.FifteenMinutes:
                return("15m");

            case IndicatorTime.ThirtyMinutes:
                return("30m");

            case IndicatorTime.OneHour:
                return("1h");

            case IndicatorTime.TwoHours:
                return("2h");

            case IndicatorTime.FourHours:
                return("4h");

            default:
                throw new ArgumentOutOfRangeException(nameof(time), time, null);
            }
        }
コード例 #2
0
        public RsiOptions(IndicatorTime time = IndicatorTime.ThreeMinutes, int points = 25, int timePeriod = 7, TriggerCondition triggerCondition = TriggerCondition.Less)
        {
            // If no value is present, it falls back to the default legacy RSI time period value (7).
            // https://github.com/TheKimono/3Commas.Net/issues/56
            if (timePeriod == 0)
            {
                timePeriod = 7;
            }

            this.Time       = time;
            this.Points     = points;
            this.TimePeriod = timePeriod;
            this.Condition  = triggerCondition;
        }
コード例 #3
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (radioButtonRsi.Checked)
            {
                if (cmbRsiTime.SelectedItem == null)
                {
                    MessageBox.Show("Time is missing");
                    return;
                }

                IndicatorTime.TryParse(cmbRsiTime.SelectedItem.ToString(), out IndicatorTime time);
                _strategy = new RsiBotStrategy()
                {
                    Options = new RsiOptions(time, (int)numRsiPoints.Value)
                };
            }

            if (radioButtonTradingView.Checked)
            {
                if (cmbTradingViewTime.SelectedItem == null)
                {
                    MessageBox.Show("Time is missing");
                    return;
                }
                if (cmbTradingViewType.SelectedItem == null)
                {
                    MessageBox.Show("Type is missing");
                    return;
                }

                TradingViewTime.TryParse(cmbTradingViewTime.SelectedItem.ToString(), out TradingViewTime time);
                TradingViewIndicatorType.TryParse(cmbTradingViewType.SelectedItem.ToString(), out TradingViewIndicatorType type);
                _strategy = new TradingViewBotStrategy()
                {
                    Options = new TradingViewOptions(type, time)
                };
            }

            if (radioButtonManual.Checked)
            {
                _strategy = new ManualStrategy();
            }
            if (radioButtonNonstop.Checked)
            {
                _strategy = new NonStopBotStrategy();
            }

            this.DialogResult = DialogResult.OK;
        }
コード例 #4
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (radioButtonQfl.Checked)
            {
                if (cmbQflType.SelectedItem == null)
                {
                    MessageBox.Show("QFL Type is missing");
                    return;
                }

                if (numQflPercent.Value == 0)
                {
                    MessageBox.Show("QFL Percentage is missing");
                    return;
                }

                QflType.TryParse(cmbQflType.SelectedItem.ToString(), out QflType type);
                _strategy = new QflBotStrategy()
                {
                    Options = new QflOptions(type, numQflPercent.Value)
                };
            }

            if (radioButtonRsi.Checked)
            {
                if (cmbRsiTime.SelectedItem == null)
                {
                    MessageBox.Show("Time is missing");
                    return;
                }

                IndicatorTime.TryParse(cmbRsiTime.SelectedItem.ToString(), out IndicatorTime time);
                _strategy = new RsiBotStrategy()
                {
                    Options = new RsiOptions(time, (int)numRsiPoints.Value)
                };
            }

            if (radioButtonUlt.Checked)
            {
                if (cmbUltTime.SelectedItem == null)
                {
                    MessageBox.Show("Time is missing");
                    return;
                }

                IndicatorTime.TryParse(cmbUltTime.SelectedItem.ToString(), out IndicatorTime time);
                _strategy = new UltBotStrategy()
                {
                    Options = new UltOptions(time, (int)numUltPoints.Value)
                };
            }

            if (radioButtonTradingView.Checked)
            {
                if (cmbTradingViewTime.SelectedItem == null)
                {
                    MessageBox.Show("Time is missing");
                    return;
                }
                if (cmbTradingViewType.SelectedItem == null)
                {
                    MessageBox.Show("Type is missing");
                    return;
                }

                TradingViewTime.TryParse(cmbTradingViewTime.SelectedItem.ToString(), out TradingViewTime time);
                TradingViewIndicatorType.TryParse(cmbTradingViewType.SelectedItem.ToString(), out TradingViewIndicatorType type);
                _strategy = new TradingViewBotStrategy()
                {
                    Options = new TradingViewOptions(type, time)
                };
            }

            if (radioButtonTaPresets.Checked)
            {
                if (cmbTaPresetsTime.SelectedItem == null)
                {
                    MessageBox.Show("Time is missing");
                    return;
                }
                if (cmbTaPresetsType.SelectedItem == null)
                {
                    MessageBox.Show("Type is missing");
                    return;
                }

                IndicatorTime.TryParse(cmbTaPresetsTime.SelectedItem.ToString(), out IndicatorTime time);
                TaPresetsType.TryParse(cmbTaPresetsType.SelectedItem.ToString(), out TaPresetsType type);
                _strategy = new TaPresetsBotStrategy {
                    Options = new TaPresetsOptions(type, time)
                };
            }

            if (radioButtonManual.Checked)
            {
                _strategy = new ManualStrategy();
            }
            if (radioButtonNonstop.Checked)
            {
                _strategy = new NonStopBotStrategy();
            }

            if (radioButtonCustom.Checked)
            {
                if (string.IsNullOrWhiteSpace(txtCustom.Text))
                {
                    MessageBox.Show("Name is missing");
                    return;
                }
                _strategy = new UnknownStrategy(txtCustom.Text);
            }

            if (radioButtonMarketplaceItems.Checked)
            {
                if (cmbMarketplaceSignals.SelectedItem == null)
                {
                    MessageBox.Show("No Item selected");
                    return;
                }
                _strategy = new UnknownStrategy(((MarketplaceItem)cmbMarketplaceSignals.SelectedItem).StrategyKey);
            }

            this.DialogResult = DialogResult.OK;
        }
コード例 #5
0
 public UltOptions(IndicatorTime time = IndicatorTime.ThreeMinutes, int points = 40)
 {
     this.Time   = time;
     this.Points = points;
 }
コード例 #6
0
 public RsiOptions(IndicatorTime time = IndicatorTime.ThreeMinutes, int points = 25)
 {
     this.Time   = time;
     this.Points = points;
 }
コード例 #7
0
 public TaPresetsOptions(TaPresetsType type = TaPresetsType.BB_20_1_LB, IndicatorTime time = IndicatorTime.ThreeMinutes)
 {
     this.Type = type;
     this.Time = time;
 }
コード例 #8
0
 public BbOptions(IndicatorTime time = IndicatorTime.ThreeMinutes, decimal points = 0)
 {
     this.Time   = time;
     this.Points = points;
 }