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.

support for efficient calculation of "sum of f over a sliding window" type indicators
 Post subject: support for efficient calculation of "sum of f over a sliding window" type indicators Post rating: 0   New post Posted: Mon 24 Mar, 2014, 14:52 
User avatar

User rating: 0
Joined: Thu 13 Mar, 2014, 17:17
Posts: 13
Location: Hungary,
Hi,
a lot of the indicators I need are of the form Sum of f(i) over [a,b], where f is some local transformation of elements around index i from the array segment [a, b] (or rather [a, 0], where 0 corresponds to current time or index). The simplest case is when we calculate the average of elements over the interval. Let's say the interval is very long, thousands of elements long.. then recalculating the sum on every new data point would be insane.. I would rather have the last one of the elements, f(b) substracted from the sum and the new one, f(a) added. Do you have support for this type of efficient computation of indicators in the JForex-API? I guess I cannot find it... but it may still exist implemented as an optimazition feature in your compiler. Does it exist? How does it work? Is it documented anywhere? Do I need to supply a separate initilazation function? Or just trust your compiler?
thanks!


 
 Post subject: Re: support for efficient calculation of "sum of f over a sliding window" type indicators Post rating: 0   New post Posted: Wed 26 Mar, 2014, 09:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It is up to the indicator/strategy to implement the algorithm as efficient as possible. Also for indicators there are multiple settings which determine how many values and how often they should get calculated/recalculated.


 

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