Class Position
- java.lang.Object
-
- tech.cassandre.trading.bot.util.base.domain.BaseDomain
-
- tech.cassandre.trading.bot.domain.Position
-
@Entity public class Position extends BaseDomain
Position.
-
-
Constructor Summary
Constructors Constructor Description Position()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
CurrencyAmount
getAmount()
Amount that was ordered.Order
getClosingOrder()
The order created to close the position.String
getCurrencyPair()
The currency-pair.CurrencyAmount
getHighestGainPrice()
Price of the highest gain reached by this position.Long
getId()
Technical ID.CurrencyAmount
getLatestGainPrice()
Price of the latest gain price for this position.CurrencyAmount
getLowestGainPrice()
Price of the lowest gain reached by this position.Order
getOpeningOrder()
The order created to open the position.Long
getPositionId()
An identifier that uniquely identifies the position for a strategy.PositionStatusDTO
getStatus()
Position status.Float
getStopGainPercentageRule()
Position rules - stop gain percentage.Float
getStopLossPercentageRule()
Position rules - stop loss percentage.Strategy
getStrategy()
The strategy that created the position.PositionTypeDTO
getType()
Position type - Short or Long.int
hashCode()
boolean
isForceClosing()
Indicates that the position must be closed no matter the rules.void
setAmount(CurrencyAmount amount)
Amount that was ordered.void
setClosingOrder(Order closingOrder)
The order created to close the position.void
setCurrencyPair(String currencyPair)
The currency-pair.void
setForceClosing(boolean forceClosing)
Indicates that the position must be closed no matter the rules.void
setHighestGainPrice(CurrencyAmount highestGainPrice)
Price of the highest gain reached by this position.void
setId(Long id)
Technical ID.void
setLatestGainPrice(CurrencyAmount latestGainPrice)
Price of the latest gain price for this position.void
setLowestGainPrice(CurrencyAmount lowestGainPrice)
Price of the lowest gain reached by this position.void
setOpeningOrder(Order openingOrder)
The order created to open the position.void
setPositionId(Long positionId)
An identifier that uniquely identifies the position for a strategy.void
setStatus(PositionStatusDTO status)
Position status.void
setStopGainPercentageRule(Float stopGainPercentageRule)
Position rules - stop gain percentage.void
setStopLossPercentageRule(Float stopLossPercentageRule)
Position rules - stop loss percentage.void
setStrategy(Strategy strategy)
The strategy that created the position.void
setType(PositionTypeDTO type)
Position type - Short or Long.String
toString()
-
Methods inherited from class tech.cassandre.trading.bot.util.base.domain.BaseDomain
getCreatedOn, getUpdatedOn, setCreatedOn, setUpdatedOn
-
-
-
-
Method Detail
-
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.
-
getStatus
public PositionStatusDTO getStatus()
Position status.
-
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.
-
setStatus
public void setStatus(PositionStatusDTO status)
Position status.
-
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 classBaseDomain
-
-