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.

Subscribing strategy to instruments
 Post subject: Subscribing strategy to instruments Post rating: 0   New post Posted: Wed 31 Mar, 2010, 11:54 

User rating: 0
Joined: Tue 30 Mar, 2010, 12:52
Posts: 2
perhaps an obvious questions - how to subscribe strategy to specific instruments on 'live' demo testing? (i.e. not back testing but prospective testing?)

do I need to use the same method as when dealing with the relevant time period for onBar() function, ie.:
    public void onTick(Instrument instrument, ITick tick) throws JFException {
        if (instrument.name() == "EURUSD") {
            execute my strategy
        }
    }

or is there any other method of assigning the strategy to a specific instrument?


 
 Post subject: Re: Subscribing strategy to instruments Post rating: 0   New post Posted: Wed 31 Mar, 2010, 13:15 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
at this point, it's not possible subscribe to instrument via API. To subscribe for an instrument, you need to click(right mouse button) on the Instruments node in the JForex Workspace. And then chose instrument.
Quote:
do I need to use the same method as when dealing with the relevant time period for onBar() function
Yes. But here is better sample
if (instrument == Instrument.EURUSD) {
            execute my strategy
        }


 

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