Class Order

java.lang.Object
com.strategyquant.tradinglib.Order
All Implemented Interfaces:
Serializable

public class Order extends Object implements Serializable
The Class Order.
See Also:
Serialized Form
  • Field Details

    • NOT_DEFINED

      public static final int NOT_DEFINED
      The Constant PL_NOT_DEFINED.
      See Also:
      Constant Field Values
    • Symbol

      public String Symbol
      The Symbol.
    • SetupName

      public String SetupName
      The Setup name.
    • StrategyName

      public String StrategyName
      The Strategy name.
    • Comment

      public String Comment
      The Comment.
    • Ticket

      public int Ticket
      The Ticket.
    • Order

      public int Order
      The Order.
    • Type

      public byte Type
      The Type.
    • CloseType

      public byte CloseType
      The Close type.
    • SampleType

      public byte SampleType
      The Sample type.
    • OriginalOpenTime

      public long OriginalOpenTime
      The Original open time.
    • OriginalType

      public byte OriginalType
      The Original type.
    • MagicNumber

      public int MagicNumber
      The Magic number.
    • Size

      public float Size
      The Size.
    • OriginalPrice

      public float OriginalPrice
      The Original price.
    • OpenTime

      public long OpenTime
      The Open time.
    • OpenPrice

      public float OpenPrice
      The Open price.
    • CloseTime

      public long CloseTime
      The Close time.
    • ClosePrice

      public float ClosePrice
      The Close price.
    • StopLoss

      public float StopLoss
      The Stop loss.
    • TakeProfit

      public float TakeProfit
      The Take profit.
    • Duration

      public int Duration
      The Duration.
    • BarsInTrade

      public short BarsInTrade
      The Bars in trade.
    • PL

      public float PL
      The pl.
    • PctPL

      public float PctPL
      The Pct PL.
    • PctPL_TWR

      public float PctPL_TWR
      The Pct P L TWR.
    • PipsPL

      public float PipsPL
      The Pips PL.
    • DD

      public float DD
      The dd.
    • PctDD

      public float PctDD
      The Pct DD.
    • PipsDD

      public float PipsDD
      The Pips DD.
    • CommSwap

      public float CommSwap
      The Comm swap.
    • CommSwapApplied

      public boolean CommSwapApplied
      The Comm swap applied.
    • MAE

      public float MAE
      The mae.
    • PipsMAE

      public float PipsMAE
      The Pips MAE.
    • MFE

      public float MFE
      The mfe.
    • PipsMFE

      public float PipsMFE
      The Pips MFE.
    • AccountBalance

      public float AccountBalance
      The Account balance.
    • PctAccountBalance

      public float PctAccountBalance
      The Pct account balance.
    • PipsAccountBalance

      public float PipsAccountBalance
      The Pips account balance.
    • AccountBalanceTemp

      public float AccountBalanceTemp
      The Account balance temp.
    • Extra1

      public float Extra1
      The Extra 1.
    • IsInPortfolio

      public byte IsInPortfolio
      The Is in portfolio.
    • worstDailyEquity

      public float worstDailyEquity
      The worst daily equity.
    • SlippageInMoney

      public float SlippageInMoney
      The Slippage in money.
    • ExitIndex

      public byte ExitIndex
      index of exit (if applicable)
    • ATROnOpen

      public float ATROnOpen
      ATR(14) on open of the trade
  • Constructor Details

    • Order

      public Order()
      Instantiates a new order.
    • Order

      public Order(ILiveOrder liveOrder)
      Instantiates a new order.
      Parameters:
      liveOrder - the live order
    • Order

      public Order(Order o)
      Instantiates a new order.
      Parameters:
      o - the o
  • Method Details

    • setFromLiveOrder

      public void setFromLiveOrder(ILiveOrder liveOrder)
      Sets the from live order.
      Parameters:
      liveOrder - the new from live order
    • isBalanceOrder

      public boolean isBalanceOrder()
      Checks if is balance order.
      Returns:
      true, if is balance order
    • isCanceledOrder

      public boolean isCanceledOrder()
      Checks if is cancelled order.
      Returns:
      true, if is cancelled order
    • isPendingOrder

      public boolean isPendingOrder()
      Checks if is pending order.
      Returns:
      true, if is pending order
    • getPLByType

      public float getPLByType(byte plType)
      Gets the pl.
      Parameters:
      plType - the pl type
      Returns:
      the pl
    • getDDByType

      public float getDDByType(byte plType)
      Gets the dd.
      Parameters:
      plType - the pl type
      Returns:
      the dd
    • getTimeByPeriodType

      public long getTimeByPeriodType(byte tradePeriod)
      Gets the time.
      Parameters:
      tradePeriod - the trade period
      Returns:
      the time
    • isLong

      public boolean isLong()
      Checks if is long.
      Returns:
      true, if is long
    • isShort

      public boolean isShort()
      Checks if is short.
      Returns:
      true, if is short
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string
    • isRealOrder

      public boolean isRealOrder()
      Checks if is real order.
      Returns:
      true, if is real order
    • isFilledOrder

      public boolean isFilledOrder()
      Checks if is filled order.
      Returns:
      true, if is filled order
    • setFromOrder

      public void setFromOrder(Order o)
      Sets the from order.
      Parameters:
      o - the new from order
    • getDirection

      public int getDirection()
      Gets the direction.
      Returns:
      the direction