Dukascopy
 
 
Wiki JStore Search Login

Bad data in Renko feed
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Fri 25 Apr, 2014, 18:35 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Dear Support,

Could you give us an estimation about when will the 'fix' be available? I am talking about the issue of the feedData (not being the last formed brick).

@scotpip
thumbs up for the detailed, thorough testing and explanation!


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Tue 29 Apr, 2014, 07:16 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
It should be ready in few weeks on JForex4. Will implement in old JForex right after.


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Wed 28 May, 2014, 16:00 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Dear support,

Do you have any further update as to when this bug will be fixed?

Many thanks

@scotpip
to echo what has been said by @tcsabina, well done on pressing with this, many thanks. Without this bug being fixed all renko system are essentially worthless.


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Mon 02 Jun, 2014, 09:12 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
Coming in JForex 4 version 4.08 for testing. Planned to be deployed next week.


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Mon 02 Jun, 2014, 12:40 

User rating: 2
Joined: Thu 07 Nov, 2013, 12:15
Posts: 121
Thanks for the update!


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Tue 17 Jun, 2014, 14:12 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
Available on JForex4, version 4.08

You are welcome to leave your feedback here: viewtopic.php?f=200&t=51402


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Tue 17 Jun, 2014, 19:28 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
Good evening,
I tried to run a test with JForex4 4.08 using a procedure running in JForex but
I received an error message "Error in strategy: java.lang.NullPointerException at null"

Has anything changed in RenkoFeedDescriptor?


Messages:
17/06/2014 18:20:20   Strategy "RenkoTest" is stopped at 2014-06-17 18:20:20.469 GMT on the local computer with parameters ""=[FeedDescriptor [dataType=RENKO, instrument=EUR/JPY, offerSide=Bid, priceRange=THREE_PIPS, ]]
17/06/2014 18:20:20   Stopping "RenkoTest" strategy at 2014-06-17 18:20:20.447 GMT on the local computer
17/06/2014 18:20:20   Error in strategy: java.lang.NullPointerException at null
17/06/2014 18:20:20   Starting strategy: singlejartest.RenkoTest
17/06/2014 18:20:20   Starting "RenkoTest" strategy at 2014-06-17 18:20:20.241 GMT on the local computer
17/06/2014 18:19:20   Connected to d-ja-gva-101-135-154
17/06/2014 18:19:00   Reconnecting ...
17/06/2014 18:18:55   Reconnection pause: 5 seconds.


Strategy:
package singlejartest;

import java.io.*;
import java.util.*;

import com.dukascopy.api.util.DateUtils;
import com.dukascopy.api.*;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IFeedListener;
import com.dukascopy.api.feed.util.RenkoFeedDescriptor;
import com.dukascopy.api.feed.IRenkoBarFeedListener;
import com.dukascopy.api.feed.IRenkoBar;
import com.dukascopy.api.feed.ITickBar;

public class RenkoTest implements IStrategy, IRenkoBarFeedListener, IFeedListener
{
    @Configurable("")
    public IFeedDescriptor renkoFeedDescriptor = new RenkoFeedDescriptor(Instrument.EURJPY, PriceRange.valueOf(3), OfferSide.ASK);

    private ITick tick;
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
   
    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();
        context.setSubscribedInstruments(java.util.Collections.singleton(renkoFeedDescriptor.getInstrument()), true);
        context.subscribeToFeed(renkoFeedDescriptor, this);
        context.subscribeToRenkoBarFeed(renkoFeedDescriptor.getInstrument(), renkoFeedDescriptor.getOfferSide(), renkoFeedDescriptor.getPriceRange(), this);
        LogToFile ("inizia");
    }

    public void onAccount(IAccount account) throws JFException
    {

    }

    public void onMessage(IMessage message) throws JFException
    {

    }

    public void onStop() throws JFException
    {

    }

    public void onTick(Instrument instrument, ITick tick) throws JFException
    {
        if (!instrument.equals(renkoFeedDescriptor.getInstrument()))
        {
            return;
        }
        this.tick = tick;
        double value = 0.0;
        double volume = 0.0;
        if (renkoFeedDescriptor.getOfferSide() == OfferSide.ASK)
        {
            value = tick.getAsk();
            volume = tick.getAskVolume();
        }
        else
        {
            value = tick.getBid();
            volume = tick.getBidVolume();
        }
        ITickBar currentTickBar = history.getTickBar(renkoFeedDescriptor.getInstrument(), renkoFeedDescriptor.getOfferSide(), TickBarSize.valueOf(3), 0);
        IRenkoBar bar = history.getRenkoBar(renkoFeedDescriptor.getInstrument(), renkoFeedDescriptor.getOfferSide(), renkoFeedDescriptor.getPriceRange(), 0);
        console.getOut().println(DateUtils.format(ora()) +
                                 " tick: time: " + DateUtils.format(tick.getTime()) +
                                 " tick value: " + value +
                                 " tick volume: " + volume +
                                 " FEC: " + bar.getFormedElementsCount() +
                                 " incompleta endTime: " + DateUtils.format(bar.getEndTime()));
        LogToFile(DateUtils.format(ora()) +
                  " tick: time: " + DateUtils.format(tick.getTime()) +
                  " tick value: " + value +
                  " tick volume: " + volume +
                  " FEC: " + bar.getFormedElementsCount() +
                  " incompleta endTime: " + DateUtils.format(bar.getEndTime()));
    }

    @Override        //RENKO
    public void onBar(Instrument instrument, OfferSide offerSide, PriceRange brickSize, IRenkoBar bar)
    {
        if (instrument.equals(renkoFeedDescriptor.getInstrument()) &&
            offerSide.equals(renkoFeedDescriptor.getOfferSide()) &&
            brickSize.equals(renkoFeedDescriptor.getPriceRange()))
        {
            console.getOut().println(DateUtils.format(ora()) +
                                     " onBar: renko bar start: " + DateUtils.format(bar.getTime()) +
                                     " bar end: " + DateUtils.format(bar.getEndTime()) +
                                     " ticktime: " + DateUtils.format(tick.getTime()) +
                                     " open: " + bar.getOpen() +
                                     " high: " + bar.getHigh() +
                                     " low: " + bar.getLow() +
                                     " close: " + bar.getClose());
            LogToFile(DateUtils.format(ora()) +
                      " onBar: renko bar start: " + DateUtils.format(bar.getTime()) +
                      " bar end: " + DateUtils.format(bar.getEndTime()) +
                      " ticktime: " + DateUtils.format(tick.getTime()) +
                      " open: " + bar.getOpen() +
                      " high: " + bar.getHigh() +
                      " low: " + bar.getLow() +
                      " close: " + bar.getClose());
        }
    }

    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException
    {

    }

    @Override
    public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData)
    {
        console.getOut().println(DateUtils.format(ora()) +
                                 " feedData: renko bar completed: " + feedData +
                                 " ticktime: " + DateUtils.format(tick.getTime()));
        LogToFile(DateUtils.format(ora()) +
                  " feedData: renko bar completed: " + feedData +
                  " ticktime: " + DateUtils.format(tick.getTime()));
//        console.getOut().println("feed description: " + feedDescriptor);
    }

    private long ora ()
    {
        long timeOra = 0;
        if (engine.getType() == IEngine.Type.TEST)
        {
            timeOra = tick.getTime();
        }
        else
        {
            timeOra = System.currentTimeMillis();
        }
        return timeOra;
    }

    private void LogToFile (String stringa)
    {
        if (stringa.length() == 0) return;

        String logFile = "renko_" + renkoFeedDescriptor.getInstrument().toString().replace("/","") + ".log";
        File file = new File(context.getFilesDir(), logFile);
        try
        {
            if (stringa == "inizia")
            {
                file.delete();
            }
            else
            {
                FileWriter fstream = new FileWriter(file.toString(), true);
                BufferedWriter out = new BufferedWriter(fstream);
                out.append(stringa + "\n");
                out.close();
            }
        }
        catch (IOException e)
        {
            e.printStackTrace (console.getErr());
        }
    }
}


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Wed 18 Jun, 2014, 07:39 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
There is no in-progress bar anymore in Renko according to the new calculation system.
Change the code to:
IRenkoBar bar = history.getRenkoBar(renkoFeedDescriptor.getInstrument(), renkoFeedDescriptor.getOfferSide(), renkoFeedDescriptor.getPriceRange(), 1);

You need to get acquainted with Steve Nison's theory of Renko formation in order to understand why the in-progress bar is not possible anymore. It has been discussed here: viewtopic.php?f=85&t=50994&start=0


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Wed 18 Jun, 2014, 08:25 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
Same error with:

IRenkoBar bar = history.getRenkoBar(renkoFeedDescriptor.getInstrument(), renkoFeedDescriptor.getOfferSide(), renkoFeedDescriptor.getPriceRange(), 1);


It only works if I remove the line:

// IRenkoBar bar = history.getRenkoBar(renkoFeedDescriptor.getInstrument(), renkoFeedDescriptor.getOfferSide(), renkoFeedDescriptor.getPriceRange(), 1);

Is there any problem in history?


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Wed 18 Jun, 2014, 09:55 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
There is another problem,

with the attached procedure is not recorded and no event onBar or FeedData although there are 3 completed brics graphic from 06:51:33:203 to 08:37:25:760:

2014-06-18

1) 07:47:00.000 - 08:15:59.999
2) 08:16:00.000 - 08:24:59.999
3) 08:26:00.000 - 08:30:59.999
4) 08:31:00.000 - .....

As you can see from the attached file.


Attachments:
RenkoTest.java [6.51 KiB]
Downloaded 155 times
renko_EURJPY.log.zip [52.41 KiB]
Downloaded 122 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: Bad data in Renko feed Post rating: 0   New post Posted: Wed 18 Jun, 2014, 12:57 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Quote:
Available on JForex4, version 4.08

How about the current JForex platform? Or if that is not going to be modified with this new Renko calculation, when do you plan the release the Live version if JForex 4?


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Fri 27 Jun, 2014, 12:50 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Hi,
Is there any update on the above?
Thanks
Quote:
It should be ready in few weeks on JForex4. Will implement in old JForex right after.


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Mon 30 Jun, 2014, 13:40 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
The bug is fixed in 4.08.1 available on DEMO. There was an exception, that's why you didn't receive bars in his strategy.

However, the code you have provided shows that you do not understand renko sessions and renko creation points.
By default renko session is one minute and creation point is close price. It looks like you expect renkos on each tick, not after every minute (session) is finished. If you want to create a feed, which gets calculated on each tick, then you must provide a renko feed descriptor, where the renko session is set to Period.TICK.

In the sample provided below we corrected/simplified everything. The idea is still similar to the given one.

package renko_bug;

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.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.ITimedData;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.OfferSide;
import com.dukascopy.api.Period;
import com.dukascopy.api.PriceRange;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IFeedListener;
import com.dukascopy.api.feed.util.RenkoFeedDescriptor;

@SuppressWarnings("deprecation")
public class RenkoTest implements IStrategy, IFeedListener {
   
   @Configurable("")
    public IFeedDescriptor renkoFeedDescriptor = new RenkoFeedDescriptor(Instrument.EURJPY, PriceRange.valueOf(3), OfferSide.ASK); //default renko session is 1min, creation point = close

    private IConsole console;
   
    public void onStart(IContext context) throws JFException {
        this.console = context.getConsole();
        context.setSubscribedInstruments(java.util.Collections.singleton(renkoFeedDescriptor.getInstrument()), true);
        context.subscribeToFeed(renkoFeedDescriptor, this);
    }

