Interface ILiveOrder


public interface ILiveOrder
LiveOrder Interface - has methods to call actions over live order.
  • Method Details

    • getSL

      double getSL()
      method returns the active Stop Loss of this order.
      Returns:
      the sl
    • getSLType

      byte getSLType()
      method returns the active Stop Loss Type of this order. It is a constant from SlPtTypes
      Returns:
      the SL type
    • setSL

      ILiveOrder setSL(double priceLevel)
      Sets the SL.
      Parameters:
      priceLevel - the price level
      Returns:
      the i live order
    • setSL

      ILiveOrder setSL(byte slType, double value)
      Sets the SL.
      Parameters:
      slType - the sl type
      value - the value
      Returns:
      the i live order
    • setSLType

      ILiveOrder setSLType(byte slType)
      Sets the SL type.
      Parameters:
      slType - the sl type
      Returns:
      the i live order
    • getPT

      double getPT()
      method returns the active Profit Target of this order.
      Returns:
      the pt
    • setPT

      ILiveOrder setPT(double priceLevel)
      Sets the PT.
      Parameters:
      priceLevel - the price level
      Returns:
      the i live order
    • setPT

      ILiveOrder setPT(byte ptType, double value)
      Sets the PT.
      Parameters:
      ptType - the pt type
      value - the value
      Returns:
      the i live order
    • getComment

      String getComment()
      Gets the comment.
      Returns:
      the comment
    • setComment

      ILiveOrder setComment(String comment)
      Sets the comment.
      Parameters:
      comment - the comment
      Returns:
      the i live order
    • getMagicNumber

      int getMagicNumber()
      Gets the magic number.
      Returns:
      the magic number
    • setMagicNumber

      ILiveOrder setMagicNumber(int magicNumber)
      Sets the magic number.
      Parameters:
      magicNumber - the magic number
      Returns:
      the i live order
    • getMaxSlippage

      double getMaxSlippage()
      Gets the max slippage.
      Returns:
      the max slippage
    • setMaxSlippage

      ILiveOrder setMaxSlippage(double maxSlippage)
      Sets the max slippage.
      Parameters:
      maxSlippage - the max slippage
      Returns:
      the i live order
    • getExpiration

      long getExpiration()
      Gets the expiration.
      Returns:
      the expiration
    • setExpiration

      ILiveOrder setExpiration(long expirationDate)
      Sets the expiration.
      Parameters:
      expirationDate - the expiration date
      Returns:
      the i live order
    • getSymbolHash

      int getSymbolHash()
      Gets the symbol hash.
      Returns:
      the symbol hash
    • getSymbol

      String getSymbol()
      Gets the symbol.
      Returns:
      the symbol
    • getOrderType

      byte getOrderType()
      Gets the order type.
      Returns:
      the order type
    • getCloseType

      byte getCloseType()
      Gets the close type.
      Returns:
      the close type
    • getOriginalOrderType

      byte getOriginalOrderType()
      Gets the original order type.
      Returns:
      the original order type
    • getOpenTime

      long getOpenTime()
      Gets the open time.
      Returns:
      the open time
    • getOpenPrice

      double getOpenPrice()
      Gets the open price.
      Returns:
      the open price
    • getOrderId

      int getOrderId()
      Gets the order id.
      Returns:
      the order id
    • getClosePrice

      double getClosePrice()
      Gets the close price.
      Returns:
      the close price
    • isSuccessful

      boolean isSuccessful()
      Checks if is successful.
      Returns:
      true, if is successful
    • getBarsInTrade

      int getBarsInTrade()
      Gets the bars in trade.
      Returns:
      the bars in trade
    • getCloseTime

      long getCloseTime()
      Gets the close time.
      Returns:
      the close time
    • getSize

      double getSize()
      Gets the size.
      Returns:
      the size
    • Send

      Send.
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • SendAsync

      ILiveOrder SendAsync() throws TradingException
      Send async.
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • SendAsync

      ILiveOrder SendAsync(com.strategyquant.tradinglib.event.ITradingEventListener orderEventListener) throws TradingException
      Send async.
      Parameters:
      orderEventListener - the order event listener
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • isModified

      boolean isModified()
      checks if something in the order (SL or PT) was modified.
      Returns:
      true, if is modified
    • ModifyAsync

      ILiveOrder ModifyAsync() throws TradingException
      Modify async.
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • ModifyAsync

      ILiveOrder ModifyAsync(com.strategyquant.tradinglib.event.ITradingEventListener orderEventListener) throws TradingException
      Modify async.
      Parameters:
      orderEventListener - the order event listener
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • Close

      ILiveOrder Close(byte closeType) throws TradingException
      Close.
      Parameters:
      closeType - the close type
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • CloseAsync

      ILiveOrder CloseAsync() throws TradingException
      Close async.
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • CloseAsync

      ILiveOrder CloseAsync(com.strategyquant.tradinglib.event.ITradingEventListener orderEventListener) throws TradingException
      Close async.
      Parameters:
      orderEventListener - the order event listener
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • getWorkingStatus

      byte getWorkingStatus()
      Gets the working status.
      Returns:
      the working status
    • getPositionStatus

      byte getPositionStatus()
      Gets the position status.
      Returns:
      the position status
    • getStrategyName

      String getStrategyName()
      Gets the strategy name.
      Returns:
      the strategy name
    • getSetupName

      String getSetupName()
      Gets the setup name.
      Returns:
      the setup name
    • setSize

      ILiveOrder setSize(double quantity)
      Sets the size.
      Parameters:
      quantity - the quantity
      Returns:
      the i live order
    • computeSizeIfMissing

      ILiveOrder computeSizeIfMissing() throws TradingException
      Compute size if missing.
      Returns:
      the i live order
      Throws:
      TradingException - the trading exception
    • refuse

      void refuse(String reason)
      Refuse.
      Parameters:
      reason - the reason
    • isRefused

      boolean isRefused()
      Checks if is refused.
      Returns:
      true, if is refused
    • getDirection

      int getDirection()
      Gets the direction.
      Returns:
      the direction
    • getOriginalOpenPrice

      double getOriginalOpenPrice()
      Gets the original open price.
      Returns:
      the original open price
    • getOriginalOpenTime

      long getOriginalOpenTime()
      Gets the original open time.
      Returns:
      the original open time
    • isPendingOrder

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

      boolean isMarketOrder()
      Checks if is market order.
      Returns:
      true, if is market order
    • isClosedOrder

      boolean isClosedOrder()
      Checks if is closed order.
      Returns:
      true, if is closed order
    • getInstrumentInfo

      InstrumentInfo getInstrumentInfo()
      Gets the instrument info.
      Returns:
      the instrument info
    • getErrorCode

      int getErrorCode()
      Gets the error code.
      Returns:
      the error code
    • getErrorMessage

      String getErrorMessage()
      Gets the error message.
      Returns:
      the error message
    • getPL

      double getPL()
      Gets the pl.
      Returns:
      the pl
    • getPLInPips

      double getPLInPips()
      Gets the PL in pips.
      Returns:
      the PL in pips
    • isLong

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

      double getCommSwap()
      Gets the comm swap.
      Returns:
      the comm swap
    • getMAE

      float getMAE()
      Gets the mae.
      Returns:
      the mae
    • getMFE

      float getMFE()
      Gets the mfe.
      Returns:
      the mfe
    • isFilled

      boolean isFilled()
      Checks if is filled.
      Returns:
      true, if is filled
    • isNettingMode

      boolean isNettingMode()
      Checks if is netting mode.
      Returns:
      true, if is netting mode
    • getLastOpenPrice

      double getLastOpenPrice()
      Gets the last open price.
      Returns:
      the last open price
    • registerEvent

      void registerEvent(int eventType, IActionEventListener iActionEventListener) throws TradingException
      Register event.
      Parameters:
      eventType - the event type
      iActionEventListener - the i action event listener
      Throws:
      TradingException - the trading exception
    • getSlippageInMoney

      float getSlippageInMoney()
      Gets the slippage in money.
      Returns:
      the slippage in money
    • getInitialSL

      double getInitialSL()
      Gets the initial SL.
      Returns:
      the initial SL
    • setExitIndex

      ILiveOrder setExitIndex(byte exitIndex)
    • getExitIndex

      byte getExitIndex()
    • usesATM

      boolean usesATM()
    • getATROnOpen

      float getATROnOpen()