|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IOrder
Contains order data and allows order manipulation
Nested Class Summary | |
---|---|
static class |
IOrder.State
Indicates state of the order |
Method Summary | |
---|---|
void |
close()
Sends a request to fully close position by market price or cancel entry order This is the only allowed close() method for entry orders |
void |
close(double amount)
Sends a request to close the position with specified amount, by market price and default slippage. |
void |
close(double amount,
double price)
Sends a request to close the position with specified amount, price and default slippage. |
void |
close(double amount,
double price,
double slippage)
Sends a request to close the position with specified amount, price and slippage. |
double |
getAmount()
Returns amount of the order. |
double |
getClosePrice()
Returns price at which order was closed or 0 if order or order part wasn't closed. |
long |
getCloseTime()
Returns time when server closed the order |
String |
getComment()
Returns comment that was set when order was submitted |
long |
getCreationTime()
Returns creation time. |
long |
getFillTime()
Returns time of the fill |
long |
getGoodTillTime()
Returns time when order will be cancelled or 0 if order is "good till cancel" |
String |
getId()
Returns position or entry ID |
Instrument |
getInstrument()
Returns instrument of the order |
String |
getLabel()
Returns label |
double |
getOpenPrice()
Returns entry level price for conditional orders in IOrder.State.CREATED and IOrder.State.OPENED state or price at which order was
filled for orders in IOrder.State.FILLED or IOrder.State.CLOSED states |
IEngine.OrderCommand |
getOrderCommand()
Returns IEngine.OrderCommand of this message |
double |
getRequestedAmount()
Returns requested amount |
IOrder.State |
getState()
Returns current IOrder.State of the order |
double |
getStopLossPrice()
Returns price of stop loss condition or 0 if stop loss condition is not set. |
OfferSide |
getStopLossSide()
Returns side that is used to check stop loss condition |
double |
getTakeProfitPrice()
Returns price of take profit condition or 0 if take profit condition is not set. |
double |
getTrailingStep()
Returns current trailing step or 0 if no trailing step is set |
boolean |
isLong()
Returns true if order is LONG. |
void |
setGoodTillTime(long goodTillTime)
Sets "good till time" for BIDs and OFFERs |
void |
setOpenPrice(double price)
Sets open price for order in IOrder.State.CREATED or IOrder.State.OPENED state |
void |
setRequestedAmount(double amount)
Sets amount of order in IOrder.State.CREATED or IOrder.State.OPENED state |
void |
setStopLoss(double price)
Deprecated. changed to setStopLossPrice |
void |
setStopLoss(double price,
OfferSide side)
Deprecated. changed to setStopLossPrice |
void |
setStopLoss(double price,
OfferSide side,
double trailingStep)
Deprecated. changed to setStopLossPrice |
void |
setStopLossPrice(double price)
Sets stop loss price. |
void |
setStopLossPrice(double price,
OfferSide side)
Sets stop loss price. |
void |
setStopLossPrice(double price,
OfferSide side,
double trailingStep)
Sets stop loss price. |
void |
setTakeProfit(double price)
Deprecated. changed to setTakeProfitPrice |
void |
setTakeProfitPrice(double price)
Sets take profit price. |
void |
waitForUpdate(long timeoutMills)
Blocks until order changes it's state, values or until timeout is elapsed (unblocks when system receives any message related to this order). |
Method Detail |
---|
Instrument getInstrument()
String getLabel()
String getId()
long getCreationTime()
long getCloseTime()
IEngine.OrderCommand getOrderCommand()
IEngine.OrderCommand
of this message
boolean isLong()
getOrderCommand().isLong()
long getFillTime()
double getAmount()
IOrder.State.OPENED
state returns amount requested. For orders in IOrder.State.FILLED
state will return filled amount. Filled amount can be different from requested amount (partial fill).
double getRequestedAmount()
double getOpenPrice()
IOrder.State.CREATED
and IOrder.State.OPENED
state or price at which order was
filled for orders in IOrder.State.FILLED
or IOrder.State.CLOSED
states
double getClosePrice()
double getStopLossPrice()
double getTakeProfitPrice()
void setStopLossPrice(double price) throws JFException
getStopLossPrice()
method will still return old value until server
will accept this changes
price
- price to set
JFException
- when method fails for some reason@Deprecated void setStopLoss(double price) throws JFException
setStopLossPrice(double)
instead
JFException
void setStopLossPrice(double price, OfferSide side) throws JFException
getStopLossPrice()
method will still return old value until server will accept this changes
price
- price to setside
- side that will be used to check stop loss condition
JFException
- when method fails for some reason@Deprecated void setStopLoss(double price, OfferSide side) throws JFException
setStopLossPrice(double, OfferSide)
instead
JFException
void setStopLossPrice(double price, OfferSide side, double trailingStep) throws JFException
getStopLossPrice()
method will still
return old value until server will accept this changes
price
- price to setside
- side that will be used to check stop loss conditiontrailingStep
- if < 0 then adds stop loss order without trailing step. Should be 0 or >= 10
JFException
- trailingStep is > 0 and < 10 or when method fails for some reason@Deprecated void setStopLoss(double price, OfferSide side, double trailingStep) throws JFException
setStopLossPrice(double, OfferSide, double)
instead
JFException
OfferSide getStopLossSide()
double getTrailingStep()
void setTakeProfitPrice(double price) throws JFException
getStopLossPrice()
method will still return old value until server will accept this changes
price
- price to set
JFException
- when method fails for some reason@Deprecated void setTakeProfit(double price) throws JFException
setTakeProfitPrice(double)
instead
JFException
String getComment()
void setRequestedAmount(double amount) throws JFException
IOrder.State.CREATED
or IOrder.State.OPENED
state
amount
- new amount
JFException
- if order is not in IOrder.State.CREATED
or IOrder.State.OPENED
state or if amount is less than a minimum allowedvoid setOpenPrice(double price) throws JFException
IOrder.State.CREATED
or IOrder.State.OPENED
state
price
- price of the opening condition
JFException
- when price change failsvoid close(double amount, double price, double slippage) throws JFException
amount
- closing amount. Can be less than opened amount, in this case partial close will take place. If 0 is provided then all
amount will be closedprice
- required close price. Close will be rejected if no liquidity at this price. This parameter doesn't affect
entry (conditional) orders.slippage
- required price slippage.
JFException
- when called for order not in IOrder.State.FILLED
statevoid close(double amount, double price) throws JFException
amount
- closing amount. Can be less than opened amount, in this case partial close will take place. If 0 is provided then all
amount will be closedprice
- required close price. Close will be rejected if no liquidity at this price. This parameter doesn't affect
entry (conditional) orders.
JFException
- when called for order not in IOrder.State.FILLED
statevoid close(double amount) throws JFException
amount
- closing amount. Can be less than opened amount, in this case partial close will take place. If 0 is provided then all
amount will be closed
JFException
- when called for order not in IOrder.State.FILLED
statevoid close() throws JFException
close()
method for entry orders
JFException
IOrder.State getState()
IOrder.State
of the order
void setGoodTillTime(long goodTillTime) throws JFException
goodTillTime
- time when BID or OFFER should be canceled
JFException
- when order is not place bid or offerlong getGoodTillTime()
void waitForUpdate(long timeoutMills)
timeoutMills
- timeout to wait for order state change
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |