Overview Orders and Positions

In JForex API orders and positions are represented by the IOrder interface and their data can be accessed and modified by using both IOrder and IEngine interfaces. By using the two interfaces, according to the workflow of either Market Orders or Conditional Orders, the user can carry out the following actions:

Order or Position?

Whether the IOrder object stands for an order or a position is determined by Order state, namely:

  • a CREATED or OPENED IOrder denotes an order, a FILLED one - a position,
  • likewise, a CANCELLED IOrder denotes a cancelled order, a CLOSED one - a closed position.

Most of the JForex-API methods are applicable both to orders and positions (e.g. one can set stop loss to both orders and positions; IOrder.close() closes a positions, but cancels an order, etc.), thus from programming side the differnce between the two is rather blurred. Therefore for the sake of conciseness, throughout this wiki chapter we use the term order unless the functionality in subject exclusively relates to positions.

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