Class PositionDTO.PositionDTOBuilder
- java.lang.Object
-
- tech.cassandre.trading.bot.dto.position.PositionDTO.PositionDTOBuilder
-
- Enclosing class:
- PositionDTO
public static class PositionDTO.PositionDTOBuilder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PositionDTO.PositionDTOBuilder
amount(CurrencyAmountDTO amount)
Position amount.PositionDTO
build()
PositionDTO.PositionDTOBuilder
closingOrder(OrderDTO closingOrder)
The order created to close the position.PositionDTO.PositionDTOBuilder
currencyPair(CurrencyPairDTO currencyPair)
Currency pair.PositionDTO.PositionDTOBuilder
forceClosing(boolean forceClosing)
Indicates that the position must be closed no matter the rules.PositionDTO.PositionDTOBuilder
highestGainPrice(CurrencyAmountDTO highestGainPrice)
Price of the highest gain reached by this position.PositionDTO.PositionDTOBuilder
id(long id)
Technical ID.PositionDTO.PositionDTOBuilder
latestGainPrice(CurrencyAmountDTO latestGainPrice)
Price of the latest gain price for this position.PositionDTO.PositionDTOBuilder
lowestGainPrice(CurrencyAmountDTO lowestGainPrice)
Price of the lowest gain reached by this position.PositionDTO.PositionDTOBuilder
openingOrder(OrderDTO openingOrder)
The order created to open the position.PositionDTO.PositionDTOBuilder
positionId(long positionId)
An identifier that uniquely identifies the position.PositionDTO.PositionDTOBuilder
rules(PositionRulesDTO rules)
Position rules.PositionDTO.PositionDTOBuilder
strategy(StrategyDTO strategy)
The strategy that created the position.String
toString()
PositionDTO.PositionDTOBuilder
type(PositionTypeDTO type)
Position type (Long or Short).
-
-
-
Method Detail
-
id
public PositionDTO.PositionDTOBuilder id(long id)
Technical ID.- Returns:
this
.
-
positionId
public PositionDTO.PositionDTOBuilder positionId(long positionId)
An identifier that uniquely identifies the position.- Returns:
this
.
-
type
public PositionDTO.PositionDTOBuilder type(PositionTypeDTO type)
Position type (Long or Short).- Returns:
this
.
-
strategy
public PositionDTO.PositionDTOBuilder strategy(StrategyDTO strategy)
The strategy that created the position.- Returns:
this
.
-
currencyPair
public PositionDTO.PositionDTOBuilder currencyPair(CurrencyPairDTO currencyPair)
Currency pair.- Returns:
this
.
-
amount
public PositionDTO.PositionDTOBuilder amount(CurrencyAmountDTO amount)
Position amount.- Returns:
this
.
-
rules
public PositionDTO.PositionDTOBuilder rules(PositionRulesDTO rules)
Position rules.- Returns:
this
.
-
forceClosing
public PositionDTO.PositionDTOBuilder forceClosing(boolean forceClosing)
Indicates that the position must be closed no matter the rules.- Returns:
this
.
-
openingOrder
public PositionDTO.PositionDTOBuilder openingOrder(OrderDTO openingOrder)
The order created to open the position.- Returns:
this
.
-
closingOrder
public PositionDTO.PositionDTOBuilder closingOrder(OrderDTO closingOrder)
The order created to close the position.- Returns:
this
.
-
lowestGainPrice
public PositionDTO.PositionDTOBuilder lowestGainPrice(CurrencyAmountDTO lowestGainPrice)
Price of the lowest gain reached by this position.- Returns:
this
.
-
highestGainPrice
public PositionDTO.PositionDTOBuilder highestGainPrice(CurrencyAmountDTO highestGainPrice)
Price of the highest gain reached by this position.- Returns:
this
.
-
latestGainPrice
public PositionDTO.PositionDTOBuilder latestGainPrice(CurrencyAmountDTO latestGainPrice)
Price of the latest gain price for this position.- Returns:
this
.
-
build
public PositionDTO build()
-
-