I have a Java strategy which trades major pairs in DEMO but not CHF pairs. However when I run it, 2 CHF pairs are traded. There should be 15 pairs traded but it has 17. I did select all major CHF pairs a while ago, but have excluded them in the code and the JForex Historical Tester.
As you can see below, there are 2 CHF pairs traded.
SYSTEM01 strategy report for AUD/JPY, AUD/CAD, AUD/USD, CAD/JPY, EUR/AUD, EUR/CAD, EUR/GBP, EUR/JPY, EUR/USD, GBP/AUD, GBP/CAD, GBP/CHF, GBP/JPY, GBP/USD, USD/CAD, USD/CHF, USD/JPY instrument(s) from 2016-01-25 00:00:00 to 2017-01-31 00:00:00
What do you think is wrong?
Thanks, Chrysos.
API Support
Post subject: Re: Java Strategy Trades Non-Selected Instruments.
How does the strategy exclude instruments from trading? Instrument subscription does not exclude other instruments. The strategy will receive not only the instruments that are passed into setSubscribedInstruments but also instruments that are open in JForex platform.
Set<Instrument> instruments = new HashSet<Instrument>(); instruments.add(Instrument.EURCAD); context.setSubscribedInstruments(instruments, true);