Class Position
java.lang.Object
tech.cassandre.trading.bot.util.base.domain.BaseDomain
tech.cassandre.trading.bot.domain.Position
Position (map "POSITIONS" table).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Amount that was ordered.Base currency precision (First part of the currency pair).The order created to close the position.The currency-pair.Price of the highest gain reached by this position.Price of the latest gain price for this position.Price of the lowest gain reached by this position.The order created to open the position.An identifier that uniquely identifies the position for a strategy.Quote currency precision (Second part of the currency pair).Position status.Position rules - stop gain percentage.Position rules - stop loss percentage.The strategy that created the position.getType()
Position type - Short or Long.getUid()
Technical ID.final int
hashCode()
boolean
Indicates if the position should be closed automatically by Cassandre.boolean
Indicates that the position must be closed no matter the rules.void
setAmount
(CurrencyAmount amount) Amount that was ordered.void
setAutoClose
(boolean autoClose) Indicates if the position should be closed automatically by Cassandre.void
setBaseCurrencyPrecision
(Integer baseCurrencyPrecision) Base currency precision (First part of the currency pair).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
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
setQuoteCurrencyPrecision
(Integer quoteCurrencyPrecision) Quote currency precision (Second part of the currency pair).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.void
Technical ID.toString()
Methods inherited from class tech.cassandre.trading.bot.util.base.domain.BaseDomain
getCreatedOn, getUpdatedOn, setCreatedOn, setUpdatedOn
-
Constructor Details
-
Position
public Position()
-
-
Method Details
-
equals
-
hashCode
public final int hashCode() -
getUid
Technical ID. -
getPositionId
An identifier that uniquely identifies the position for a strategy. -
getType
Position type - Short or Long. -
getStrategy
The strategy that created the position. -
getCurrencyPair
The currency-pair. -
getBaseCurrencyPrecision
Base currency precision (First part of the currency pair). -
getQuoteCurrencyPrecision
Quote currency precision (Second part of the currency pair). -
getAmount
Amount that was ordered. -
getStopGainPercentageRule
Position rules - stop gain percentage. -
getStopLossPercentageRule
Position rules - stop loss percentage. -
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
The order created to open the position. -
getClosingOrder
The order created to close the position. -
getLowestGainPrice
Price of the lowest gain reached by this position. -
getHighestGainPrice
Price of the highest gain reached by this position. -
getLatestGainPrice
Price of the latest gain price for this position. -
setUid
Technical ID. -
setPositionId
An identifier that uniquely identifies the position for a strategy. -
setType
Position type - Short or Long. -
setStrategy
The strategy that created the position. -
setCurrencyPair
The currency-pair. -
setBaseCurrencyPrecision
Base currency precision (First part of the currency pair). -
setQuoteCurrencyPrecision
Quote currency precision (Second part of the currency pair). -
setAmount
Amount that was ordered. -
setStopGainPercentageRule
Position rules - stop gain percentage. -
setStopLossPercentageRule
Position rules - stop loss percentage. -
setStatus
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
The order created to open the position. -
setClosingOrder
The order created to close the position. -
setLowestGainPrice
Price of the lowest gain reached by this position. -
setHighestGainPrice
Price of the highest gain reached by this position. -
setLatestGainPrice
Price of the latest gain price for this position. -
toString
- Overrides:
toString
in classBaseDomain
-