com.lmax.api.order
Class LimitOrderSpecification

java.lang.Object
  extended by com.lmax.api.internal.order.AbstractOrderSpecification
      extended by com.lmax.api.order.LimitOrderSpecification
All Implemented Interfaces:
com.lmax.api.internal.Request, OrderSpecification

public final class LimitOrderSpecification
extends com.lmax.api.internal.order.AbstractOrderSpecification

Limit Order Request.


Constructor Summary
LimitOrderSpecification(long instrumentId, FixedPointNumber price, FixedPointNumber quantity, TimeInForce timeInForce)
          Construct a limit order request with no stops.
LimitOrderSpecification(long instrumentId, FixedPointNumber price, FixedPointNumber quantity, TimeInForce timeInForce, FixedPointNumber stopLossPriceOffset, FixedPointNumber stopProfitPriceOffset)
          Construct a limit order request.
LimitOrderSpecification(long instrumentId, java.lang.String instructionId, FixedPointNumber price, FixedPointNumber quantity, TimeInForce timeInForce)
          Construct a limit order request with no stops.
LimitOrderSpecification(long instrumentId, java.lang.String instructionId, FixedPointNumber price, FixedPointNumber quantity, TimeInForce timeInForce, FixedPointNumber stopLossPriceOffset, FixedPointNumber stopProfitPriceOffset)
          Construct a limit order request.
 
Method Summary
protected  FixedPointNumber getPrice()
           
 void setPrice(FixedPointNumber price)
          Set the price of the limit order specification to the specified value.
 java.lang.String toString()
          A readable String representation of the LimitOrderSpecification.
 
Methods inherited from class com.lmax.api.internal.order.AbstractOrderSpecification
getUri, setInstructionId, setInstrumentId, setQuantity, setStopLossPriceOffset, setStopProfitPriceOffset, setTimeInForce, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LimitOrderSpecification

public LimitOrderSpecification(long instrumentId,
                               java.lang.String instructionId,
                               FixedPointNumber price,
                               FixedPointNumber quantity,
                               TimeInForce timeInForce,
                               FixedPointNumber stopLossPriceOffset,
                               FixedPointNumber stopProfitPriceOffset)
Construct a limit order request.

Parameters:
instrumentId - The id of the instrument for the order book to place the order onto.
instructionId - The user-defined correlation id
price - The price order the limit order
quantity - The quantity to trade. A signed value, where the sign indicates the side of the market that order is placed. Positive implies a buy order, where as negative is a sell
timeInForce - The time in force policy for the limit order.
stopLossPriceOffset - This is meant to be an OFFSET not a ABSOLUTE price. The system will cap the offset value to keep it within bounds for the instrument. Use null if you do not want to specify a stop.
stopProfitPriceOffset - This is meant to be an OFFSET not a ABSOLUTE price. The system will cap the offset value to keep it within bounds for the instrument. Use null if you do not want to specify a stop.

LimitOrderSpecification

public LimitOrderSpecification(long instrumentId,
                               FixedPointNumber price,
                               FixedPointNumber quantity,
                               TimeInForce timeInForce,
                               FixedPointNumber stopLossPriceOffset,
                               FixedPointNumber stopProfitPriceOffset)
Construct a limit order request.

Parameters:
instrumentId - The id of the instrument for the order book to place the order onto.
price - The price order the limit order
quantity - The quantity to trade. A signed value, where the sign indicates the side of the market that order is placed. Positive implies a buy order, where as negative is a sell
timeInForce - The time in force policy for the limit order.
stopLossPriceOffset - This is meant to be an OFFSET not a ABSOLUTE price. The system will cap the offset value to keep it within bounds for the instrument. Use null if you do not want to specify a stop.
stopProfitPriceOffset - This is meant to be an OFFSET not a ABSOLUTE price. The system will cap the offset value to keep it within bounds for the instrument. Use null if you do not want to specify a stop.

LimitOrderSpecification

public LimitOrderSpecification(long instrumentId,
                               FixedPointNumber price,
                               FixedPointNumber quantity,
                               TimeInForce timeInForce)
Construct a limit order request with no stops.

Parameters:
instrumentId - The id of the instrument for the order book to place the order onto.
price - The price order the limit order.
quantity - The quantity to trade. A signed value, where the sign indicates the side of the market that order is placed. Positive implies a buy order, where as negative is a sell
timeInForce - The time in force policy for the limit order.

LimitOrderSpecification

public LimitOrderSpecification(long instrumentId,
                               java.lang.String instructionId,
                               FixedPointNumber price,
                               FixedPointNumber quantity,
                               TimeInForce timeInForce)
Construct a limit order request with no stops.

Parameters:
instrumentId - The id of the instrument for the order book to place the order onto.
instructionId - The user-defined correlation id
price - The price order the limit order.
quantity - The quantity to trade. A signed value, where the sign indicates the side of the market that order is placed. Positive implies a buy order, where as negative is a sell
timeInForce - The time in force policy for the limit order.
Method Detail

setPrice

public void setPrice(FixedPointNumber price)
Set the price of the limit order specification to the specified value. This allows you to place multiple orders with different prices using one order specification.

Parameters:
price - New price for the order specification.

getPrice

protected FixedPointNumber getPrice()
Specified by:
getPrice in class com.lmax.api.internal.order.AbstractOrderSpecification

toString

public java.lang.String toString()
A readable String representation of the LimitOrderSpecification.

Overrides:
toString in class com.lmax.api.internal.order.AbstractOrderSpecification
Returns:
LimitOrderSpecification as a String