private void count() { double takeProfit = getDoubleFromTextBox(takeProfitTextBox); double sharePrice = getDoubleFromTextBox(sharePriceTextBox); double stopLoss = getDoubleFromTextBox(stopLossTextBox); double commissionsPercentage = (double)commissionsPercentageNumericUpDown.Value; double commissionsPerShare = (double)commissionsPerShareNumericUpDown.Value; double commissionsPerTrade = (double)commissionsPerTradeNumericUpDown.Value; double commissionsMinPerTrade = (double)commissionsMinPerTradeNumericUpDown.Value; bool commissionsMinPerTradePercentage = minimumPerTradePercentageRadioButton.Checked; double commissionsMaxPerTrade = (double)commissionsMaxPerTradeNumericUpDown.Value; bool commissionsMaxPerTradePercentage = maximumPerTradePercentageRadioButton.Checked; double riskUnit = getDoubleFromTextBox(riskTextBox); double capital = getDoubleFromTextBox(capitalTextBox); Info info = new Info(takeProfit, sharePrice, stopLoss, commissionsPercentage, commissionsPerShare, commissionsPerTrade, commissionsMinPerTrade, commissionsMinPerTradePercentage, commissionsMaxPerTrade, commissionsMaxPerTradePercentage, riskUnit, capital); Result result = UIInteractions.mainCount(info); riskRewardTextBox.Text = result.riskReward.ToString(); numberOfSharesTextBox.Text = result.numberOfShares.ToString(); finalPriceTextBox.Text = result.finalPrice.ToString(); gainTextBox.Text = result.gain.ToString(); riskingTextBox.Text = result.risking.ToString(); }
private void loadUsdbutton_Click(object sender, EventArgs e) { try { loadSettings(UIInteractions.loadSettings(), Currency.USD); currencyLabel.Text = "USD"; } catch (Exception) { } }
public void saveSettings(Currency currency) { try { Settings settings = createSettings(currency); UIInteractions.saveSettings(settings, currency); capitalTextBox.BackColor = Color.White; } catch (Exception ex) { capitalTextBox.BackColor = Color.MediumVioletRed; } }
public void countRiskUnit() { double capital; Double.TryParse(capitalTextBox.Text, out capital); if (capital == 0) { capitalTextBox.BackColor = Color.MediumVioletRed; } else { capitalTextBox.BackColor = Color.White; } riskTextBox.Text = UIInteractions.countRisk(capital, riskPercentageNumericUpDown.Value).ToString(); }