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.

getInProgressBar(), how to use it?
 Post subject: getInProgressBar(), how to use it? Post rating: 0   New post Posted: Thu 24 Apr, 2014, 22:58 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Could someone give me an example about how to use the getInProgressBar() function for Renkos?

I want to get some details about the currently forming Renko bar:
Let's suppose I have a strategy that has onFeedData(). This function is called whenever a Renko brick is finished. The feedData parameter is the finished bar, but I need some details (high and low) about the brick that is being created.

I guess the getInProgressBar() function would give me this brick, but I haven't figured out how to use it in a strategy.

Thanks in advance.


 
 Post subject: Re: getInProgressBar(), how to use it? Post rating: 0   New post Posted: Fri 25 Apr, 2014, 19:01 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Little update on this:

    @Override
    public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
        try {
            IRenkoBar renko = history.getRenkoBar(instrument, feedDescriptor.getOfferSide(), feedDescriptor.getPriceRange(), 0);
            IRenkoBar getin  = renko.getInProgressBar();
            if (getin != null)
                print("last getin=%s", getin);
            else
                print("getin null");
            }
        } catch (JFException e) {
            console.getErr().println(e);
            e.printStackTrace();
        }
    }


This code always prints "getin null", so there is no way to get this inProgressBar.

Could this issue be related to this bug, which is about the feedData is not delivering the last formed brick?


 
 Post subject: Re: getInProgressBar(), how to use it? Post rating: 0   New post Posted: Tue 29 Apr, 2014, 15:52 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The getInProgressBar() will return a non-null result only if the current market price is outside the last constructed renko brick.


 

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