Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3597 back-testing IRenkoBarFeedListener
 Post subject: JFOREX-3597 back-testing IRenkoBarFeedListener Post rating: 0   New post Posted: Thu 26 Jan, 2012, 00:11 

User rating: 1
Joined: Tue 30 Aug, 2011, 08:54
Posts: 19
Location: AustraliaAustralia
I call the setDataInterval function with a start date of 3/1/2011 and end date 31/12/2011. I am using a RenkoBarFeedListener. On the first OnBar call I attempt to get history bar details using the IHistory getRenkoBars using the time of the first bar. I get the following exception:

Passed Time [2011-01-02 21:45:00.000] has to be in interval [2007-03-30 16:01:16.387; 292269055-12-02 16:47:04.192]

The interval shown above is totally wrong. Any ideas, or is this another indication that the new Renko Bar support is totally broken.


 
 Post subject: Re: ITesterClient setDataInterval not working API 2.6.50 Post rating: 0   New post Posted: Thu 26 Jan, 2012, 12:45 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For more efficient assistance, could you please provide the example strategy that you use and also the program that launches it?


 
 Post subject: Re: ITesterClient setDataInterval not working API 2.6.50 Post rating: 0   New post Posted: Sun 29 Jan, 2012, 05:47 

User rating: 1
Joined: Tue 30 Aug, 2011, 08:54
Posts: 19
Location: AustraliaAustralia
It is very difficult to send the code as I'm running it from a GUI and there are many files associated with the project. I will try and describe the sequence of events.

1. I create an ITesterClient object.
2. I connect.
3. I start the strategy using the following code:

      Set<Instrument> instruments = new HashSet<Instrument>();
      final ArrayList<InstrumentSettings> settingsList = new ArrayList<InstrumentSettings>();
      
      for (int i = 0; i < selectedInstrumentsModel.getSize(); i++)
      {
         String instrument = (String)selectedInstrumentsModel.get(i);
         instruments.add(Instrument.fromString(instrument));
         InstrumentSettings settings = _settingsData.getSettings(instrument);
         settingsList.add(settings);
      }
      
      _client.setSubscribedInstruments(instruments);  // Note here instruments contains one entry AUD/USD.
      _client.setInitialDeposit(Instrument.AUDUSD.getSecondaryCurrency(), 50000);

      // Set the data range.
      _startBackTest = new DateTime(startDate.getDate());  // The start date is 2011/01/03 (1293976800000 ms)
      _endBackTest = new DateTime(endDate.getDate());     // The end date is 2011/12/31 (1325253600000 ms).

      _client.setDataInterval(Period.TICK, OfferSide.BID, InterpolationMethod.CLOSE_TICK, _startBackTest.getMillis(), _endBackTest.getMillis());
      Date date = new Date(_startBackTest.getMillis());
      progressBar.setMinimum(0);
      Days days = Days.daysBetween(new LocalDate(_startBackTest), new LocalDate(_endBackTest));
      progressBar.setMaximum(days.getDays() + 1);
      progressBar.setValue(0);
      
      addMessage("Retrieving Data from " + _startBackTest.toString("dd/MM/yyyy hh:mm:ss") + " to " + _endBackTest.toString("dd/MM/yyyy hh:mm:ss"));
      startButton.setEnabled(false);
      final BackTestMain main = this;      // Needed so that thread can reference BackTestMain object.

      SwingWorker worker = new SwingWorker()
      {
         public Object construct()
         {
            Future<?> future = _client.downloadData(null);

            // wait for downloading to complete
      
            try
            {
               future.get();
               addMessage("Starting Backtest");

               _backTestStrategy = new BackTestStrategy(main, settingsList,
                                         sessionNameText.getText(),
                                         (SessionStrategyTypes)strategyTypeComboBox.getSelectedItem());
   
         
               _client.startStrategy(_backTestStrategy, new LoadingProgressListener()
               {
                  @Override
                  public void dataLoaded(long startTime, long endTime, long currentTime, String information)
                  {
                     if (information.indexOf("Running") == -1)
                     {
                        addMessage(information);
                     }
                  }

                  @Override
                  public void loadingFinished(boolean allDataLoaded, long startTime, long endTime, long currentTime)
                  {
                     addMessage(String.format("Data load complete, %s data loaded", (allDataLoaded ? "all" : "partial")));
                  }

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

               startButton.setText("Stop");
               enableControls();
            }
            catch (InterruptedException e)
            {
               addMessage("Interrupted exeption: " + e.getMessage());
            }
            catch (ExecutionException e)
            {
               addMessage("Execution exeption: " + e.getMessage());
            }

            return null;
         }
      };

      worker.start();
   }

All is well at this point. The OnStart method gets called in the strategy:

   public void onStart(IContext context) throws JFException 
    {
       _listener.addMessage("Strategy Started");
       
        _context = context;
        _console = context.getConsole();
        _engine = _context.getEngine();
        _history = context.getHistory();
        _indicators = context.getIndicators();

   // subscribe to Renko Bar Feed
   for (StrategyTradeData data : _tradeData.values())  // Note: There is only one item in this list.
   {
      Instrument instrument = Instrument.fromString(data.Session.Settings.CurrencyPair.Name);
      PriceRange renkoBarPriceRange = PriceRange.valueOf(data.Session.Settings.TrendingRenkoBarSize / 10);  // This is 15.
      context.subscribeToRenkoBarFeed(instrument, OfferSide.BID, renkoBarPriceRange, new RenkoBarFeedListener());
              
      // create feed descriptor to use when getting indicator values
      data.RenkoFeedDescriptor = new FeedDescriptor();
      data.RenkoFeedDescriptor.setDataType(DataType.RENKO);
      data.RenkoFeedDescriptor.setInstrument(instrument);
      data.RenkoFeedDescriptor.setOfferSide(OfferSide.BID);
      data.RenkoFeedDescriptor.setPriceRange(renkoBarPriceRange);
   }
    }

Finally, the renko bar listener is called with the first bar.

    class RenkoBarFeedListener implements IRenkoBarFeedListener
    {
   @Override
   public void onBar(Instrument instrument, OfferSide offerSide, PriceRange priceRange, IRenkoBar bar)
   {
         if (_tradeData.containsKey(instrument) == false)
             return;

          StrategyTradeData tradeData = null;
          
      try
      {
             tradeData = _tradeData.get(instrument);
         tradeData.NewBarSnapshot = null;
         InstrumentSettings settings = tradeData.Session.Settings;
            
         if (tradeData.FirstBar == false)
         {   
                 tradeData.NewBarSnapshot = new BarSnapshot(bar, tradeData.Multiplier, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                 tradeData.Bars.add(tradeData.NewBarSnapshot);
                 _listener.progress(new Date(bar.getEndTime()));
         }
         else
         {
            _listener.addMessage(String.format("Reading history bars for %s (%d bars prior to %s)", instrument, _historyBars, getTimeStamp(bar.getEndTime())));
               
            // get RenkoBar history
                 List<IRenkoBar> renkoBarHistory = _history.getRenkoBars(instrument,
                                               OfferSide.BID,
                                                  tradeData.RenkoFeedDescriptor.getPriceRange(),
                                                  _historyBars, // this is 200.
                                                bar.getEndTime(), // time stamp
                                                0); // how many bars after the time stamp (not including bar that includes timestamp)
                
                 if (renkoBarHistory.size() > 0)
                 {
                    int maxIndex = renkoBarHistory.size() - 1;

                    for (int i = 0; i <= maxIndex; i++)
                    {
                       BarSnapshot barSnapshot = new BarSnapshot(renkoBarHistory.get(i), tradeData.Multiplier, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                       tradeData.Bars.add(barSnapshot);
                    }
                    
               _listener.addMessage("Finished history bars for " + instrument + ", started bar feed");
                    tradeData.FirstBar = false;
                 }
                 else
                 {
                    JFException newException = new JFException("History Renko Bar count & History Indicator count was not the same");
         
                    throw newException;
                 }
         }

              // TRADING LOGIC GOES HERE
              
      }
      catch (JFException jfe)
      {
         tradeData.FirstBar = false;
         LOGGER.debug("JF Exception: " + jfe.getMessage());  // Always fails here with the date range exception.
      }
      catch (Exception e)
      {
         tradeData.FirstBar = false;
         LOGGER.debug("Exception: " + e.getMessage());
      }
   }


 
 Post subject: Re: ITesterClient setDataInterval not working API 2.6.50 Post rating: 0   New post Posted: Mon 30 Jan, 2012, 14:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Could you please check if it is fixed with the new release, see:
viewtopic.php?f=113&t=45367


 
 Post subject: IRenkoBarFeedListener broken in 2.6.53 Post rating: 0   New post Posted: Wed 15 Feb, 2012, 12:43 

User rating: -
Hi Support,

First of all the login button does not seem to work at the moment (15/02/2012) on your support site.

I have retested this bug in a very simple test package against API 2.6.55 and the IRenkoFeedListener.onBar() is still never called.

As a guest (I can't login remember?) I can't attach my sample code to this bug report, so I have pasted the contents of the 2 files below:
- RenkoTesterMain3.java
- renkoOnBarTestSimple.java

Please replace the "XXXXX" with valid login details for the test server and retest to validate my results.

thanks,
Christian
package renkoOnBarTestSimple;


import com.dukascopy.api.Instrument;
import com.dukascopy.api.LoadingProgressListener;
import com.dukascopy.api.OfferSide;
import com.dukascopy.api.Period;
import com.dukascopy.api.system.ISystemListener;
import com.dukascopy.api.system.ITesterClient;
import com.dukascopy.api.system.TesterFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.TimeZone;
import java.util.concurrent.Future;

/**
 * This small program demonstrates how to initialize Dukascopy tester and start a strategy
 */
public class RenkoTesterMain3 {
    private static final Logger LOGGER = LoggerFactory.getLogger(RenkoTesterMain3.class);

    //url of the DEMO jnlp
    private static String jnlpUrl = "https://www.dukascopy.com/client/demo/jclient/jforex.jnlp";
    //user name
    private static String userName = "XXXXXX";
    //password
    private static String password = "XXXXX";

    public static void main(String[] args) throws Exception
    {
        //get the instance of the IClient interface
        final ITesterClient client = TesterFactory.getDefaultInstance();
   
        //set the listener that will receive system events
        client.setSystemListener(new ISystemListener()
        {
            @Override
            public void onStart(long processId)
            {
                LOGGER.info("Strategy started: " + processId);
            }

            @Override
            public void onStop(long processId)
            {
                LOGGER.info("Strategy stopped: " + processId);
                File reportFile = new File("C:\\report.html");
                try
                {
                    client.createReport(processId, reportFile);
                }
                catch (Exception e)
                {
                    LOGGER.error(e.getMessage(), e);
                }
                if (client.getStartedStrategies().size() == 0)
                {
                    System.exit(0);
                }
            }

            @Override
            public void onConnect() {
                LOGGER.info("Connected");
            }

            @Override
            public void onDisconnect() {
                //tester doesn't disconnect
            }
        });

        LOGGER.info("Connecting...");
        //connect to the server using jnlp, user name and password
        //connection is needed for data downloading
        client.connect(jnlpUrl, userName, password);

        //wait for it to connect
        int i = 10; //wait max ten seconds
        while (i > 0 && !client.isConnected())
        {
            Thread.sleep(1000);
            i--;
        }
        if (!client.isConnected())
        {
            LOGGER.error("Failed to connect Dukascopy servers");
            System.exit(1);
        }

        //set instruments that will be used in testing
        Set<Instrument> instruments = new HashSet<Instrument>();
        instruments.add(Instrument.EURUSD);
        //instruments.add(Instrument.GBPUSD);
        LOGGER.info("Subscribing instruments..." + instruments.toString());
        client.setSubscribedInstruments(instruments);
       
        //setting initial deposit
        LOGGER.info("Setting initial deposit...");
        client.setInitialDeposit(Instrument.EURUSD.getSecondaryCurrency(), 1100);
        //client.setInitialDeposit(Instrument.AUDUSD.getPrimaryCurrency(), 1100);
       
        //set Dukascopy charges
        //client.setLeverage(100);
        //client.setMarginCutLevel(200);

        //set data interval
        LOGGER.info("Setting backtest interval");
        DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        dfm.setTimeZone(TimeZone.getTimeZone("GMT"));
        Date startDate = dfm.parse("2011-05-01 00:00:00");
        Date endDate = dfm.parse("2011-06-01 00:00:00");
        client.setDataInterval(Period.TICK, OfferSide.BID, ITesterClient.InterpolationMethod.CLOSE_TICK,
                          startDate.getTime(), endDate.getTime());

        //load data
        LOGGER.info("Downloading data");
        Future<?> future = client.downloadData(null);
        //wait for downloading to complete
        future.get();
       
        //start the strategy
        LOGGER.info("Starting strategy");
        client.startStrategy(new renkoTestStrategy3(),
        new LoadingProgressListener()
        {
            @Override
            public void dataLoaded(long startTime, long endTime, long currentTime, String information)
            {
                LOGGER.info(information);
            }

            @Override
            public void loadingFinished(boolean allDataLoaded, long startTime, long endTime, long currentTime)
            {
            }

            @Override
            public boolean stopJob()
            {
                return false;
            }
        });
       
        //now it's running
    }
}
</RenkoTesterMain3.java>

<renkoOnBarTestSimple.java>
package renkoOnBarTestSimple;

import java.io.File;

import com.dukascopy.api.*;
import com.dukascopy.api.feed.FeedDescriptor;
import com.dukascopy.api.feed.IRenkoBar;
import com.dukascopy.api.feed.IRenkoBarFeedListener;


import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

public class renkoTestStrategy3 implements IStrategy
{

   // used for logging
   private static final Logger LOGGER = LoggerFactory.getLogger(renkoTestStrategy3.class);

    private FeedDescriptor renkoFeedDescriptor = null;

    private wtlRenkoBarFeedListener renkoListener = null;
   
   //Configurable strategy parameters
    // general
    @Configurable("Instrument") public Instrument instrument = Instrument.EURUSD;   
    @Configurable("Renko Block Size") public PriceRange renkoBarPriceRange = PriceRange.valueOf(15);
   
       
// *****  JFOREX API EVENT HANDLERS ****************************************************************

    class wtlRenkoBarFeedListener implements IRenkoBarFeedListener
    {
      @Override
      public void onBar(Instrument instrument, OfferSide offerSide, PriceRange priceRange, IRenkoBar bar)
      {
             LOGGER.info("wtlRenkoBarFeedListener.onBar() [" + instrument.toString() + "]: " + priceRange.toString() + " " + bar.toString());

             
      }
    }
   
    public void onStart(IContext context) throws JFException
    {

      // create feed descriptor to use when getting indicator values
      renkoFeedDescriptor = new FeedDescriptor();
      renkoFeedDescriptor.setDataType(DataType.RENKO);
      renkoFeedDescriptor.setInstrument(instrument);
      renkoFeedDescriptor.setOfferSide(OfferSide.BID);
      renkoFeedDescriptor.setPriceRange(renkoBarPriceRange);

      // subscribe to Renko Bar Feed
      renkoListener = new wtlRenkoBarFeedListener();
      context.subscribeToRenkoBarFeed(instrument, OfferSide.BID, renkoBarPriceRange, renkoListener);
       
   }

    public void onMessage(IMessage message) throws JFException
    {       

    }
   
    public void onStop() throws JFException
    {

    }
   
    public void onBar(Instrument instrument, Period period, IBar askbar, IBar bidbar) throws JFException
    {
       if (instrument == this.instrument && period == Period.DAILY)
       {   
          LOGGER.info("renkoTestStrategy.onBar() [" + instrument.toString() + "]: " + bidbar.toString());
       }
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException
    {
   
    }
   
    public void onAccount(IAccount account) throws JFException
    {
       
    }

}


 
 Post subject: Re: IRenkoBarFeedListener broken in 2.6.53 Post rating: 0   New post Posted: Wed 15 Feb, 2012, 15:35 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We tried the program and strategy with Standalone of JForex-API 2.6.55 and we renko bars in onBar:
INFO: Connected
2012.15.2 16:31:26 renko.RenkoTesterMain3 main
INFO: Subscribing instruments...[EUR/USD]
2012.15.2 16:31:26 renko.RenkoTesterMain3 main
INFO: Setting initial deposit...
2012.15.2 16:31:26 renko.RenkoTesterMain3 main
INFO: Setting backtest interval
2012.15.2 16:31:26 renko.RenkoTesterMain3 main
INFO: Downloading data
2012.15.2 16:31:30 renko.RenkoTesterMain3 main
INFO: Starting strategy
2012.15.2 16:31:30 renko.RenkoTesterMain3$1 onStart
INFO: Strategy started: 1
2012.15.2 16:31:31 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304208000000(2011-05-01 00:00:00.000+0000)E:falseO:1.48142C:1.48152L:1.47799H:1.48391V13594.0}
2012.15.2 16:31:32 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304294400000(2011-05-02 00:00:00.000+0000)E:falseO:1.48152C:1.47937L:1.47627H:1.49017V162288.0}
2012.15.2 16:31:33 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304380800000(2011-05-03 00:00:00.000+0000)E:falseO:1.47937C:1.48365L:1.4754H:1.48895V201840.0}
2012.15.2 16:31:34 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304467200000(2011-05-04 00:00:00.000+0000)E:falseO:1.48365C:1.48268L:1.47748H:1.49398V226230.0}
2012.15.2 16:31:36 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304553600000(2011-05-05 00:00:00.000+0000)E:falseO:1.48269C:1.45577L:1.45096H:1.48989V249851.0}
2012.15.2 16:31:37 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304640000000(2011-05-06 00:00:00.000+0000)E:falseO:1.45575C:1.43191L:1.43071H:1.45875V263234.0}
2012.15.2 16:31:37 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304726400000(2011-05-07 00:00:00.000+0000)E:falseO:1.43191C:1.43191L:1.43191H:1.43191V0.0}
2012.15.2 16:31:38 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304812800000(2011-05-08 00:00:00.000+0000)E:falseO:1.4364C:1.43881L:1.43405H:1.43958V11986.0}
2012.15.2 16:31:39 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304899200000(2011-05-09 00:00:00.000+0000)E:falseO:1.43882C:1.43679L:1.4254H:1.44417V256363.0}
2012.15.2 16:31:40 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1304985600000(2011-05-10 00:00:00.000+0000)E:falseO:1.43678C:1.43996L:1.42701H:1.44186V277095.0}
2012.15.2 16:31:42 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305072000000(2011-05-11 00:00:00.000+0000)E:falseO:1.43996C:1.42066L:1.4172H:1.44227V268209.0}
2012.15.2 16:31:43 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305158400000(2011-05-12 00:00:00.000+0000)E:falseO:1.42065C:1.42292L:1.4123H:1.42764V298120.0}
2012.15.2 16:31:45 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305244800000(2011-05-13 00:00:00.000+0000)E:falseO:1.42295C:1.41143L:1.40662H:1.43392V280330.0}
2012.15.2 16:31:45 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305331200000(2011-05-14 00:00:00.000+0000)E:falseO:1.41143C:1.41143L:1.41143H:1.41143V0.0}
2012.15.2 16:31:45 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305417600000(2011-05-15 00:00:00.000+0000)E:falseO:1.40882C:1.4066L:1.40628H:1.40923V10799.0}
2012.15.2 16:31:46 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305504000000(2011-05-16 00:00:00.000+0000)E:falseO:1.40649C:1.4145L:1.4048H:1.42442V272908.0}
2012.15.2 16:31:48 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305590400000(2011-05-17 00:00:00.000+0000)E:falseO:1.41448C:1.42663L:1.41205H:1.42758V279666.0}
2012.15.2 16:31:50 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305676800000(2011-05-18 00:00:00.000+0000)E:falseO:1.42663C:1.42577L:1.41947H:1.42863V223454.0}
2012.15.2 16:31:52 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305763200000(2011-05-19 00:00:00.000+0000)E:falseO:1.42577C:1.43254L:1.42062H:1.43368V251094.0}
2012.15.2 16:31:54 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305849600000(2011-05-20 00:00:00.000+0000)E:falseO:1.43254C:1.41584L:1.41329H:1.43452V217236.0}
2012.15.2 16:31:54 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1305936000000(2011-05-21 00:00:00.000+0000)E:falseO:1.41584C:1.41584L:1.41584H:1.41584V0.0}
2012.15.2 16:31:54 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306022400000(2011-05-22 00:00:00.000+0000)E:falseO:1.41254C:1.41164L:1.40953H:1.41443V12072.0}
2012.15.2 16:31:56 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306108800000(2011-05-23 00:00:00.000+0000)E:falseO:1.41164C:1.40134L:1.39692H:1.41346V247468.0}
2012.15.2 16:31:57 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306195200000(2011-05-24 00:00:00.000+0000)E:falseO:1.40134C:1.40919L:1.40132H:1.41328V233592.0}
2012.15.2 16:32:00 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306281600000(2011-05-25 00:00:00.000+0000)E:falseO:1.40918C:1.40686L:1.40129H:1.41181V254093.0}
2012.15.2 16:32:01 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306368000000(2011-05-26 00:00:00.000+0000)E:falseO:1.40685C:1.41436L:1.40679H:1.42061V255764.0}
2012.15.2 16:32:04 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306454400000(2011-05-27 00:00:00.000+0000)E:falseO:1.41438C:1.43163L:1.41292H:1.43233V244100.0}
2012.15.2 16:32:04 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306540800000(2011-05-28 00:00:00.000+0000)E:falseO:1.43163C:1.43163L:1.43163H:1.43163V0.0}
2012.15.2 16:32:04 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306627200000(2011-05-29 00:00:00.000+0000)E:falseO:1.43203C:1.42894L:1.42779H:1.43209V7022.0}
2012.15.2 16:32:06 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306713600000(2011-05-30 00:00:00.000+0000)E:falseO:1.42895C:1.43328L:1.42567H:1.43518V118526.0}
2012.15.2 16:32:07 renko.renkoTestStrategy3 onBar
INFO: renkoTestStrategy.onBar() [EUR/USD]: {T:1306800000000(2011-05-31 00:00:00.000+0000)E:falseO:1.43328C:1.4424L:1.43255H:1.44366V229401.0}
2012.15.2 16:32:07 renko.RenkoTesterMain3$1 onStop
INFO: Strategy stopped: 1
2012.15.2 16:32:07 renko.RenkoTesterMain3$1 onStop


 
 Post subject: IRenkoBarFeedListener broken in 2.6.53 Post rating: 0   New post Posted: Wed 15 Feb, 2012, 22:05 
