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.

IFeedDescriptor#equals() gives different result in Local and Remote modes
 Post subject: IFeedDescriptor#equals() gives different result in Local and Remote modes Post rating: 0   New post Posted: Fri 06 Oct, 2017, 23:35 
User avatar

User rating: 8
Joined: Mon 09 Jun, 2014, 21:07
Posts: 49
Location: Poland, Warsaw
Hi,

I would like to report an issue with different outputs of the same code. One output generated running a strategy locally the other running the strategy remotely.

It can be reproduced using following code. Please run it locally and remotely and you will get two different results. It will return "true" when run locally, and "false" when run remotely.

public class StrategyRemoteModeIssue implements IStrategy,IFeedListener  {
    private IEngine engine;
    private IConsole console;
   
    @Configurable(value = "Feed", description = "", obligatory = true)
    public IFeedDescriptor feed = new RenkoFeedDescriptor(
            Instrument.EURUSD,
            PriceRange.ONE_PIP,
            OfferSide.ASK
        );
   
    public void onStart(IContext context) throws JFException {
        engine = context.getEngine();
        console = context.getConsole();
        context.setSubscribedInstruments(Collections.singleton(feed.getInstrument()), true);
        context.subscribeToFeed(feed, this);
    }
   
    @Override
    public void onFeedData(IFeedDescriptor feed, ITimedData data) {
        console.getOut().println(engine.getRunMode() + " | " + this.feed.equals(feed));
    }


Best regards,
Greg


 

Jump to:  

  © 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