    public void onAccount(IAccount account) throws JFException { }
    public void onMessage(IMessage message) throws JFException { }
    public void onStop() throws JFException { }
    public void onTick(Instrument instrument, ITick tick) throws JFException { }
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
       if (Period.ONE_MIN.equals(period) && Instrument.EURJPY.equals(instrument)){
          console.getOut().println("One min ask candle finished: " + askBar );          
       }
    }

    @Override
    public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
        console.getOut().println( " onFeedData: renko bar completed: " + feedData );
    }

}


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Mon 30 Jun, 2014, 13:45 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
tcsabina wrote:
Quote:
Available on JForex4, version 4.08

How about the current JForex platform? Or if that is not going to be modified with this new Renko calculation, when do you plan the release the Live version if JForex 4?


We will start implementing this in old JForex as soon as you give a positive feedback ;)


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Tue 01 Jul, 2014, 14:01 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
Seems to be ok, only FEC is wrong.


01/07/2014 12:52:01 time: 2014-07-01 12:52:01:043 onFeedData: renko bar completed: StartTime: 2014-07-01 12:49:00.000 EndTime: 2014-07-01 12:51:59.999 O: 138.93 C: 138.9 H: 138.93 L: 138.9 V: 146.85 FEC: 1
01/07/2014 12:49:00 time: 2014-07-01 12:49:00:384 onFeedData: renko bar completed: StartTime: 2014-07-01 12:14:00.000 EndTime: 2014-07-01 12:48:59.999 O: 138.96 C: 138.93 H: 138.96 L: 138.93 V: 2711.89 FEC: 1
01/07/2014 12:14:00 time: 2014-07-01 12:14:00:186 onFeedData: renko bar completed: StartTime: 2014-07-01 11:54:00.000 EndTime: 2014-07-01 12:13:59.999 O: 138.96 C: 138.99 H: 138.99 L: 138.96 V: 1862.78 FEC: 1
01/07/2014 11:54:01 time: 2014-07-01 11:54:01:035 onFeedData: renko bar completed: StartTime: 2014-07-01 11:52:00.000 EndTime: 2014-07-01 11:53:59.999 O: 138.96 C: 138.93 H: 138.96 L: 138.93 V: 225.48 FEC: 1
01/07/2014 11:52:00 time: 2014-07-01 11:52:00:652 onFeedData: renko bar completed: StartTime: 2014-07-01 11:46:00.000 EndTime: 2014-07-01 11:51:59.999 O: 138.99 C: 138.96 H: 138.99 L: 138.96 V: 508.8 FEC: 1
01/07/2014 11:46:00 time: 2014-07-01 11:46:00:192 onFeedData: renko bar completed: StartTime: 2014-07-01 11:11:00.000 EndTime: 2014-07-01 11:45:59.999 O: 139.02 C: 138.99 H: 139.02 L: 138.99 V: 2462.13 FEC: 1
01/07/2014 11:11:00 time: 2014-07-01 11:11:00:303 onFeedData: renko bar completed: StartTime: 2014-07-01 10:46:00.000 EndTime: 2014-07-01 11:10:59.999 O: 139.05 C: 139.02 H: 139.05 L: 139.02 V: 1914.63 FEC: 1
01/07/2014 10:46:01 time: 2014-07-01 10:46:01:056 onFeedData: renko bar completed: StartTime: 2014-07-01 09:49:00.000 EndTime: 2014-07-01 10:45:59.999 O: 139.08 C: 139.05 H: 139.08 L: 139.05 V: 3790.91 FEC: 1

I await to the implementation on JForex 2 to backtesting

Thank you


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Tue 01 Jul, 2014, 14:31 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
What is the session used here? Base period 1 week or Infinity?


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Tue 01 Jul, 2014, 14:38 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
Base period 1 week.


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Wed 02 Jul, 2014, 09:40 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
FEC issue has been fixed. Will be deployed in next release in few weeks.


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Mon 14 Jul, 2014, 19:19 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
There is any news about the availability in JForex 2?


 
 Post subject: Re: Bad data in Renko feed Post rating: 0   New post Posted: Thu 17 Jul, 2014, 16:39 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
Only one thing: we are working on this. ;)


 

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