Launch the following strategy, make some manual trades and check what you receive in the strategy message tab:
package jforex.test;
import com.dukascopy.api.*;
/**
* The strategy prints all messages that it receives and applies specific logic on
* order fill and change messages
*
*/
public class PrintMessages implements IStrategy {
private IConsole console;
@Override
public void onStart(IContext context) throws JFException {
this.console = context.getConsole();
}
@Override
public void onTick(Instrument instrument, ITick tick) throws JFException {}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
@Override
public void onMessage(IMessage message) throws JFException {
console.getOut().println(message);
if(message.getType() == IMessage.Type.ORDER_CHANGED_OK){
console.getOut().println("order "+message.getOrder().getLabel()+" changed: " +message.getContent());
} else if (message.getType() == IMessage.Type.ORDER_FILL_OK){
console.getOut().println("order "+message.getOrder().getLabel()+" filled: " +message.getContent());
}
}
@Override
public void onAccount(IAccount account) throws JFException {}
@Override
public void onStop() throws JFException {}
}
For example with strategy that makes orders itself, see:
https://www.dukascopy.com/wiki/index.php ... rder_State