diff --git a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java index 3709559..5fd5f08 100644 --- a/app/src/main/java/com/example/dcav2gui/InstanceInterface.java +++ b/app/src/main/java/com/example/dcav2gui/InstanceInterface.java @@ -2,10 +2,6 @@ package com.example.dcav2gui; import static com.example.dcav2gui.MainActivity.globalSettings; -import android.os.Build; - -import androidx.annotation.RequiresApi; - import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -13,10 +9,6 @@ import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import java.io.IOException; -import java.time.Instant; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -488,9 +480,6 @@ public class InstanceInterface { public static class ExchangeStatsData { - // Create an instance: ExchangeStatsData exchangeStatsData = new ExchangeStatsData(R.drawable.your_drawable, 2000, 2500, 20, 14, 6); - // Getting the drawable: Drawable drawable = getResources().getDrawable(exchangeStatsData.getSemaphore()); - private final int semaphore; private final double fundsAvailable; private final double fundsNeeded; @@ -515,4 +504,148 @@ public class InstanceInterface { public int getShortWorkers() { return shortWorkers; } } + public static class WorkerStatsData { + private final boolean isShort; + private final boolean stopWhenProfit; + private final double orderSize; + private final double quoteSpent; + private final double baseBought; + private final int soAmount; + private final int tpMode; + private final double[] profitTable; + private final double startTime; + private final double startPrice; + private final double dealStartTime; + private final double dealUptime; + private final double totalUptime; + + private final double price; + private final double takeProfitPrice; + private final double nextSoPrice; + private final String tpOrderId; + private final Order takeProfitOrder; + private final String soOrderId; + private final Order safetyOrder; + private final double feesPaidInBase; + private final double feesPaidInQuote; + private final double partialProfit; + private final double[] safetyPriceTable; + private final List dealOrderHistory; + private final String pauseReason; + private final OldLongDictionary oldLongDictionary; //Change type + private final String statusString; + + public WorkerStatsData(boolean isShort, boolean stopWhenProfit, double orderSize, double quoteSpent, double baseBought, int soAmount, int tpMode, double[] profitTable, double startTime, double startPrice, double dealStartTime, double dealUptime, double totalUptime, double price, double takeProfitPrice, double nextSoPrice, String tpOrderId, Order takeProfitOrder, String soOrderId, Order safetyOrder, double feesPaidInBase, double feesPaidInQuote, double partialProfit, double[] safetyPriceTable, List dealOrderHistory, String pauseReason, OldLongDictionary oldLong, String statusString) { + this.isShort = isShort; + this.stopWhenProfit = stopWhenProfit; + this.orderSize = orderSize; + this.quoteSpent = quoteSpent; + this.baseBought = baseBought; + this.soAmount = soAmount; + this.tpMode = tpMode; + this.profitTable = profitTable; + this.startTime = startTime; + this.startPrice = startPrice; + this.dealStartTime = dealStartTime; + this.dealUptime = dealUptime; + this.totalUptime = totalUptime; + this.price = price; + this.takeProfitPrice = takeProfitPrice; + this.nextSoPrice = nextSoPrice; + this.tpOrderId = tpOrderId; + this.takeProfitOrder = takeProfitOrder; + this.soOrderId = soOrderId; + this.safetyOrder = safetyOrder; + this.feesPaidInBase = feesPaidInBase; + this.feesPaidInQuote = feesPaidInQuote; + this.partialProfit = partialProfit; + this.safetyPriceTable = safetyPriceTable; + this.dealOrderHistory = dealOrderHistory; + this.pauseReason = pauseReason; + this.oldLongDictionary = oldLong; + this.statusString = statusString; + } + + public boolean getIsShort() { return isShort; } + public boolean getStopWhenProfit() { return stopWhenProfit; } + public double getOrderSize() { return orderSize; } + public double getQuoteSpent() { return quoteSpent; } + public double getBaseBought() { return baseBought; } + public double getSoAmount() { return soAmount; } + public int getTpMode() { return tpMode; } + public double[] getProfitTable() { return profitTable; } + public double getStartTime() { return startTime; } + public double getStartPrice() { return startPrice; } + public double getDealStartTime() { return dealStartTime; } + public double getDealUptime() { return dealUptime; } + public double getTotalUptime() { return totalUptime; } + public double getPrice() { return price; } + public double getTakeProfitPrice() { return takeProfitPrice; } + public double getNextSoPrice() { return nextSoPrice; } + public String getTpOrderId() { return tpOrderId; } + public Order getTakeProfitOrder() { return takeProfitOrder; } + public String getSoOrderId() { return soOrderId; } + public Order getSafetyOrder() { return safetyOrder; } + public double getFeesPaidInBase() { return feesPaidInBase; } + public double getFeesPaidInQuote() { return feesPaidInQuote; } + public double getPartialProfit() { return partialProfit; } + public double[] getSafetyPriceTable() { return safetyPriceTable; } + public List getDealOrderHistory() { return dealOrderHistory; } + public String getPauseReason() { return pauseReason; } + public OldLongDictionary getOldLongDictionary() { return oldLongDictionary; } + public String getStatusString() { return statusString; } + } + + public static class Order { + private final String id; + private final String status; + private final double filled; + private final double remaining; + private final double price; + private final double cost; + private final String fees; + private final String symbol; + + public Order(String id, String status, double filled, double remaining, double price, double cost, String fees, String symbol) { + this.id = id; + this.status = status; + this.filled = filled; + this.remaining = remaining; + this.price = price; + this.cost = cost; + this.fees = fees; + this.symbol = symbol; + } + + public String getId() { return id; } + public String getStatus() { return status; } + public double getFilled() { return filled; } + public double getRemaining() { return remaining; } + public double getPrice() { return price; } + public double getCost() { return cost; } + public String getFees() { return fees; } + public String getSymbol() { return symbol; } + } + + public static class OldLongDictionary { + private final String datetime; + private final double feesPaidInQuote; + private final double quoteSpent; + private final double tpAmount; + private final double tpPrice; + + public OldLongDictionary(String datetime, double feesPaidInQuote, double quoteSpent, double tpAmount, double tpPrice) { + this.datetime = datetime; + this.feesPaidInQuote = feesPaidInQuote; + this.quoteSpent = quoteSpent; + this.tpAmount = tpAmount; + this.tpPrice = tpPrice; + } + + public String getDatetime() { return datetime; } + public double getFeesPaidInQuote() { return feesPaidInQuote; } + public double getQuoteSpent() { return quoteSpent; } + public double getTpAmount() { return tpAmount; } + public double getTpPrice() { return tpPrice; } + } } \ No newline at end of file