Hi,
You can use the following to place bid order at the current market price:
order = engine.submitOrder("label", instrument, IEngine.OrderCommand.PLACE_BID, amount, 0);
Also, you can extract the value of the last tick from history:
history.getLastTick().getAsk() or history.getLastTick().getBid()
and use it to calculate the required price for the above bid order:
double price = history.getLastTick(instrument).getBid() + 1 * instrument.getPipValue();
where instrument variable represents the instrument you use.