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?
API Support
Post subject: Re: Subscribing strategy to instruments
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 }