Class PositionRulesDTO
- java.lang.Object
-
- tech.cassandre.trading.bot.dto.position.PositionRulesDTO
-
public class PositionRulesDTO extends Object
Position rules forPositionDTO
. It is used to know if cassandre should close a position. Supported rules : - Stop gain with percentage. - Stop loss with percentage.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PositionRulesDTO.Builder
Builder.
-
Constructor Summary
Constructors Modifier Constructor Description protected
PositionRulesDTO(PositionRulesDTO.Builder builder)
Builder constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PositionRulesDTO.Builder
builder()
Returns builder.float
getStopGainPercentage()
Getter for stopGainPercentage.float
getStopLossPercentage()
Getter for stopLossPercentage.boolean
isStopGainPercentageSet()
Getter for stopGainPercentageSet.boolean
isStopLossPercentageSet()
Getter for stopLossPercentageSet.String
toString()
-
-
-
Constructor Detail
-
PositionRulesDTO
protected PositionRulesDTO(PositionRulesDTO.Builder builder)
Builder constructor.- Parameters:
builder
- Builder.
-
-
Method Detail
-
builder
public static PositionRulesDTO.Builder builder()
Returns builder.- Returns:
- builder
-
isStopGainPercentageSet
public final boolean isStopGainPercentageSet()
Getter for stopGainPercentageSet.- Returns:
- stopGainPercentageSet
-
getStopGainPercentage
public final float getStopGainPercentage()
Getter for stopGainPercentage.- Returns:
- stopGainPercentage
-
isStopLossPercentageSet
public final boolean isStopLossPercentageSet()
Getter for stopLossPercentageSet.- Returns:
- stopLossPercentageSet
-
getStopLossPercentage
public final float getStopLossPercentage()
Getter for stopLossPercentage.- Returns:
- stopLossPercentage
-
-