Change max. deviation of market price #1356

This commit is contained in:
Manfred Karrer 2018-02-13 21:10:55 -05:00
parent bd6b70a8ba
commit 521dd62114
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
3 changed files with 5 additions and 4 deletions

View File

@ -757,7 +757,7 @@ setting.preferences.general=General preferences
setting.preferences.explorer=Bitcoin block explorer:
setting.preferences.deviation=Max. deviation from market price:
setting.preferences.autoSelectArbitrators=Auto select arbitrators:
setting.preferences.deviationToLarge=Values higher than 30 % are not allowed.
setting.preferences.deviationToLarge=Values higher than {0}% are not allowed.
setting.preferences.txFee=Withdrawal transaction fee (satoshi/byte):
setting.preferences.useCustomValue=Use custom value
setting.preferences.txFeeMin=Transaction fee must be at least {0} satoshi/byte

View File

@ -44,7 +44,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
private TradeCurrency preferredTradeCurrency;
private long withdrawalTxFeeInBytes = 100;
private boolean useCustomWithdrawalTxFee = false;
private double maxPriceDistanceInPercent = 0.1;
private double maxPriceDistanceInPercent = 0.3;
@Nullable
private String offerBookChartScreenCurrencyCode;
@Nullable

View File

@ -249,10 +249,11 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Activatab
deviationListener = (observable, oldValue, newValue) -> {
try {
double value = formatter.parsePercentStringToDouble(newValue);
if (value <= 0.3) {
final double maxDeviation = 0.5;
if (value <= maxDeviation) {
preferences.setMaxPriceDistanceInPercent(value);
} else {
new Popup<>().warning(Res.get("setting.preferences.deviationToLarge")).show();
new Popup<>().warning(Res.get("setting.preferences.deviationToLarge", maxDeviation * 100)).show();
UserThread.runAfter(() -> deviationInputTextField.setText(formatter.formatPercentagePrice(preferences.getMaxPriceDistanceInPercent())), 100, TimeUnit.MILLISECONDS);
}
} catch (NumberFormatException t) {