JFUtil.convertPipToCurrency() didn't seem to reliably give me the result I wanted either.
However, this works for me:
Instrument ins = Instrument.EURUSD;
ITick lastTick = context.getHistory().getLastTick(ins);
double midPrice = (lastTick.getAsk() + lastTick.getBid()) / 2.0;
double amount = 1000000.0;
double pipCost = (1.0 / midPrice * ins.getPipValue()) * amount;
context.getConsole().getOut().println(String.format("At position size %.0f, 1 pip of %s is worth %s %.6f", amount, ins.toString(), ins.getPrimaryCurrency(), pipCost));
Output:
15:44:24 At position size 1000000, 1 pip of EUR/USD is worth EUR 75.341485
Many thanks for your help