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.

Add pairs
 Post subject: Add pairs Post rating: 0   New post Posted: Mon 30 Sep, 2013, 18:31 
User avatar

User rating: 1
Joined: Sun 18 Dec, 2011, 04:05
Posts: 36
Location: Spain, Madrid
hi,

im adding the pairs, but only one pair is into the backtest,

    @Override public void onStart(IContext context) throws JFException { 
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        this.indicators = context.getIndicators();
        this.userInterface = context.getUserInterface();
        this.account = context.getAccount();
 
        Set<Instrument> instruments = new HashSet<Instrument>();
           
            instruments.add(Instrument.AUDUSD);
            instruments.add(Instrument.AUDJPY);
            instruments.add(Instrument.USDJPY);
            instruments.add(Instrument.USDCHF);   
            instruments.add(Instrument.EURJPY);
            instruments.add(Instrument.GBPUSD);
            instruments.add(Instrument.GBPJPY);
            instruments.add(Instrument.EURUSD);
            context.setSubscribedInstruments(instruments,true);
       
    }


    @Override public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { 
       
        // only one position open     
        if((engine.getOrders().isEmpty())){     
        // loop for pairs       
            for(int i=0;i<pairs.length;i++){   
               if(pairs[i]!=instrument || period != selectedPeriod)return;                                           
               .......
               SMIindicator(pairs[i]);

           }                   
        }
    }


I have read something about SystemListener, but i have no idea about that. can anyone help me? :roll:

Thank you


 
 Post subject: Re: Add pairs Post rating: 0   New post Posted: Tue 01 Oct, 2013, 09:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For back-testing from the platform you need to add the instruments by pressing the Instruments button in the Historical Tester. Correspondingly when back-testing from SDK, you need to set the instruments the following way: https://www.dukascopy.com/wiki/#JForex_SDK/Subscribing_to_instruments


 
 Post subject: Re: Add pairs Post rating: 0   New post Posted: Tue 01 Oct, 2013, 12:40 
User avatar

User rating: 1
Joined: Sun 18 Dec, 2011, 04:05
Posts: 36
Location: Spain, Madrid
so, for run the strategy at Remote server?


 
 Post subject: Re: Add pairs Post rating: 0   New post Posted: Tue 01 Oct, 2013, 13:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There is no back-testing on remote server


 

Jump to:  

  © 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