Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

RangeBar data feed - no data
 Post subject: RangeBar data feed - no data Post rating: 0   New post Posted: Wed 07 Jan, 2015, 15:01 

User rating: 1
Joined: Mon 27 Feb, 2012, 22:49
Posts: 119
Location: Czech Republic,
Hello support,

I try on live account RangeBar data feed.
---------------
//package jforex;

import java.io.*;
import com.dukascopy.api.*;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IFeedListener;
import com.dukascopy.api.feed.util.RangeBarFeedDescriptor;

public class checkRangeBarFeed implements IStrategy {
//
public IContext context;
public IConsole console;
public PrintStream out;
public PrintStream err;
//

@Override
public void onStart( IContext context ) throws JFException {
//
this.context = context;
this.console = context.getConsole();
this.out = console.getOut();
this.err = console.getErr();
//
out.format( "++++++++++START%n" );
//
IFeedDescriptor descriptor = new RangeBarFeedDescriptor( Instrument.EURUSD, PriceRange.TWO_PIPS, OfferSide.ASK );
//
IFeedListener listener = new IFeedListener() {
@Override
public void onFeedData( IFeedDescriptor feedDescriptor, ITimedData feedData) {}
};
//
//
context.subscribeToFeed( descriptor, listener );
}

@Override
public void onStop() throws JFException {
//
out.format( "++++++++++STOP%n" );
//
}

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

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

@Override
public void onTick( Instrument instrument, ITick tick ) throws JFException {
//
}

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

// @Override
public void onFeedData( IFeedDescriptor feedDescriptor, ITimedData feedData) {
//
out.format( "++++++onFeedData%n" );
//
}

}
-----------------------
But I don't receive any data. What is wrong?

Thanks for help.


 
 Post subject: Re: RangeBar data feed - no data Post rating: 0   New post Posted: Fri 09 Jan, 2015, 16:41 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See example attached. Also take a look at this wiki page: https://www.dukascopy.com/wiki/#Chart_feeds


Attachments:
SubscribeRangeBarFeed.java [1.4 KiB]
Downloaded 76 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.
 

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