User avatar

User rating: 8
Joined: Tue 25 Oct, 2011, 23:02
Posts: 74
Location: Australia, Melbourne
Well this is not the behaviour that we see in 2.6.55

I have attached a very simple package that demonstrates that onBar events are not received in the renkoListener.


Attachments:
renkoTestStrategy3.java [2.44 KiB]
Downloaded 385 times
RenkoTesterMain3.java [5.11 KiB]
Downloaded 391 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: IRenkoBarFeedListener Post rating: 0   New post Posted: Fri 17 Feb, 2012, 00:35 

User rating: -
we are using a standard download of the 2.6.55 JForex API - perhaps you are not? Does your configuration include anything not available in 2.6.55 API?


 
 Post subject: Re: IRenkoBarFeedListener Post rating: 0   New post Posted: Fri 17 Feb, 2012, 10:34 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We tested the case with Standalone API for JForex-API 2.6.55.


 
 Post subject: Re: IRenkoBarFeedListener Post rating: 0   New post Posted: Sat 18 Feb, 2012, 09:59 
User avatar

User rating: 8
Joined: Tue 25 Oct, 2011, 23:02
Posts: 74
Location: Australia, Melbourne
Well, what do you suggest the way forward is then? Given we are getting different behaviour, the issue must lie in configuration.

