|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IEngine
Interface to the main engine, that allows orders submission, merging etc
| Nested Class Summary | |
|---|---|
static class |
IEngine.OrderCommand
Specifies type of the order |
static class |
IEngine.Type
Type of the engine |
| Method Summary | |
|---|---|
void |
closeOrders(IOrder... orders)
Mass close. |
String |
getAccount()
Returns account id |
IOrder |
getOrder(String label)
Returns order by label, or null if no order was found |
IOrder |
getOrderById(String orderId)
Returns order by id, or null if no order was found |
List<IOrder> |
getOrders()
Returns list of orders in IOrder.State.CREATED, IOrder.State.OPENED and IOrder.State.FILLED state |
List<IOrder> |
getOrders(Instrument instrument)
Returns list of orders in IOrder.State.CREATED, IOrder.State.OPENED and IOrder.State.FILLED state for
specified instrument |
IEngine.Type |
getType()
Returns type of the engine, one of the IEngine.Type.LIVE, IEngine.Type.DEMO or IEngine.Type.TEST for tester. |
void |
mergeOrders(IOrder... orders)
Deprecated. use mergeOrders(String label,IOrder... orders) throws JFException; |
IOrder |
mergeOrders(String label,
IOrder... orders)
Merges orders. |
IOrder |
submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount)
Submits new order. |
IOrder |
submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price)
Submits new order. |
IOrder |
submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage)
Submits new order. |
IOrder |
submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice)
Submits new order. |
IOrder |
submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice,
long goodTillTime)
Submits new order. |
IOrder |
submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice,
long goodTillTime,
String comment)
Submits new order. |
| Method Detail |
|---|
IOrder submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice,
long goodTillTime,
String comment)
throws JFException
IOrder.State.CREATED status and will be updated to IOrder.State.OPENED status
after server confirmation
label - user defined identifier for the order. Label must be unique for given user account.instrument - instrumentorderCommand - type of submitted orderamount - amount in millions for the orderprice - preferred price for order. If zero, then current market price will be usedslippage - slippage, if negative then default value of 5 ticks is usedstopLossPrice - price of the stop losstakeProfitPrice - price of the take profitgoodTillTime - how long order should live if not executed. Only if > 0, then orderCommand should be
IEngine.OrderCommand.PLACE_BID or IEngine.OrderCommand.PLACE_OFFERcomment - comment that will be saved in order
IOrder.State.CREATED state
JFException - if label is not valid or already exists, if goodTillTime > 0 and orderCommand is not BID/OFFER, if amount is less
than minimum allowed, if some of the required parameters is null
IOrder submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice,
long goodTillTime)
throws JFException
IOrder.State.CREATED status and will be updated to IOrder.State.OPENED status
after server confirmation
label - user defined identifier for the order. Label must be unique for given user account.instrument - instrumentorderCommand - type of submitted orderamount - amount in millions for the orderprice - preferred price for order. If zero, then current market price will be usedslippage - slippage, if negative then default value of 5 ticks is usedstopLossPrice - price of the stop losstakeProfitPrice - price of the take profitgoodTillTime - how long order should live if not executed. Only if > 0, then orderCommand should be
IEngine.OrderCommand.PLACE_BID or IEngine.OrderCommand.PLACE_OFFER
IOrder.State.CREATED state
JFException - if label is not valid or already exists, if goodTillTime > 0 and orderCommand is not BID/OFFER, if amount is less
than minimum allowed, if some of the required parameters is null
IOrder submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage,
double stopLossPrice,
double takeProfitPrice)
throws JFException
IOrder.State.CREATED status and will be updated to IOrder.State.OPENED status
after server confirmation
label - user defined identifier for the order. Label must be unique for given user account.instrument - instrumentorderCommand - type of submitted orderamount - amount in millions for the orderprice - preferred price for order. If zero, then current market price will be usedslippage - slippage, if negative then default value of 5 ticks is usedstopLossPrice - price of the stop losstakeProfitPrice - price of the take profit
IOrder.State.CREATED state
JFException - if label is not valid or already exists, if amount is less than minimum allowed, if some of the required
parameters is null
IOrder submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price,
double slippage)
throws JFException
IOrder.State.CREATED status and will be updated to IOrder.State.OPENED status
after server confirmation
label - user defined identifier for the order. Label must be unique for given user account.instrument - instrumentorderCommand - type of submitted orderamount - amount in millions for the orderprice - preferred price for order. If zero, then current market price will be usedslippage - slippage, if negative then default value of 5 ticks is used
IOrder.State.CREATED state
JFException - if label is not valid or already exists, if amount is less than minimum allowed, if some of the required
parameters is null
IOrder submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount,
double price)
throws JFException
IOrder.State.CREATED status and will be updated to IOrder.State.OPENED status
after server confirmation
label - user defined identifier for the order. Label must be unique for given user account.instrument - instrumentorderCommand - type of submitted orderamount - amount in millions for the orderprice - preferred price for order. If zero, then current market price will be used
IOrder.State.CREATED state
JFException - if label is not valid or already exists, if amount is less than minimum allowed, if some of the required
parameters is null
IOrder submitOrder(String label,
Instrument instrument,
IEngine.OrderCommand orderCommand,
double amount)
throws JFException
IOrder.State.CREATED status and will be updated to IOrder.State.OPENED status
after server confirmation
label - user defined identifier for the order. Label must be unique for given user account.instrument - instrumentorderCommand - type of submitted order. Only IEngine.OrderCommand.BUY and IEngine.OrderCommand.SELL allowed in this methodamount - amount in millions for the order
IOrder.State.CREATED state
JFException - if label is not valid or already exists, if amount is less than minimum allowed, if some of the required
parameters is null or if orderCommand is not BUY or SELL
IOrder getOrder(String label)
throws JFException
label - order's label
JFExceptionIOrder getOrderById(String orderId)
orderId - order's id
List<IOrder> getOrders(Instrument instrument)
throws JFException
IOrder.State.CREATED, IOrder.State.OPENED and IOrder.State.FILLED state for
specified instrument
instrument - instrument
JFException
List<IOrder> getOrders()
throws JFException
IOrder.State.CREATED, IOrder.State.OPENED and IOrder.State.FILLED state
JFException
void mergeOrders(IOrder... orders)
throws JFException
IMessage.Type.ORDERS_MERGE_OK type and resulting order or
null if there is no amount left for order. If there is less than 2 orders, then method exits after checking conditions, which are one
instrument, IOrder.State.FILLED state and no stop loss/take profit conditions
orders - orders to merge
JFException - if orders not in IOrder.State.FILLED state, have stop loss or take profit set or doesn't belong to one instrument
IOrder mergeOrders(String label,
IOrder... orders)
throws JFException
IMessage.Type.ORDERS_MERGE_OK type and resulting order, which can
be in closed state if there is no amount left for order. If there is less than 2 orders, then method exits after checking conditions,
which are one instrument, IOrder.State.FILLED state and no stop loss/take profit conditions
label - label of resulting orderorders - orders to merge
JFException - if orders not in IOrder.State.FILLED state, have stop loss or take profit set or doesn't belong to one instrument
void closeOrders(IOrder... orders)
throws JFException
orders - orders to close
JFException - if orders not in IOrder.State.FILLED state.IEngine.Type getType()
IEngine.Type.LIVE, IEngine.Type.DEMO or IEngine.Type.TEST for tester.
String getAccount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||