Overview Historical Data

JForex API includes IHistory interface which enables the user to access various types of historical data, namely:

  • History bars,
  • History ticks,
  • Order history,
  • Feed history.

It is important to note that IHistory not only represents historical values, but, in case of bars, ticks and feeds, also the last available data when used with shift=0 - the last tick, currently forming bars, range bars, tick bars, etc. See more on this in the upper listed articles. To get these data you need to declare IHistory field in your strategy:

private IHistory history;

Then in onStart(IContext context) method assign context history to the declared history field:

this.history = context.getHistory();

After history field is initialized, all stored historical data becomes available.

Data in DEMO platform

Historical data and realtime data is different, when using DEMO platform.

  • Real-time tick data is created and sourced from DEMO environment
  • Historical data returns data from LIVE environment

Real-time tick data is different on DEMO and LIVE. This is because BID/OFFER orders affect tick price values. In order to enable BID/OFFER order testing on DEMO, DEMO environment has separate tick generation. Historical data in DEMO must be equal to LIVE data to enable accurate historical testing and optimization.

The information on this web site is provided only as general information, which may be incomplete or outdated. Click here for full disclaimer.