Class GainDTO

java.lang.Object
tech.cassandre.trading.bot.dto.util.GainDTO

public final class GainDTO extends Object
Gain.
  • Field Details

    • ZERO

      public static final GainDTO ZERO
      Zero gain constant.
  • Method Details

    • getFees

      public List<CurrencyAmountDTO> getFees()
      Returns the fees from opening and closing orders.
      Returns:
      fees from opening and closing orders
    • getFeesByCurrency

      public Map<CurrencyDTO,CurrencyAmountDTO> getFeesByCurrency()
      Returns the sum of fees from opening and closing orders by currency.
      Returns:
      fees
    • isInferiorTo

      public boolean isInferiorTo(@NonNull @NonNull GainDTO other)
      Returns true if the current gain is inferior to the gain passed as a parameter.
      Parameters:
      other - other gain
      Returns:
      true if this gain is inferior to the gain passed as a parameter
    • isSuperiorTo

      public boolean isSuperiorTo(@NonNull @NonNull GainDTO other)
      Returns true if the current gain is superior to the gain passed as a parameter.
      Parameters:
      other - other gain
      Returns:
      true if this gain is superior to the gain passed as a parameter
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static GainDTO.GainDTOBuilder builder()
    • getPercentage

      public double getPercentage()
      Gain made (percentage).
    • getAmount

      public CurrencyAmountDTO getAmount()
      Gain made (amount).
    • getOpeningOrderFees

      public List<CurrencyAmountDTO> getOpeningOrderFees()
      Opening order fees (list coming from trade fees).
    • getClosingOrderFees

      public List<CurrencyAmountDTO> getClosingOrderFees()
      Closing order fees (list coming from trade fees).