Forex_Strategy_Builder.Account_Settings.SetAcountExchangeRate C# (CSharp) Method

SetAcountExchangeRate() private method

Calculates the account exchange rate.
private SetAcountExchangeRate ( ) : void
return void
        void SetAcountExchangeRate()
        {
            lblExchangeRate.Text = Language.T("Account exchange rate");

            if (Data.InstrProperties.PriceIn == cbxAccountCurrency.Text)
            {
                tbxExchangeRate.Text    = Language.T("Not used");
                tbxExchangeRate.Visible = true;
                nudExchangeRate.Value   = 1;
                nudExchangeRate.Visible = false;
                if (cbxAccountCurrency.Text == "USD")
                    rateToUSD = 1;
                else if (cbxAccountCurrency.Text == "EUR")
                    rateToEUR = 1;
            }
            else if (Data.InstrProperties.InstrType == Instrumet_Type.Forex && Data.InstrProperties.Symbol.StartsWith(cbxAccountCurrency.Text))
            {
                tbxExchangeRate.Text    = Language.T("Deal price");
                tbxExchangeRate.Visible = true;
                nudExchangeRate.Value   = 0;
                nudExchangeRate.Visible = false;
                if (cbxAccountCurrency.Text == "USD")
                    rateToUSD = 0;
                else if (cbxAccountCurrency.Text == "EUR")
                    rateToEUR = 0;
            }
            else
            {
                lblExchangeRate.Text   += " " + cbxAccountCurrency.Text + Data.InstrProperties.PriceIn;
                tbxExchangeRate.Visible = false;
                if (cbxAccountCurrency.Text == "USD")
                    nudExchangeRate.Value = (decimal)rateToUSD;
                else if (cbxAccountCurrency.Text == "EUR")
                    nudExchangeRate.Value = (decimal)rateToEUR;
                nudExchangeRate.Visible = true;
            }

            return;
        }