Ejemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsTbStatTimeframeValid())
            {
                this.DialogResult = DialogResult.None;
                return;
            }

            settings.StatisticsTimeframeSeconds = tbStatTimeframe.Text.ToInt();
            settings.LoggingLevel        = (LoggingLevel)cbLoggingLevel.SelectedItem;
            settings.LogServerStatistics = cbSaveServersStat.Checked;
            settings.TestDurationSeconds = tbTestDuration.Text.ToInt();
            settings.SaveSettings();
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsTbLotsMinValid() || !IsTbLotsMaxValid())
            {
                this.DialogResult = DialogResult.None;
                return;
            }

            settings.MoneyManagementSets.Tickers           = JsonConvert.DeserializeObject <List <Ticker> >(tbContracts.Text);
            settings.MoneyManagementSets.TradeRandomTicker = cbTradeRandomContract.Checked;
            settings.MoneyManagementSets.FixedTickerIndex  = tbFixedContractId.Text.ToInt();
            settings.MoneyManagementSets.LotsMin           = tbLotsMin.Text.ToInt();
            settings.MoneyManagementSets.LotsMax           = tbLotsMax.Text.ToInt();
            settings.SaveSettings();
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (rbPriceSinusoidal.Checked && !IsTbAmplitudeValid())
            {
                this.DialogResult = DialogResult.None;
                return;
            }

            sets.PricingSets.PricingMode = rbPriceFixed.Checked ? PricingSettingsMode.Fixed
                : /*rbPriceSinusoidal.Checked ? */ PricingSettingsMode.Sinusoidal;
            sets.PricingSets.SinusAmplitudePercent = tbAmplitude.Text.ToDecimal();
            sets.PricingSets.SinusPeriodMs         = cbSinusPeriod.Text.ToInt();

            sets.SaveSettings();
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 4
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!FormValid())
            {
                this.DialogResult = DialogResult.None;
                return;
            }

            sets.TradeSets.ProbOfNewOrder      = tbRandomPercNew.Text.ToDecimal();
            sets.TradeSets.ProbOfCancelOrder   = tbRandomPercCancel.Text.ToDecimal();
            sets.TradeSets.ProbOfMassCancel    = tbRandomPercMass.Text.ToDecimal();
            sets.TradeSets.ProbErrorRequest    = tbErrorReqPerc.Text.ToDecimal();
            sets.TradeSets.MakersCount         = tbMakersCount.Text.ToInt();
            sets.TradeSets.OneShotTradersCount = tbOneShotCount.Text.ToInt();
            sets.SaveSettings();
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!IsTbThreadsCountValid() || !IsTbIntervalMsValid() ||
                !IsTbPropOfPlacingOrderValid() || !IsTbFadeInPeriodValid() || !IsTbPayloadSinusPeriodMsValid())
            {
                DialogResult = DialogResult.None;
                return;
            }

            sets.PayloadSets.SleepInterval           = Int32.Parse(tbIntervalMs.Text);
            sets.PayloadSets.TradersCount            = Int32.Parse(tbThreadsCount.Text);
            sets.PayloadSets.RequestPerIterationProb = tbPropOfPlacingOrder.Text.ToDecimal();
            sets.PayloadSets.SinusoidPeriodMs        = tbPayloadSinusPeriodMs.Text.ToInt();
            sets.PayloadSets.FadingInSeconds         = tbFadeInPeriod.Text.ToInt();
            sets.PayloadSets.StepsCount     = tbStairsCount.Text.ToInt();
            sets.PayloadSets.SecondsPerStep = tbStairInterval.Text.ToInt();
            sets.PayloadSets.Mode           = tbDistrSinus.Checked ? PayloadSettingsMode.Sinusoidal :
                                              tbModeFadeIn.Checked ? PayloadSettingsMode.FadeIn :
                                              tbModeStairsUp.Checked ? PayloadSettingsMode.Stairs :
                                              tbModeStairsDown.Checked ? PayloadSettingsMode.StairsDown :
                                              PayloadSettingsMode.Even;
            sets.SaveSettings();
            DialogResult = DialogResult.OK;
        }