Class Position


  • @Entity
    public class Position
    extends BaseDomain
    Position.
    • Constructor Detail

      • Position

        public Position()
    • Method Detail

      • hashCode

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

        public Long getId()
        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.
      • 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.
      • 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.
      • setId

        public void setId​(Long id)
        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.
      • 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.
      • 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.