OrderType
Represents the type/role of an order within a bracket family. ENTRY - The initial order that opens the position TAKE_PROFIT - The limit order to close at profit target STOP_LOSS - The stop order to close at maximum loss
OrderType.java
package com.bookmap.ordermanagement.model;
/**
* Represents the type/role of an order within a bracket family.
*
* ENTRY - The initial order that opens the position
* TAKE_PROFIT - The limit order to close at profit target
* STOP_LOSS - The stop order to close at maximum loss
*/
public enum OrderType {
ENTRY("ENTRY", true),
TAKE_PROFIT("TP", false),
STOP_LOSS("SL", false);
private final String shortName;
private final boolean isEntry;
OrderType(String shortName, boolean isEntry) {
this.shortName = shortName;
this.isEntry = isEntry;
}
/**
* Returns a short name for logging (ENTRY, TP, SL).
*/
public String getShortName() {
return shortName;
}
/**
* Returns true if this is an entry order.
*/
public boolean isEntry() {
return isEntry;
}
/**
* Returns true if this is an exit order (TP or SL).
*/
public boolean isExit() {
return !isEntry;
}
@Override
public String toString() {
return shortName;
}
}