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.

How to implement isRecalculateAll in method IndicatorInfo?
 Post subject: How to implement isRecalculateAll in method IndicatorInfo? Post rating: 0   New post Posted: Wed 20 Oct, 2010, 19:08 

User rating: 0
Joined: Thu 14 Oct, 2010, 22:52
Posts: 12
Hi, question about how to use isRecalculateAll. This is not defined as part of constructor IndicatorInfo.

How would I go about using indicatorInfo.isRecalculateAll(true) in an indicator to force computation for all visible candles?

I am successful in plotting indicator values for current bar, but would like to calculate for all candles to give past information of indicator values on the plot.

I notice this happens with built-in indicators, like RSI - it is recalculated for every candle on the chart.

Any suggestions and code examples welcome to provide specific context. Any searches on forum turn up a '404' for the API reference. Although I have read the API entry, I'm not sure where this would go in the code - as I am new to Java.

Thank you.


 
 Post subject: Re: How to implement isRecalculateAll in method IndicatorInf Post rating: 0   New post Posted: Thu 21 Oct, 2010, 19:16 

User rating: 0
Joined: Thu 14 Oct, 2010, 22:52
Posts: 12
Twenty-two views and nothing, eh?

Did I use up my forum question quota? :)

Seriously, anyone know how to force an indicator to calculate values for all visible candles, not just the current bar?

Pretty please?


 
 Post subject: Re: How to implement isRecalculateAll in method IndicatorInf Post rating: 0   New post Posted: Fri 22 Oct, 2010, 19:35 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
when you load in a custom indicator, the platform recursively calculate() the values for every single bar except your lookback and lookforward buffers.

so I'm not sure what you're tring to achieve here as what you seem to be asking is done by default.

still, you can use setRecalculateAll(boolean recalculateAll) instead of isRecalc as that's a getter method. Although I doubt that would solve your problem.


 
 Post subject: Re: How to implement isRecalculateAll in method IndicatorInf Post rating: 0   New post Posted: Sun 24 Oct, 2010, 23:45 

User rating: 0
Joined: Thu 14 Oct, 2010, 22:52
Posts: 12
I see your point, but it doesn't for me. I get the most current value which is retained and scrolled to the left after a newly formed bar increments. The rest is just a flat line. I am only using at the moment 15 bars to calculate one indicator output - and there seem to be more bars than that, so I'm mystified as to why it behaves so.

I appreciate the reply.


 
 Post subject: Re: How to implement isRecalculateAll in method IndicatorInf Post rating: 0   New post Posted: Thu 28 Oct, 2010, 17:04 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
have you tried making another custom indicator with a different algo, did that work as planned?

if not, have you tried running some other sample custom indicator from Support just to see if they work as intended?


 
 Post subject: Re: How to implement isRecalculateAll in method IndicatorInf Post rating: 0   New post Posted: Fri 29 Oct, 2010, 18:25 

User rating: 0
Joined: Thu 14 Oct, 2010, 22:52
Posts: 12
All good points, quantisan. I'm sure that I am making some elementary mistake. I will need to try a few things with a very simple indicator, like say, something that prints the close of a price bar. I usually run up against these kinds of situations where my understanding isn't quite complete.


 
 Post subject: Re: How to implement isRecalculateAll in method IndicatorInf Post rating: 0   New post Posted: Tue 02 Nov, 2010, 08:21 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
TraderTim wrote:
but would like to calculate for all candles to give past information of indicator values on the plot. Thank you.


If you need recalculate indicator for all chart data, please use method IndicatorInfo.setRecalculateAll(true). Method isRecalculateAll() returns if recalculate all flag is set to true.
For more details about IndicatorInfo class, please assume the following JForex Wiki page https://www.dukascopy.com/wiki/index.php ... icatorInfo


 

Jump to:  

cron
  © 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