Package com.strategyquant.tradinglib
Class OrderTypes
java.lang.Object
com.strategyquant.tradinglib.OrderTypes
The Class OrderTypes.
-
Field Summary
Modifier and TypeFieldDescriptionstatic byte
The Constant Any.static byte
The Constant Balance.static byte
The Constant Buy.static byte
The Constant BuyLimit.static byte
The Constant BuyStop.static byte
The Constant BuyStopLimit.static byte
The Constant BuyToCoverLimit.static byte
The Constant BuyToCoverStop.static byte
The Constant Deposit.static byte
The Constant Sell.static byte
The Constant SellLimit.static byte
The Constant SellStop.static byte
The Constant SellStopLimit.static byte
The Constant SellToCoverLimit.static byte
The Constant SellToCoverStop.static byte
The Constant Withdrawal. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areOppositeOrders(byte tradeType1, byte tradeType2)
static byte
getOppositeType(byte tradeType)
Gets the opposite type.static boolean
isLimitOrder(byte orderType)
Checks if is limit order.static boolean
isLongOrder(byte tradeType)
Checks if is long order.static boolean
isMarketOrder(byte tradeType)
Checks if is market order.static boolean
isShortOrder(byte tradeType)
Checks if is short order.static boolean
isStopOrder(byte orderType)
Checks if is stop order.static byte
Parses the MT 4.static byte
MT5 has only Buy and Sell order types.static String
toString(byte type)
To string.
-
Field Details
-
Any
public static final byte AnyThe Constant Any.- See Also:
- Constant Field Values
-
Buy
public static final byte BuyThe Constant Buy.- See Also:
- Constant Field Values
-
Sell
public static final byte SellThe Constant Sell.- See Also:
- Constant Field Values
-
BuyLimit
public static final byte BuyLimitThe Constant BuyLimit.- See Also:
- Constant Field Values
-
SellLimit
public static final byte SellLimitThe Constant SellLimit.- See Also:
- Constant Field Values
-
BuyStop
public static final byte BuyStopThe Constant BuyStop.- See Also:
- Constant Field Values
-
SellStop
public static final byte SellStopThe Constant SellStop.- See Also:
- Constant Field Values
-
BuyStopLimit
public static final byte BuyStopLimitThe Constant BuyStopLimit.- See Also:
- Constant Field Values
-
SellStopLimit
public static final byte SellStopLimitThe Constant SellStopLimit.- See Also:
- Constant Field Values
-
Deposit
public static final byte DepositThe Constant Deposit.- See Also:
- Constant Field Values
-
Withdrawal
public static final byte WithdrawalThe Constant Withdrawal.- See Also:
- Constant Field Values
-
Balance
public static final byte BalanceThe Constant Balance.- See Also:
- Constant Field Values
-
BuyToCoverStop
public static final byte BuyToCoverStopThe Constant BuyToCoverStop.- See Also:
- Constant Field Values
-
BuyToCoverLimit
public static final byte BuyToCoverLimitThe Constant BuyToCoverLimit.- See Also:
- Constant Field Values
-
SellToCoverStop
public static final byte SellToCoverStopThe Constant SellToCoverStop.- See Also:
- Constant Field Values
-
SellToCoverLimit
public static final byte SellToCoverLimitThe Constant SellToCoverLimit.- See Also:
- Constant Field Values
-
-
Constructor Details
-
OrderTypes
public OrderTypes()
-
-
Method Details
-
isMarketOrder
public static boolean isMarketOrder(byte tradeType)Checks if is market order.- Parameters:
tradeType
- the trade type- Returns:
- true, if is market order
-
isLongOrder
public static boolean isLongOrder(byte tradeType)Checks if is long order.- Parameters:
tradeType
- the trade type- Returns:
- true, if is long order
-
isShortOrder
public static boolean isShortOrder(byte tradeType)Checks if is short order.- Parameters:
tradeType
- the trade type- Returns:
- true, if is short order
-
areOppositeOrders
public static boolean areOppositeOrders(byte tradeType1, byte tradeType2) -
getOppositeType
public static byte getOppositeType(byte tradeType)Gets the opposite type.- Parameters:
tradeType
- the trade type- Returns:
- the opposite type
-
toString
To string.- Parameters:
type
- the type- Returns:
- the string
-
parseMT4
Parses the MT 4.- Parameters:
type
- the type- Returns:
- the byte
-
parseMT5
MT5 has only Buy and Sell order types.- Parameters:
type
- the type- Returns:
- the byte
-
isStopOrder
public static boolean isStopOrder(byte orderType)Checks if is stop order.- Parameters:
orderType
- the order type- Returns:
- true, if is stop order
-
isLimitOrder
public static boolean isLimitOrder(byte orderType)Checks if is limit order.- Parameters:
orderType
- the order type- Returns:
- true, if is limit order
-