You can do it the following way:
package jforex.data;
import java.util.Arrays;
import com.dukascopy.api.*;
public class TickDepth implements IStrategy {
@Configurable("")
public Instrument instrument = Instrument.EURUSD;
private IConsole console;
@Override
public void onStart(IContext context) throws JFException {
console = context.getConsole();
}
@Override
public void onTick(Instrument instrument, ITick tick) throws JFException {
if(instrument == this.instrument){
console.getOut().println(instrument + " best bids: "+ Arrays.toString(tick.getBids()));
}
}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
@Override
public void onMessage(IMessage message) throws JFException {}
@Override
public void onAccount(IAccount account) throws JFException {}
@Override
public void onStop() throws JFException {}
}
Mind that the depth may vary from 1 to 10 and for history ticks the depth always is 1.
Also see the example:
https://www.dukascopy.com/wiki/#Get_full_Market_Depth