Dukascopy
 
 
Wiki JStore Search Login

Historical Tester inaccurate on Empty Cache
 Post subject: Historical Tester inaccurate on Empty Cache Post rating: 0   New post Posted: Fri 23 Nov, 2012, 22:32 

User rating: 0
Joined: Sat 03 Nov, 2012, 17:05
Posts: 2
Location: CanadaCanada
The historical tester isn't testing all ticks when there is no cache available for that data.
This possibly could be just a multi-instrument bug since that is where I noticed and tested for.

I used the following basic strategy to test inside JForex platform:

package jforex;

import java.util.*;

import com.dukascopy.api.*;

public class DataCollection implements IStrategy {
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
           
    public Instrument         GBPUSD = Instrument.GBPUSD;
    public Instrument         EURGBP = Instrument.EURGBP;
    public Instrument         EURUSD = Instrument.EURUSD;
    public int    GBPUSDindex = 0;
    public int   EURGBPindex = 0;
    public int EURUSDindex = 0;

   
    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();
       
        Set<Instrument> instruments = new HashSet<Instrument>();
        instruments.add(GBPUSD);
        instruments.add(EURGBP);
        instruments.add(EURUSD);

        context.setSubscribedInstruments(instruments);

         console.getOut().println("STARTUP");

    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onMessage(IMessage message) throws JFException {
    }

    public void onStop() throws JFException
    {
        console.getOut().println("GBPUSD TICK CALLS: "+GBPUSDindex);
        console.getOut().println("EURUSD TICK CALLS: "+EURUSDindex);
        console.getOut().println("EURGBP TICK CALLS: "+EURGBPindex);
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException
    {
         if (instrument == GBPUSD)
         {
             GBPUSDindex++;
         }
         if (instrument == EURUSD)
         {
             EURUSDindex++;
         }
         if (instrument == EURGBP)
         {
             EURGBPindex++;
         }
         
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }
}



I ran this program 3 times over the exact same period (2011 data).
NO CACHE (EMPTIED CACHE) RESULTS:
EURGBP onTick Calls: 3,225,001
EURUSD onTick Calls: 25,743,998
GBPUSD onTick Calls: 3,781,193
Report Stated 35,895,152 Internal Calls 32,750,192 OnTick Calls

SECOND RUN (WITH CACHE FROM FIRST RUN)
EURGBP onTick Calls: 21,797,295
EURUSD onTick Calls: 25,743,998
GBPUSD onTick Calls: 24,814,242
Report Stated 75,500,495 Internal Calls 72,355,535 OnTick Calls

THIRD RUN (WITH CACHE FIRST AND SECOND RUN)
EXACT RESULTS OF SECOND RUN

This is probably related to multi-instruments, but is rather significant as you would have to run a test twice if you have never used that data before or if you needed to clear your cache as in my case.


 
 Post subject: Re: Historical Tester inaccurate on Empty Cache Post rating: 0   New post Posted: Tue 04 Dec, 2012, 09:49 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1054
Location: Geneva, Switzerland
We will look into this. Does the same problem appears if the test is performed on 1 instrument only?


 

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