Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

IStrategy.onTick != IHistory.readTicks + Full Instructions
 Post subject: IStrategy.onTick != IHistory.readTicks + Full Instructions Post rating: 1   New post Posted: Mon 16 Jun, 2014, 14:23 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
Hello,

IStrategy.onTick: (EUR/USD)
[...]
2014-06-06 05:31:18.354,1.36582,1.36585
2014-06-06 05:31:19.342,1.36582,1.36584 (readTicks not found)
2014-06-06 05:31:19.852,1.36582,1.36585 (readTicks not found)
2014-06-06 05:31:25.361,1.36584,1.36586
[...]

IHistory.readTicks(Instrument instrument, long from, long to, LoadingDataListener tickListener, LoadingProgressListener loadingProgress):
[...]
2014-06-06 05:31:18.354,1.36582,1.36585
2014-06-06 05:31:25.361,1.36584,1.36586
[...]


How to reproduce?
Save every tick (onTick) to file 24 hours per day, 7 days in week, 365 days in year
Every weekend or monday compare last 8 days ticks with IHistory.readTicks(Instrument instrument, long from, long to, LoadingDataListener tickListener, LoadingProgressListener loadingProgress)

You will see serious differents

thanks


 
 Post subject: Re: onTick != IHistory.readTicks Post rating: 0   New post Posted: Mon 16 Jun, 2014, 14:52 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
That's normal, by design. Not all ticks are put into history. There may be a 1 second
aggregation interval for tick history, I'm not sure about that...

If you want then Live tick stream recorded, you would have to do
it yourself off the onTick callbacks.... In that case make sure you
do not ever block onTick so that ticks are missed in any way,
and respect the timestamps, rather than relying on your system's
local clock.

If you want to capture the full Depth of Market, you would also
have to do this yourself... also not available in history.

When you think about it, it's impossible to capture and broadcast
all internal changes to the ECN state, but Dukascopy tries hard to give a fairly
high resolution in real time, and also a fairly high resolution from
history, but it isn't correct at the micro-detail level sub-one second.

HyperScalper


 
 Post subject: Re: onTick != IHistory.readTicks Post rating: 0   New post Posted: Mon 16 Jun, 2014, 15:23 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
hyperscalper wrote:
That's normal, by design. Not all ticks are put into history. There may be a 1 second
aggregation interval for tick history, I'm not sure about that...

If you want then Live tick stream recorded, you would have to do
it yourself off the onTick callbacks.... In that case make sure you
do not ever block onTick so that ticks are missed in any way,
and respect the timestamps, rather than relying on your system's
local clock.

If you want to capture the full Depth of Market, you would also
have to do this yourself... also not available in history.

When you think about it, it's impossible to capture and broadcast
all internal changes to the ECN state, but Dukascopy tries hard to give a fairly
high resolution in real time, and also a fairly high resolution from
history, but it isn't correct at the micro-detail level sub-one second.

HyperScalper


no, it's should be equal for strategy tester


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 1   New post Posted: Wed 25 Jun, 2014, 09:21 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
https://www.dukascopy.com/swiss/english ... nsparency/

1 Transparent Price Feed
Dukascopy Bank combines the individual bids and offers of all SWFX market participants in one place, providing one transparent price feed for everyone without exception. All Dukascopy Bank clients get the same price feed regardless of account size or trading strategy.

2
Transparent Historical Data
Historical Data Transparency is an essential point for strategy development. Dukascopy Bank provides the true historical price feed for a strategy development and back-test, with access to high quality tick-by-tick quotes. Such environment guarantees a high accuracy of a back-test and excludes any possibility for price manipulation by Dukascopy Bank.

[...]

so it's must be fixed


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 1   New post Posted: Wed 25 Jun, 2014, 20:23 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Well, for Tick level data there is a practical limit to
historical data resolution. That's just fine, and
does not invalidate Dukascopy's pledge of
transparency at all... Of course I may be missing
the point here...

I wouldn't be surprised if onTick differed slightly
between Demo and Live, so I always use Live
for testing purposes. Specifically which "ticks"
are recorded for historical extraction purposes
would depend heavily on the details of the implementation.

Inside the ECN matching "engine" it's impossible
to stream out *every* change of inside Bid/Ask
price or, for that matter, every other change within
10 bid/ask levels from the inside. So these
things are, by definition, only "high resolution snapshots"
of the "true" price. In fact, the "true" price is really
a fiction at the micro level of order matching....

I'm just sayin'........ philosophically of course. LOL

HyperScalper


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Fri 27 Jun, 2014, 14:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We could not replicate what you are reporting here. We ran the following strategy for the week that you reported missing ticks for:
package jforex.data;

import java.io.PrintStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.TreeMap;

import com.dukascopy.api.Configurable;
import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IConsole;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IHistory;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.LoadingDataListener;
import com.dukascopy.api.LoadingProgressListener;
import com.dukascopy.api.OfferSide;
import com.dukascopy.api.Period;
import com.dukascopy.api.util.DateUtils;

 
public class ReadTicksVsLiveMap implements IStrategy {
   
    @Configurable("")
    public Period period = Period.TEN_SECS;
    @Configurable("")
    public Instrument instrument = Instrument.EURUSD;
    @Configurable("log ticks")
    public boolean log = false;
       
    private TreeMap<Long, ITick> liveTicks;
    private IHistory history;
    private IConsole console;
   
    @Override
    public void onStart(IContext context) throws JFException {
        history = context.getHistory();
        console = context.getConsole();

    }

    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {
        if(this.instrument != instrument || liveTicks == null){
            return;
        }
        liveTicks.put(tick.getTime(), tick);
       
    }

    @Override
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        if(this.instrument != instrument || this.period != period){
            return;
        }
        //should happen only on the first bar - start collecting live ticks
        if(liveTicks == null){
            liveTicks = new TreeMap<Long, ITick>();
            return; //since we have not collected any live ticks yet
        }
        if(liveTicks.size() > 1000){ 
           if(log){
              console.getInfo().println("Clear live tick map");
           }
            liveTicks = new TreeMap<Long, ITick>();
            return;
        } 
       
        long from = bidBar.getTime();
        long to = bidBar.getTime() + period.getInterval() - 1;
        List<Tk> liveTicksChunk = Tk.getInfos(liveTicks.subMap(from, true, to, true).values());
        compareWithReadTicks(from, to, liveTicksChunk);
    }
   
    private void compareWithReadTicks(final long from, final long to, final List<Tk> liveTicks) throws JFException {
        final List<Tk> readTicks = new ArrayList<Tk>();
         history.readTicks(
                 instrument,
                 from,
                 to - 1, //allow 1ms reserve for live ticks, since this is another thread
                 new LoadingDataListener() { 
                     @Override
                     public void newTick(Instrument instrument, long time, double ask, double bid, double askVol, double bidVol) {
                         readTicks.add(new Tk(ask, bid, time));
                     }

                     @Override
                     public void newBar(Instrument instrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
                         // no bars expected
                     }
                 },
                 new LoadingProgressListener() {

                     @Override
                     public void dataLoaded(long start, long end, long currentPosition, String information) {
                     }

                     @Override 
                     public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                         compareTickLists( liveTicks,"liveTicks", readTicks, "readTicks", from, to);
                     }

                     @Override
                     public boolean stopJob() {
                         return false;
                     }
                 });

    }
   
    private void compareTickLists(List<Tk> list1, String info1, List<Tk> list2, String info2, long from, long to){
        if(!list1.equals(list2)){
            console.getErr().format("%s != %s", info1, info2).println();
            logAllTicks(console.getErr(), list1,info1, list2, info2, from, to); 
            List<Tk> temp = new ArrayList<Tk>(list2);
            list2.removeAll(list1);
            list1.removeAll(temp);
            console.getErr().format("%1$s not in %2$s:\n %3$s \n %2$s not in %1$s:\n %4$s", info1, info2, list1, list2).println();
        } else if(log){
            logAllTicks(console.getOut(),list1,info1, list2, info2, from, to);
        }
    }
   
    private void logAllTicks(PrintStream ps, List<?> list1, String info1, List<?> list2, String info2, long from, long to){
        ps.format("%s <- %s %s\n %s <- %s %s\n %s - %s",
                list1, list1.size(), info1,
                list2, list2.size(), info2,
                DateUtils.format(from), DateUtils.format(to)).println(); 
    }

    @Override
    public void onMessage(IMessage message) throws JFException {}

    @Override
    public void onAccount(IAccount account) throws JFException {}

    @Override
    public void onStop() throws JFException {}
   
    /**
     * Convenience class for tick data comparisons and more concise logging
     */
    private static class Tk {
       
        private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss:SSS");
        static {
            TIME_FORMAT.setTimeZone(DateUtils.GMT_TIME_ZONE);
        }
       
        private final double ask;
        private final double bid;
        private final long time;
       
        Tk(ITick tick){
            ask = tick.getAsk();
            bid = tick.getBid();
            time = tick.getTime();
        }
       
        Tk(double ask, double bid, long time){
            this.ask = ask;
            this.bid = bid;       
            this.time = time;
        }
       
        static List<Tk> getInfos(Collection<ITick> ticks){
            List<Tk> list = new ArrayList<Tk>();
            for(ITick t : ticks){
                list.add(new Tk(t));
            }
            return list;
        }
       
        @Override
        public String toString(){
            return String.format("%s %s %s", TIME_FORMAT.format(time), bid, ask);
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            long temp;
            temp = Double.doubleToLongBits(ask);
            result = prime * result + (int) (temp ^ (temp >>> 32));
            temp = Double.doubleToLongBits(bid);
            result = prime * result + (int) (temp ^ (temp >>> 32));
            result = prime * result + (int) (time ^ (time >>> 32));
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            Tk other = (Tk) obj;
            if (Double.doubleToLongBits(ask) != Double.doubleToLongBits(other.ask))
                return false;
            if (Double.doubleToLongBits(bid) != Double.doubleToLongBits(other.bid))
                return false;
            if (time != other.time)
                return false;
            return true;
        }
    }

}


Attachments:
ReadTicksVsLiveMap.java [7.44 KiB]
Downloaded 209 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Fri 27 Jun, 2014, 16:22 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
API Support wrote:
We could not replicate what you are reporting here. We ran the following strategy for the week that you reported missing ticks for:


Yes, but ticks must be saved on disk in one process JForexAPI and compared in second process, then we can say more:

1) You see IStrategy.onTick != IHistory.readTicks
2) You still don't see, then we can compare your ticks saved (IStrategy.onTick) with my ticks saved (IStrategy.onTick) then
2a) Your IStrategy.onTick == My IStrategy.onTick then must be My IHistory.readTicks != Your IHistory.readTicks
2b) Your IStrategy.onTick != My IStrategy.onTick then may be different servers? threads problem?

please save every ticks IStrategy.onTick to file on disk (EUR/USD)
thanks


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Mon 30 Jun, 2014, 12:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
John11 wrote:
but ticks must be saved on disk in one process JForexAPI and compared in second process
The ticks were already in the data cache before we launched the test. Or do you mean something else. Please provide precise reproduction steps. Also please provide programs/strategies that should be used to replicate this.


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Mon 30 Jun, 2014, 14:46 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
API Support wrote:
John11 wrote:
but ticks must be saved on disk in one process JForexAPI and compared in second process
The ticks were already in the data cache before we launched the test. Or do you mean something else. Please provide precise reproduction steps. Also please provide programs/strategies that should be used to replicate this.


code:

package test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.HashSet;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeMap;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
import com.dukascopy.api.system.ClientFactory;
import com.dukascopy.api.system.IClient;

public class TestOnTickVsReadTicks extends Thread implements IStrategy {

   public static String dir = "/home/user/tmp/data";
   private FileWriter fileWriter;

   private String format(long time) {
      try {
         Date date = new Date(time);

         SimpleDateFormat sdf = new SimpleDateFormat(
               "yyyy-MM-dd HH:mm:ss.SSS");
         sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
         return sdf.format(date);

      } catch (Exception ex) {
         ex.printStackTrace();
         System.exit(1);
      }

      return null;
   }

   @Override
   public void onStart(IContext context) throws JFException {
      // TODO Auto-generated method stub

   }

   @Override
   public void onTick(Instrument instrument, ITick tick) throws JFException {
      try {
         if (fileWriter == null) {
            File d = new File(dir);
            if (!d.exists()) {
               d.mkdirs();
            }
            fileWriter = new FileWriter(dir + "/" + instrument.toString().replace("/", "") + ".csv");
         } else {
            String str = format(tick.getTime()) + "," + tick.getBid() + "," + tick.getAsk() + "\n";
            System.out.print(instrument.toString().replace("/", "") + "," + str);
            fileWriter.write(str);
            fileWriter.flush();
         }
      } catch (Exception ex) {
         ex.printStackTrace();
         System.exit(1);
      }
   }

   @Override
   public void onBar(Instrument instrument, Period period, IBar askBar,
         IBar bidBar) throws JFException {
      // TODO Auto-generated method stub

   }

   @Override
   public void onMessage(IMessage message) throws JFException {
      // TODO Auto-generated method stub

   }

   @Override
   public void onAccount(IAccount account) throws JFException {
      // TODO Auto-generated method stub

   }

   @Override
   public void onStop() throws JFException {
      // TODO Auto-generated method stub

   }

   @Override
   public void run() {
      String jnlpHttpUrl_Real = "https://www.dukascopy.com/client/live/jclient/jforex.jnlp";
      String userName_Real = "user";
      String password_Real = "password";
   
      
      try {
         IClient client = ClientFactory.getDefaultInstance();
         
         while (true) {
            client.connect(jnlpHttpUrl_Real, userName_Real, password_Real);
            
            int i = 10; // wait max ten seconds
            while (i > 0 && !client.isConnected()) {
               Thread.sleep(1000);
               i--;
            }
   
            if (client.isConnected()) {
               System.out.println("connected");
               break;
            } else {
               System.out.println("not connected");
            }
         }
         
         Set<Instrument> instruments = new HashSet<Instrument>();
         instruments.add(Instrument.EURUSD);

         client.setSubscribedInstruments(instruments);
         
         client.startStrategy(this);
         
      } catch (Exception ex) {
         ex.printStackTrace();
         System.exit(1);
      }
   }
   
   private static long parse(String str) {
      return parse(str, "yyyy-MM-dd HH:mm:ss.SSS", TimeZone.getTimeZone("UTC"));
   }
   
   private static long parse(String dateTime, String format, TimeZone timeZone) {
      try
        {
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            sdf.setTimeZone(timeZone);
            return sdf.parse(dateTime).getTime();
        }
        catch(Exception ex)
        {
           System.exit(1);
           return 0;
        }
   }
   
   public static void main(String[] args) {
      if (args.length != 1) {
         System.out.println("args.length != 1");
         System.exit(1);
      }
      
      if (args[0].equals("-Writer")) {
         TestOnTickVsReadTicks test = new TestOnTickVsReadTicks();
         test.start();
      } else if (args[0].equals("-Compare")) {
         try {
            TreeMap<Long, ITick> liveTicks = new TreeMap<Long, ITick>();
            BufferedReader reader = new BufferedReader(new FileReader(TestOnTickVsReadTicks.dir + "/EURUSD.csv"));
            String line;
            
            while ((line = reader.readLine()) != null) {
               String[] sArray = line.split(",");
               long time = parse(sArray[0]);
               double bid = Double.parseDouble(sArray[1]);
               double ask = Double.parseDouble(sArray[2]);
               
               ITick tick = new Tick(time, bid, ask);
               liveTicks.put(time, tick);
            }
            reader.close();
            
            System.out.println("TODO: just compare TreeMap<Long, ITick> liveTicks with readTicks");
         } catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
         }
      } else {
         System.out.println("bad args");
         System.exit(1);
      }
      
   }
   
   private static class Tick implements ITick {

      private long time;
      private double bid;
      private double ask;
      
      
      public Tick(long time, double bid, double ask) {
         super();
         this.time = time;
         this.bid = bid;
         this.ask = ask;
      }

      @Override
      public long getTime() {
         return time;
      }

      @Override
      public double getAsk() {
         return ask;
      }

      @Override
      public double getBid() {
         return bid;
      }

      @Override
      public double getAskVolume() {
         // TODO Auto-generated method stub
         return 0;
      }

      @Override
      public double getBidVolume() {
         // TODO Auto-generated method stub
         return 0;
      }

      @Override
      public double[] getAsks() {
         // TODO Auto-generated method stub
         return null;
      }

      @Override
      public double[] getBids() {
         // TODO Auto-generated method stub
         return null;
      }

      @Override
      public double[] getAskVolumes() {
         // TODO Auto-generated method stub
         return null;
      }

      @Override
      public double[] getBidVolumes() {
         // TODO Auto-generated method stub
         return null;
      }

      @Override
      public double getTotalAskVolume() {
         // TODO Auto-generated method stub
         return 0;
      }

      @Override
      public double getTotalBidVolume() {
         // TODO Auto-generated method stub
         return 0;
      }
      
   }
}
 


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Tue 29 Jul, 2014, 13:46 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
Are you confirm?


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Wed 06 Aug, 2014, 08:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
  • If your program uses some parameters, please describe with which parameters it should get launched.
  • If the program has to be launched multiple times, please describe the run order.
  • If the program does not give itself the errors that you report as error statements (as it is done, for example, in the case that we provided) then please describe how otherwise program demonstrates the error.
  • We do all the testing in DEMO environment.


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks Post rating: 0   New post Posted: Wed 06 Aug, 2014, 09:06 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
API Support wrote:
  • If your program uses some parameters, please describe with which parameters it should get launched.
  • If the program has to be launched multiple times, please describe the run order.
  • If the program does not give itself the errors that you report as error statements (as it is done, for example, in the case that we provided) then please describe how otherwise program demonstrates the error.
  • We do all the testing in DEMO environment.


So You can't replicate?, ok
Please upload saved ticks IStrategy.onTick (last 7 days), so we can compare with my ticks, then:

a) Your IStrategy.onTick == My IStrategy.onTick then must be My IHistory.readTicks != Your IHistory.readTicks
b) Your IStrategy.onTick != My IStrategy.onTick then may be different servers? threads problem?


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks + Full Instructions Post rating: 0   New post Posted: Tue 02 Sep, 2014, 16:00 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
API Support wrote:
  • If your program uses some parameters, please describe with which parameters it should get launched.
  • If the program has to be launched multiple times, please describe the run order.
  • If the program does not give itself the errors that you report as error statements (as it is done, for example, in the case that we provided) then please describe how otherwise program demonstrates the error.
  • We do all the testing in DEMO environment.


run on Linux:

[1] java -Djforex.username=usernameRealAccount -Djforex.password=passwordRealAccount -classpath "/path/to/test.jar:/path/to/dukascopy_libs/*" trader.brokers.dukascopy.test.Main -writerOnTick
[2] java -Djforex.username=usernameRealAccount -Djforex.password=passwordRealAccount -classpath "/path/to/test.jar:/path/to/dukascopy_libs/*" trader.brokers.dukascopy.test.Main -writerReadTicks

second command [2] run after one day if files are equal run after 7 days

$cd /path/to/dukascopy_libs
$find *
7zip-4.65.jar
activation-1.1.jar
commons-lang3-3.0.1.jar
DDS2-Charts-6.16.jar
dds2-common-2.5.29.jar
DDS2-jClient-JForex-2.36.jar
DDS2-TextEditor-1.21.jar
ecj-3.5.2.jar
greed-common-310.jar
jakarta-oro-2.0.8.jar
jakarta-regexp-1.4.jar
jcalendar-1.3.3.jar
JForex-API-2.9.10.jar
JForex-API-2.9.10-sources.jar
jna-3.5.0.jar
lucene-core-3.4.0.jar
lucene-highlighter-3.4.0.jar
lucene-memory-3.4.0.jar
lucene-queries-3.4.0.jar
mail-1.4.jar
mina-core-1.1.7.jar
mina-filter-ssl-1.1.7dc.1.jar
MQL4Connector-2.9.10.jar
MQL4Converter-2.43.jar
msg-0.0.19.jar
patterns-1.36.jar
slf4j-api-1.7.5.jar
ta-lib-0.4.4dc.jar
transport-client-2.5.8.jar
transport-common-0.5.1.jar

application creates "test_data" dir in current working directory, in this directory will be saved ticks

$cd test_data
$ls -l
-rw-r--r-- 1 user user 240 Sep 2 09:58 newConnection-EURUSD-2014-09-02 07:58:09.169.csv
-rw-r--r-- 1 user user 240 Sep 2 16:14 newConnection-EURUSD-2014-09-02 07:58:09.169.csv.readTicks.csv
-rw-r--r-- 1 user user 1473 Sep 2 09:59 newConnection-EURUSD-2014-09-02 07:59:15.666.csv
-rw-r--r-- 1 user user 1473 Sep 2 16:14 newConnection-EURUSD-2014-09-02 07:59:15.666.csv.readTicks.csv
-rw-r--r-- 1 user user 823748 Sep 2 16:13 newConnection-EURUSD-2014-09-02 08:07:06.851.csv
-rw-r--r-- 1 user user 823710 Sep 2 16:14 newConnection-EURUSD-2014-09-02 08:07:06.851.csv.readTicks.csv

files *.csv are created by first command [1]
files *.csv.readTicks.csv are created by second command [2]

$cd test_data
$sha256sum *

files hash x.csv and x.csv.readTicks.csv should be equal if not then run

$diff -u "newConnection-EURUSD-2014-09-02 08:07:06.851.csv" "newConnection-EURUSD-2014-09-02 08:07:06.851.csv.readTicks.csv"

then You will have output:

--- "newConnection-EURUSD-2014-09-02 08:07:06.851.csv" 2014-09-02 16:13:42.000000000 +0200
+++ "newConnection-EURUSD-2014-09-02 08:07:06.851.csv.readTicks.csv" 2014-09-02 16:14:11.000000000 +0200
@@ -1066,8 +1066,6 @@
2014-09-02 08:29:23.004,1.31309,1.31311
2014-09-02 08:29:25.582,1.3131,1.31313
2014-09-02 08:29:25.633,1.31311,1.31316
-2014-09-02 08:29:25.888,1.31315,1.31318
-2014-09-02 08:29:25.990,1.31317,1.3132
2014-09-02 08:29:26.345,1.31319,1.31322
2014-09-02 08:29:26.395,1.3132,1.31322
2014-09-02 08:29:26.700,1.3132,1.31323
@@ -1801,7 +1799,6 @@
2014-09-02 08:37:23.469,1.31223,1.31227
2014-09-02 08:37:23.873,1.31223,1.31225
2014-09-02 08:37:23.975,1.31223,1.31225
-2014-09-02 08:37:24.128,1.3122,1.31223
2014-09-02 08:37:24.635,1.31221,1.31223
2014-09-02 08:37:25.143,1.3122,1.31223
2014-09-02 08:37:25.761,1.3122,1.31224
@@ -2473,6 +2470,7 @@
2014-09-02 08:45:00.586,1.31178,1.31181
2014-09-02 08:45:01.256,1.31178,1.3118
2014-09-02 08:45:02.812,1.31176,1.31179
+2014-09-02 08:45:02.914,1.31176,1.31178
2014-09-02 08:45:02.965,1.31176,1.31178
2014-09-02 08:45:03.118,1.31179,1.3118
2014-09-02 08:45:03.321,1.31177,1.31179
@@ -5625,7 +5623,6 @@
2014-09-02 09:33:59.536,1.31129,1.31131
2014-09-02 09:34:00.583,1.3113,1.31131
2014-09-02 09:34:07.370,1.31129,1.31131
-2014-09-02 09:34:07.943,1.3113,1.31131
2014-09-02 09:34:08.501,1.31129,1.31131
2014-09-02 09:34:09.019,1.3113,1.31131
2014-09-02 09:34:09.527,1.31129,1.31131
@@ -8844,7 +8841,6 @@
2014-09-02 10:34:08.252,1.31165,1.31167
2014-09-02 10:34:10.954,1.31165,1.31168
2014-09-02 10:34:11.473,1.31165,1.31167
-2014-09-02 10:34:11.995,1.31165,1.31168
2014-09-02 10:34:16.756,1.31166,1.31168
2014-09-02 10:34:17.060,1.31167,1.3117
2014-09-02 10:34:17.567,1.31169,1.3117
@@ -9359,7 +9355,6 @@
2014-09-02 10:45:58.174,1.31171,1.31174
2014-09-02 10:45:58.684,1.31171,1.31174
2014-09-02 10:46:00.374,1.31171,1.31173
-2014-09-02 10:46:00.917,1.31171,1.31174
2014-09-02 10:46:04.284,1.31173,1.31175
2014-09-02 10:46:04.790,1.31174,1.31176
2014-09-02 10:46:04.841,1.31176,1.31177
@@ -13460,7 +13455,6 @@
2014-09-02 12:23:03.543,1.31151,1.31155
2014-09-02 12:23:04.657,1.31153,1.31155
2014-09-02 12:23:06.964,1.31152,1.31154
-2014-09-02 12:23:07.470,1.31151,1.31154
2014-09-02 12:23:08.067,1.31152,1.31154
2014-09-02 12:23:08.471,1.3115,1.31154
2014-09-02 12:23:08.623,1.31152,1.31154
@@ -13494,7 +13488,6 @@
2014-09-02 12:23:30.315,1.31162,1.31166
2014-09-02 12:23:30.821,1.31163,1.31166
2014-09-02 12:23:31.851,1.31164,1.31166
-2014-09-02 12:23:37.219,1.31165,1.31167
2014-09-02 12:23:37.725,1.31165,1.31166
2014-09-02 12:23:39.093,1.31164,1.31166
2014-09-02 12:23:40.801,1.31164,1.31166
@@ -13793,6 +13786,7 @@
2014-09-02 12:28:04.767,1.3116,1.31165
2014-09-02 12:28:06.694,1.31161,1.31164
2014-09-02 12:28:06.998,1.31165,1.31168
+2014-09-02 12:28:07.049,1.31167,1.3117
2014-09-02 12:28:07.100,1.31168,1.3117
2014-09-02 12:28:07.354,1.31172,1.31175
2014-09-02 12:28:07.405,1.31172,1.31175
@@ -18126,6 +18120,7 @@
2014-09-02 13:42:12.659,1.3124,1.31242
2014-09-02 13:42:13.178,1.31237,1.31241
2014-09-02 13:42:13.279,1.31236,1.31238
+2014-09-02 13:42:13.381,1.31233,1.31236
2014-09-02 13:42:13.432,1.31234,1.31235
2014-09-02 13:42:13.533,1.31232,1.31234
2014-09-02 13:42:13.635,1.31232,1.31234
@@ -18258,6 +18253,7 @@
2014-09-02 13:44:06.230,1.3126,1.31262
2014-09-02 13:44:06.533,1.31264,1.31267
2014-09-02 13:44:06.736,1.31266,1.31269
+2014-09-02 13:44:06.889,1.31269,1.31271
2014-09-02 13:44:06.940,1.3127,1.31273
2014-09-02 13:44:07.041,1.31271,1.31273
2014-09-02 13:44:07.294,1.3127,1.31274
@@ -18335,7 +18331,6 @@
2014-09-02 13:45:06.621,1.31254,1.31256
2014-09-02 13:45:07.127,1.31254,1.31257
2014-09-02 13:45:07.633,1.31254,1.31256
-2014-09-02 13:45:07.886,1.31251,1.31254
2014-09-02 13:45:08.392,1.31252,1.31255
2014-09-02 13:45:14.183,1.31253,1.31255
2014-09-02 13:45:14.689,1.31253,1.31256
@@ -19230,6 +19225,8 @@
2014-09-02 14:00:02.493,1.3119,1.31202
2014-09-02 14:00:02.798,1.31192,1.31198
2014-09-02 14:00:02.950,1.3119,1.31202
+2014-09-02 14:00:03.001,1.31191,1.31204
+2014-09-02 14:00:03.102,1.31195,1.31205
2014-09-02 14:00:03.153,1.31195,1.31207
2014-09-02 14:00:03.255,1.31195,1.31205
2014-09-02 14:00:03.560,1.31198,1.31208
@@ -19373,6 +19370,8 @@
2014-09-02 14:00:34.821,1.31201,1.31203
2014-09-02 14:00:34.923,1.31203,1.31207
2014-09-02 14:00:35.278,1.31203,1.31209
+2014-09-02 14:00:35.380,1.31206,1.31212
+2014-09-02 14:00:35.432,1.31206,1.31209
2014-09-02 14:00:35.484,1.31205,1.31208
2014-09-02 14:00:35.586,1.31204,1.31208
2014-09-02 14:00:36.098,1.31204,1.31207


Attachments:
newConnection-EURUSD-2014-09-02 07:58:09.169.csv [240 Bytes]
Downloaded 161 times
newConnection-EURUSD-2014-09-02 07:58:09.169.csv.readTicks.csv [240 Bytes]
Downloaded 166 times
newConnection-EURUSD-2014-09-02 07:59:15.666.csv [1.44 KiB]
Downloaded 172 times
newConnection-EURUSD-2014-09-02 07:59:15.666.csv.readTicks.csv [1.44 KiB]
Downloaded 169 times
newConnection-EURUSD-2014-09-02 08:07:06.851.csv [804.44 KiB]
Downloaded 168 times
newConnection-EURUSD-2014-09-02 08:07:06.851.csv.readTicks.csv [804.4 KiB]
Downloaded 156 times
newConnection-EURUSD-2014-09-02 14:32:35.397.csv [744 Bytes]
Downloaded 156 times
test-src.zip [4.43 KiB]
Downloaded 127 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks + Full Instructions Post rating: 0   New post Posted: Wed 17 Sep, 2014, 13:08 

User rating: 3
Joined: Fri 11 Oct, 2013, 13:49
Posts: 34
Are You confirm?


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks + Full Instructions Post rating: 0   New post Posted: Wed 17 Sep, 2014, 14:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The investigation will get resumed as soon as available.


 
 Post subject: Re: IStrategy.onTick != IHistory.readTicks + Full Instructions Post rating: 0   New post Posted: Sun 15 May, 2016, 10:09 
User avatar

User rating: 0
Joined: Tue 08 Mar, 2016, 19:22
Posts: 5
API Support wrote:
The investigation will get resumed as soon as available.


Seems that most was fixed, thanks

but not all:

live tick: EUR/USD 2016-05-06 21:00:00.094,1.14023,1.14092
IHistory.readTicks time: 2016-05-08 21:01:15.670
from: 2016-05-06 21:00:00.094
to: 2016-05-08 21:00:32.705
returns only one tick: 2016-05-08 21:00:32.705,1.13936,1.13986


 

Jump to:  

cron
  © 1998-2024 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