Instrument tradability

Instrument tradability can be determined by calling IEngine.isTradable(Instrument) method.

Charnges in instrument tradability can be monitored by monitoring IInstrumentStatusMessage, which arrives in IStrategy.onMessage approximately once in every 30 seconds for each subscribed instrument.

If IInstrumentStatusMessage.isTradable=false then the server rejects trading operations with the instrument which affect the account balance:

  • Order fill:
    • Market orders get cancelled (IOrder.State.CANCELLED), in IStrategy.onMessage arrives IMessage.Type.ORDER_FILL_REJECTED.
    • Conditional orders remain opened (IOrder.State.OPENED) on meeting the price condition IOrder.getOpenPrice(), in IStrategy.onMessage arrives IMessage.Type.ORDER_FILL_REJECTED,
  • Order close:
    • Neither full nor partial close can be carried out - IOrder.close call on filled orders will result in orders remaining IOrder.State.FILLED and receiving in IStrategy.onMessage IMessage.Type.ORDER_CLOSE_REJECTED.
    • Order close on meeting stop loss/take profit condition does not take place.

Consequently all the rest order operations can be successfully carried out even if the instrument is not tradable - namely:

  • Creation of conditional order (order will remain IOrder.State.OPENED while IInstrumentStatusMessage.isTradable=false and price condition will not have been met).
  • Opened order modifications:
    • Setting/removing stop loss/take profit prices.
    • Changing order open price, good till time, amount
  • Filled order modifications:
    • Setting/removing stop loss/take profit prices.
    • Cancelling unfilled order amount
  • Order merge.

For more details on order workflow see Order State.

The information on this web site is provided only as general information, which may be incomplete or outdated. Click here for full disclaimer.