Place Offer

You can place offer using a submitOrder method with a PLACE_OFFER command parameter. Let's assume that we want to place the offer which will be good for two minutes, to achieve that we need to get current time in milliseconds and add two minutes in milliseconds(120000)

long goodTillTime =  System.currentTimeMillis() + 120000;
engine.submitOrder("Offer label", instrument, OrderCommand.PLACE_OFFER, amount, offerPrice, slippage, stopLossPrice, takeProfitPrice, goodTillTime);

If good till time is equal to zero, then the place offer order will be identical to a JForex platform GTC parameter in a place offer form, and the command PLACE_OFFER is not mondatory in the submitOrder method parameters.

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