bugfix with empty old_long
This commit is contained in:
parent
b5ba20af81
commit
ddc3e272bc
|
|
@ -650,9 +650,11 @@ public class InstanceInterface {
|
||||||
double price = value.has("price") && value.get("price").isJsonPrimitive() ? value.get("price").getAsDouble() : 0.0;
|
double price = value.has("price") && value.get("price").isJsonPrimitive() ? value.get("price").getAsDouble() : 0.0;
|
||||||
double takeProfitPrice = value.has("take_profit_price") && value.get("take_profit_price").isJsonPrimitive() ? value.get("take_profit_price").getAsDouble() : 0.0;
|
double takeProfitPrice = value.has("take_profit_price") && value.get("take_profit_price").isJsonPrimitive() ? value.get("take_profit_price").getAsDouble() : 0.0;
|
||||||
double nextSoPrice = value.has("next_so_price") && value.get("next_so_price").isJsonPrimitive() ? value.get("next_so_price").getAsDouble() : 0.0;
|
double nextSoPrice = value.has("next_so_price") && value.get("next_so_price").isJsonPrimitive() ? value.get("next_so_price").getAsDouble() : 0.0;
|
||||||
String tpOrderId = value.has("tp_order_id") && value.get("tp_order_id").isJsonPrimitive() ? value.get("tp_order_id").getAsString() : null;
|
String tpOrderId = "";
|
||||||
|
//String tpOrderId = value.has("tp_order_id") && value.get("tp_order_id").isJsonPrimitive() ? value.get("tp_order_id").getAsString() : null;
|
||||||
JsonObject takeProfitOrder = value.get("take_profit_order").getAsJsonObject();
|
JsonObject takeProfitOrder = value.get("take_profit_order").getAsJsonObject();
|
||||||
String safetyOrderId = value.has("so_order_id") && value.get("so_order_id").isJsonPrimitive() ? value.get("so_order_id").getAsString() : null;
|
String safetyOrderId = "";
|
||||||
|
//String safetyOrderId = value.has("so_order_id") && value.get("so_order_id").isJsonPrimitive() ? value.get("so_order_id").getAsString() : null;
|
||||||
JsonObject safetyOrder = value.get("safety_order").getAsJsonObject();
|
JsonObject safetyOrder = value.get("safety_order").getAsJsonObject();
|
||||||
double feesPaidInBase = value.has("fees_paid_in_base") && value.get("fees_paid_in_base").isJsonPrimitive() ? value.get("fees_paid_in_base").getAsDouble() : 0.0;
|
double feesPaidInBase = value.has("fees_paid_in_base") && value.get("fees_paid_in_base").isJsonPrimitive() ? value.get("fees_paid_in_base").getAsDouble() : 0.0;
|
||||||
double feesPaidInQuote = value.has("fees_paid_in_quote") && value.get("fees_paid_in_quote").isJsonPrimitive() ? value.get("fees_paid_in_quote").getAsDouble() : 0.0;
|
double feesPaidInQuote = value.has("fees_paid_in_quote") && value.get("fees_paid_in_quote").isJsonPrimitive() ? value.get("fees_paid_in_quote").getAsDouble() : 0.0;
|
||||||
|
|
@ -665,6 +667,7 @@ public class InstanceInterface {
|
||||||
OldLongDictionary oldLongDictionary = null;
|
OldLongDictionary oldLongDictionary = null;
|
||||||
if (value.has("old_long")) {
|
if (value.has("old_long")) {
|
||||||
oldLong = value.get("old_long").getAsJsonObject();
|
oldLong = value.get("old_long").getAsJsonObject();
|
||||||
|
if (!oldLong.entrySet().isEmpty()) {
|
||||||
oldLongDictionary = new OldLongDictionary(
|
oldLongDictionary = new OldLongDictionary(
|
||||||
oldLong.get("datetime").getAsString(),
|
oldLong.get("datetime").getAsString(),
|
||||||
oldLong.get("fees_paid_in_quote").getAsDouble(),
|
oldLong.get("fees_paid_in_quote").getAsDouble(),
|
||||||
|
|
@ -673,6 +676,7 @@ public class InstanceInterface {
|
||||||
oldLong.get("tp_price").getAsDouble()
|
oldLong.get("tp_price").getAsDouble()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
valueToReturn.add(new WorkerStatsData(
|
valueToReturn.add(new WorkerStatsData(
|
||||||
key,
|
key,
|
||||||
|
|
@ -710,7 +714,7 @@ public class InstanceInterface {
|
||||||
statusString
|
statusString
|
||||||
));
|
));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Error processing JSON for key '" + key + "': " + e.getMessage());
|
System.err.println("In getAllWorkerStats: Error processing JSON for key '" + key + "': " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ public class WorkerInterface {
|
||||||
InstanceInterface.OldLongDictionary oldLongDictionary = null;
|
InstanceInterface.OldLongDictionary oldLongDictionary = null;
|
||||||
if (value.has("old_long")) {
|
if (value.has("old_long")) {
|
||||||
oldLong = value.get("old_long").getAsJsonObject();
|
oldLong = value.get("old_long").getAsJsonObject();
|
||||||
|
if (!oldLong.entrySet().isEmpty()) {
|
||||||
oldLongDictionary = new InstanceInterface.OldLongDictionary(
|
oldLongDictionary = new InstanceInterface.OldLongDictionary(
|
||||||
oldLong.get("datetime").getAsString(),
|
oldLong.get("datetime").getAsString(),
|
||||||
oldLong.get("fees_paid_in_quote").getAsDouble(),
|
oldLong.get("fees_paid_in_quote").getAsDouble(),
|
||||||
|
|
@ -116,6 +117,7 @@ public class WorkerInterface {
|
||||||
oldLong.get("tp_price").getAsDouble()
|
oldLong.get("tp_price").getAsDouble()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
valueToReturn = new InstanceInterface.WorkerStatsData(
|
valueToReturn = new InstanceInterface.WorkerStatsData(
|
||||||
pair,
|
pair,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue