Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Java Strategy Trades Non-Selected Instruments.
 Post subject: Java Strategy Trades Non-Selected Instruments. Post rating: 0   New post Posted: Wed 10 May, 2017, 05:50 

User rating: 1
Joined: Mon 01 Sep, 2014, 13:39
Posts: 34
Location: AustraliaAustralia
Hi,

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.


 
 Post subject: Re: Java Strategy Trades Non-Selected Instruments. Post rating: 0   New post Posted: Tue 23 May, 2017, 14:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
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);


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com