Package com.strategyquant.tradinglib
Class OrderTypes
java.lang.Object
com.strategyquant.tradinglib.OrderTypes
The Class OrderTypes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic byteThe Constant Any.static byteThe Constant Balance.static byteThe Constant Buy.static byteThe Constant BuyLimit.static byteThe Constant BuyStop.static byteThe Constant BuyStopLimit.static byteThe Constant BuyToCoverLimit.static byteThe Constant BuyToCoverStop.static byteThe Constant Deposit.static byteThe Constant Sell.static byteThe Constant SellLimit.static byteThe Constant SellStop.static byteThe Constant SellStopLimit.static byteThe Constant SellToCoverLimit.static byteThe Constant SellToCoverStop.static byteThe Constant Withdrawal. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareOppositeOrders(byte tradeType1, byte tradeType2)static bytegetOppositeType(byte tradeType)Gets the opposite type.static booleanisLimitOrder(byte orderType)Checks if is limit order.static booleanisLongOrder(byte tradeType)Checks if is long order.static booleanisMarketOrder(byte tradeType)Checks if is market order.static booleanisShortOrder(byte tradeType)Checks if is short order.static booleanisStopOrder(byte orderType)Checks if is stop order.static byteParses the MT 4.static byteMT5 has only Buy and Sell order types.static StringtoString(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
-