Hi all
I get error messages when I use the calculate function from
https://www.dukascopy.com/wiki/index.php ... t_currency.
Error @ this line:
else if (instrument.getSecondaryCurrency().equals(USD)) {
transitionalInstrument = pairs.get(account.getCurrency());
transitionalPrice = history.getLastTick(transitionalInstrument).getBid(); //In this line I get a NullPointerException
profit = profitInInitialCurrncy * transitionalPrice ;
System.out.println("Profit: " + profit);
// Secondary instrument is not USD, must convert to USD, then to Account currency
}
My account currency is CHF and I tried this example with GBPUSD. But I think, the strategy doesn't get the ticks from GBPUSD. Why?
And what does
Set<Instrument> instruments = new HashSet<Instrument>();
instruments.add(Instrument.EURUSD);
mean in Main.java?
Thanks for help
bigtrader