Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3243 Problem output indicator with data interval
 Post subject: JFOREX-3243 Problem output indicator with data interval Post rating: 0   New post Posted: Wed 28 Sep, 2011, 18:07 

User rating: -
The indicator fails to display any value within onBar/onTick method after setting the ITesterClient object's data interval as below:

client.setDataInterval(ITesterClient.DataLoadingMethod.ALL_TICKS, startDate, endDate);


To give an example. We take the singlejartest package that comes with the API. if we set the Data Interval within "TesterMain.java", the code will not work as indicator in onBar/onTick will output invalid values.


(TesterMain.java)

...
//set instruments that will be used in testing
Set<Instrument> instruments = new HashSet<Instrument>();
instruments.add(Instrument.EURUSD);
LOGGER.info("Subscribing instruments...");
client.setSubscribedInstruments(instruments);
//setting initial deposit
       
//when inserted the code below, the tester will not work
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
long startDate = sdf.parse("10.09.2011 00:00:00").getTime();
long endDate = sdf.parse("11.09.2011 00:00:00").getTime();       
client.setDataInterval(ITesterClient.DataLoadingMethod.ALL_TICKS, startDate, endDate);//set date

client.setInitialDeposit(Instrument.EURUSD.getSecondaryCurrency(), 50000);
//load data
LOGGER.info("Downloading data");
Future<?> future = client.downloadData(null);
//wait for downloading to complete
future.get();
...



Regards


 

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