void SetAcountExchangeRate()
{
if (tbxPropPriceIn.Text == tbxPropAccountIn.Text)
{
tbxPropAccountRate.Text = Language.T("Not used");
nudPropAccountRate.Value = 1;
nudPropAccountRate.Enabled = false;
if (tbxPropAccountIn.Text == "USD")
instrPropSelectedInstrument.RateToUSD = 1;
else if (tbxPropAccountIn.Text == "EUR")
instrPropSelectedInstrument.RateToEUR = 1;
}
else if (tbxPropType.Text == "Forex" && tbxPropSymbol.Text.StartsWith(tbxPropAccountIn.Text))
{
tbxPropAccountRate.Text = Language.T("Deal price");
nudPropAccountRate.Value = 0;
nudPropAccountRate.Enabled = false;
if (tbxPropAccountIn.Text == "USD")
instrPropSelectedInstrument.RateToUSD = 0;
else if (tbxPropAccountIn.Text == "EUR")
instrPropSelectedInstrument.RateToEUR = 0;
}
else
{
tbxPropAccountRate.Text = tbxPropAccountIn.Text + tbxPropPriceIn.Text;
if (tbxPropAccountIn.Text == "USD")
nudPropAccountRate.Value = (decimal)instrPropSelectedInstrument.RateToUSD;
else if (tbxPropAccountIn.Text == "EUR")
nudPropAccountRate.Value = (decimal)instrPropSelectedInstrument.RateToEUR;
nudPropAccountRate.Enabled = true;
nudPropAccountRate.ForeColor = Color.Red;
}
return;
}