Class Position


@Entity public class Position extends BaseDomain
Position (map "POSITIONS" table).
  • Constructor Details

    • Position

      public Position()
  • Method Details

    • equals

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

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • getUid

      public Long getUid()
      Technical ID.
    • getPositionId

      public Long getPositionId()
      An identifier that uniquely identifies the position for a strategy.
    • getType

      public PositionTypeDTO getType()
      Position type - Short or Long.
    • getStrategy

      public Strategy getStrategy()
      The strategy that created the position.
    • getCurrencyPair

      public String getCurrencyPair()
      The currency-pair.
    • getBaseCurrencyPrecision

      public Integer getBaseCurrencyPrecision()
      Base currency precision (First part of the currency pair).
    • getQuoteCurrencyPrecision

      public Integer getQuoteCurrencyPrecision()
      Quote currency precision (Second part of the currency pair).
    • getAmount

      public CurrencyAmount getAmount()
      Amount that was ordered.
    • getStopGainPercentageRule

      public Float getStopGainPercentageRule()
      Position rules - stop gain percentage.
    • getStopLossPercentageRule

      public Float getStopLossPercentageRule()
      Position rules - stop loss percentage.
    • getStatus

      public PositionStatusDTO getStatus()
      Position status.
    • isAutoClose

      public boolean isAutoClose()
      Indicates if the position should be closed automatically by Cassandre.
    • isForceClosing

      public boolean isForceClosing()
      Indicates that the position must be closed no matter the rules.
    • getOpeningOrder

      public Order getOpeningOrder()
      The order created to open the position.
    • getClosingOrder

      public Order getClosingOrder()
      The order created to close the position.
    • getLowestGainPrice

      public CurrencyAmount getLowestGainPrice()
      Price of the lowest gain reached by this position.
    • getHighestGainPrice

      public CurrencyAmount getHighestGainPrice()
      Price of the highest gain reached by this position.
    • getLatestGainPrice

      public CurrencyAmount getLatestGainPrice()
      Price of the latest gain price for this position.
    • setUid

      public void setUid(Long uid)
      Technical ID.
    • setPositionId

      public void setPositionId(Long positionId)
      An identifier that uniquely identifies the position for a strategy.
    • setType

      public void setType(PositionTypeDTO type)
      Position type - Short or Long.
    • setStrategy

      public void setStrategy(Strategy strategy)
      The strategy that created the position.
    • setCurrencyPair

      public void setCurrencyPair(String currencyPair)
      The currency-pair.
    • setBaseCurrencyPrecision

      public void setBaseCurrencyPrecision(Integer baseCurrencyPrecision)
      Base currency precision (First part of the currency pair).
    • setQuoteCurrencyPrecision

      public void setQuoteCurrencyPrecision(Integer quoteCurrencyPrecision)
      Quote currency precision (Second part of the currency pair).
    • setAmount

      public void setAmount(CurrencyAmount amount)
      Amount that was ordered.
    • setStopGainPercentageRule

      public void setStopGainPercentageRule(Float stopGainPercentageRule)
      Position rules - stop gain percentage.
    • setStopLossPercentageRule

      public void setStopLossPercentageRule(Float stopLossPercentageRule)
      Position rules - stop loss percentage.
    • setStatus

      public void setStatus(PositionStatusDTO status)
      Position status.
    • setAutoClose

      public void setAutoClose(boolean autoClose)
      Indicates if the position should be closed automatically by Cassandre.
    • setForceClosing

      public void setForceClosing(boolean forceClosing)
      Indicates that the position must be closed no matter the rules.
    • setOpeningOrder

      public void setOpeningOrder(Order openingOrder)
      The order created to open the position.
    • setClosingOrder

      public void setClosingOrder(Order closingOrder)
      The order created to close the position.
    • setLowestGainPrice

      public void setLowestGainPrice(CurrencyAmount lowestGainPrice)
      Price of the lowest gain reached by this position.
    • setHighestGainPrice

      public void setHighestGainPrice(CurrencyAmount highestGainPrice)
      Price of the highest gain reached by this position.
    • setLatestGainPrice

      public void setLatestGainPrice(CurrencyAmount latestGainPrice)
      Price of the latest gain price for this position.
    • toString

      public String toString()
      Overrides:
      toString in class BaseDomain