Class OrderTypes

java.lang.Object
com.strategyquant.tradinglib.OrderTypes

public class OrderTypes extends Object
The Class OrderTypes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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
    parseMT4​(String type)
    Parses the MT 4.
    static byte
    parseMT5​(String type)
    MT5 has only Buy and Sell order types.
    static String
    toString​(byte type)
    To string.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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

      public static String toString(byte type)
      To string.
      Parameters:
      type - the type
      Returns:
      the string
    • parseMT4

      public static byte parseMT4(String type)
      Parses the MT 4.
      Parameters:
      type - the type
      Returns:
      the byte
    • parseMT5

      public static byte parseMT5(String type)
      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