public interface IEntryOrder extends IOrderComponent
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLabel()
Returns order label.
|
double |
getPrice()
Returns entry price for the order.
|
IOrder.State |
getState()
Returns current
IOrder.State of the order. |
void |
setAmount(double amount)
Sets amount of order or cancels order when amount equals to zero is set.
|
void |
setLabel(java.lang.String label)
Sets label for the order.
|
void |
setPrice(double price)
Sets entry price for the order.
|
void |
setPrice(double price,
double slippage)
Sets entry price for the order.
|
IMessage |
waitForUpdate(IOrder.State... states)
Blocks strategy thread (with exception of
IStrategy.onMessage(IMessage) )
until the order changes it's state value to one of the expected states . |
IMessage |
waitForUpdate(long timeoutMills,
IOrder.State... states)
Blocks strategy thread (with exception of
IStrategy.onMessage(IMessage) )
until the order changes it's state value to one of the expected states . |
IMessage |
waitForUpdate(long timeout,
java.util.concurrent.TimeUnit unit,
IOrder.State... states)
Blocks strategy thread (with exception of
IStrategy.onMessage(IMessage) )
until the order changes it's state value to one of the expected states . |
cancel, getAmount, getComment, getCreationTime, getGoodTillTime, getId, getOrderCommand, setComment, setGoodTillTime, waitForUpdate, waitForUpdate
java.lang.String getLabel()
void setLabel(java.lang.String label) throws JFException
By default, may not be called on the same order more often than once per second (exact value of max order update per second is sent by server).
label
- new labelJFException
- if new label is null or emptyvoid setAmount(double amount) throws JFException
By default, may not be called on the same order more often than once per second (exact value of max order update per second is sent by server).
amount
- new amountJFException
- when amount is less than the minimum allowed and not 0double getPrice()
void setPrice(double price) throws JFException
By default, may not be called on the same order more often than once per second (exact value of max order update per second is sent by server).
price
- price of the opening conditionJFException
- when price change failsvoid setPrice(double price, double slippage) throws JFException
By default, may not be called on the same order more often than once per second (exact value of max order update per second is sent by server).
price
- price of the opening conditionslippage
- required price slippage; the value of slippage means following:
Double.isNaN(slippage) == true
then no slippage is used
JFException
- when price change failsIOrder.State getState()
IOrder.State
of the order.IMessage waitForUpdate(IOrder.State... states) throws JFException
IStrategy.onMessage(IMessage)
)
until the order changes it's state value to one of the expected states
.
If states
is empty, any order update will cause the thread unblocking.
All the ticks, bars and other feed elements that platform receives while waiting get dropped.states
- a set of expected states; if null or empty - blocks until order changes it's state to any valueJFException
- when order is in state that cannot be changed to one of expected statesIOrder.waitForUpdate(IOrder.State...)
IMessage waitForUpdate(long timeoutMills, IOrder.State... states) throws JFException
IStrategy.onMessage(IMessage)
)
until the order changes it's state value to one of the expected states
.
If states
is empty, any order update will cause the thread unblocking.
All the ticks, bars and other feed elements that platform receives while waiting get dropped.timeoutMills
- timeout to wait for order state changestates
- a set of expected states; if null or empty - blocks until order changes it's state to any valueJFException
- when order is in state that cannot be changed to one of expected statesIOrder.waitForUpdate(long, IOrder.State...)
IMessage waitForUpdate(long timeout, java.util.concurrent.TimeUnit unit, IOrder.State... states) throws JFException
IStrategy.onMessage(IMessage)
)
until the order changes it's state value to one of the expected states
.
If states
is empty, any order update will cause the thread unblocking.
All the ticks, bars and other feed elements that platform receives while waiting get dropped.timeout
- how long to wait before giving up, in units of unit
unit
- a TimeUnit
determining how to interpret the timeout
parameterstates
- a set of expected states; if null or empty - blocks until order changes it's state to any valueJFException
- when order is in state that cannot be changed to one of expected statesIOrder.waitForUpdate(long, TimeUnit, IOrder.State...)
Copyright © 2024. All rights reserved.