Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

Not testing pairs of the base currency
 Post subject: Not testing pairs of the base currency Post rating: 0   New post Posted: Fri 01 Oct, 2010, 11:00 

User rating: 0
Joined: Mon 27 Sep, 2010, 13:19
Posts: 6
Hi support,

I am currently working on my own tester with ITesterClient.

When I use setSubscribedInstruments of ITesterClient the void adds the base currency pairs automatically to those that I chose to test. However, I want to avoid this, since I only want to test on those pairs I really selected.

setSubscribedInstruments seems to change the instruments-objects somehow, or at least I can't just compare the setSubscribedInstruments-Elements to elements of the list of the selected Elements, to test only for relevant pairs.

Here is the relevant code:
Creation of the instruments-Hashset and the Clone

Set<Instrument> instruments = new HashSet<Instrument>();
Set<Instrument> instrumentsToBeTested = ((Set) ((HashSet) instruments).clone());

subscription

testClient.setSubscribedInstruments ( instruments );

Loop for testing over each currency with if-order

for ( Instrument curInstr : instruments ) {
if(instrumentsToBeTested.contains(curInstr)){
Field field = affentrader_Class.getField("pair");
field.set(StratList.get(i), curInstr);
testClient.startStrategy ( StratList.get(i), new MyTestProgressListener() );
i=i+1;
}


 
 Post subject: Re: Not testing pairs of the base currency Post rating: 0   New post Posted: Tue 05 Oct, 2010, 10:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
you can't avoid this. JClient must be subscribed also for those instruments, which helps to convert an instruments secondary currency to the account currency. And as a middle currency it uses USA dollar(USD). It means that if you have an account currency CHF, and you are subscribing to AUD/CAD. Then you will be also subscribed to USD/CHF, USD/CAD. Please also consider this
https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=1&t=3842&hilit=account+currency


 

Jump to:  

cron
  © 1998-2025 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