I only have access to the published API versions - hence I only have one configuration (i.e. JForex API 2.6.55).

I respectfully suggest that your development environment almost certainly has more than one potential configuration. Therefore it is highly likely the issue resides on your end - not mine.

I am happy to take advice on possible solutions but the extremely simple strategy posted above does not produce renko bar output in my eclipse project, yet it does in yours. Perhaps something relating to the Renko feed is missing in the published version of JForex API 2.6.55, yet in your configuration?

regards
f451


 
 Post subject: Re: IRenkoBarFeedListener Post rating: 0   New post Posted: Mon 20 Feb, 2012, 15:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We tried the case on a fresh JForexClientLibrary project for JForex-API 2.6.55 and renko bars did get logged. Could the difference be logging settings? Could you please check if the renko bars get printed when using System.out.println?


 
 Post subject: Re: IRenkoBarFeedListener Post rating: 0   New post Posted: Tue 21 Feb, 2012, 03:04 

User rating: -
Ok, will definitely check that. I hope that is the problem - even at the cost of being highly embarrassed! :)


 
 Post subject: Re: IRenkoBarFeedListener Post rating: 0   New post Posted: Wed 07 Mar, 2012, 12:55 
User avatar

User rating: 8
Joined: Tue 25 Oct, 2011, 23:02
Posts: 74
Location: Australia, Melbourne
I've gone back over this and attempted it again (with JForex API 2.6.60 and 2.6.55) to see if the logging was the issue.

It is not.

The output you posted above is from the IStrategy.onBar() method in the strategy, not from the IRenkoFeedListener.OnBar() method.

I get exactly the same output that you do - however this is output is incorrect - it's missing all of the RenkoFeedListern.OnBar() outputs.

I included logging output from the IStategy.OnBar() to record each daily bar, so I could check how many renko bars occurred each day. This is the output you're seeing.

Could you re-open this issue please?

The problem renders IRenkoFeedListener strategies unusable.


 
 Post subject: Re: IRenkoBarFeedListener Post rating: 0   New post Posted: Thu 08 Mar, 2012, 12:58 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
f451 wrote:
The output you posted above is from the IStrategy.onBar() method in the strategy, not from the IRenkoFeedListener.OnBar() method.

I get exactly the same output that you do - however this is output is incorrect - it's missing all of the RenkoFeedListern.OnBar() outputs.
Yes this is the case.
f451 wrote:
I included logging output from the IStategy.OnBar() to record each daily bar, so I could check how many renko bars occurred each day. This is the output you're seeing.

Could you re-open this issue please?

The problem renders IRenkoFeedListener strategies unusable.
The issue has been registered.


 

Jump to:  

  © 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