Announcement

Collapse
No announcement yet.

time templates and time span and ma length and data download and computation overhead

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • time templates and time span and ma length and data download and computation overhead

    An efs study, normally run on 15 minute bar charts, performs calculations that use price and the following mas:
    • daily 50sma
    • 60min 200sma, market hours, (approx 30 days)
    • 30min 200ma, market hours, (approx 15 days)
    • 15min 200ma, market hours, (approx 7 days)
    • Shorter simple and period exponential mas are also used for each of these intervals (so the total is around a dozen).
    • I normally have about 5 days worth of bars visible - ie approx 125 bars

    This seems to use a lot of load-time overhead, I believe that time templates might help but I'm not sure I understand them, and the "backfill" function properly. There is also a question of how moving average series might use EFS cpu cycles depending on whether you read the values or not.

    My uncertainties are:
    I assume I set up a time template with periods of 15, 30, 60 and daily (ie one for each of the study time periods) but what bar or day counts should I use? Do I have to take account of the moving average length, or the "length" of the displayed data or both? It's not clear to me whether I add the length of the moving average to the length of the displayed data?

    Should I consider reducing the timespan of the indicator (to be less than that of the chart)? That is, will computing it for a shorter number of (recent) bars than displayed be significantly advantageous? I don't understand whether, say, by not accessing "earlier" data in a moving average series I will be reducing the amount of initial data download and background computation that EFS will do, or whether once the series length (and time template length) is defined all the data gets downloaded and computed whether it will be used or not. If I did reduce the number of bars computed, do I also reduce the time templates by the same amount?

    Do I need setIntervalsBackfill(true); and if so what does it do in this situation?

    Because I want to check the daily 50 ma, am I also likely to end up with 50 days of 15, 30 and 60 minute data also being loaded? I could for instance externally built and update a separate text file of daily 50mas which I would access within the EFS script to avoid creating the 50 day sma series if that was significant.

    Two "types" of result are calculated, one is based on bar closes and only gets calculated when the BARSTATE_NEWBAR occurs (using -1 to access the just closed bar, hence is the same for the historic and current bar), the other calculation is updated "live" within the current bar.
    If I were to throttle the "live" calculation would simply not accessing the moving average figures (every main() call does several "myVar = myMaSeries.getValue(0)") reduce the EFS cpu overhead because it won't calculate them unless requested, or is using setComputeOnClose(true); the only way to make a difference, or is there no difference. Infact, I'm not that bothered by the exact value of the moving averages (they could be a period old and that wouldn't matter), so if (at every tick) I were to only access "myMaSeries.getValue(-1)" rather than "myMaSeries.getValue(0)" would I be reducing the EFS internal overhead significantly? As another approach I have tried to dispense with creating (and storing) any series based on the mas (ie I requested single values when needed), but this seemed to decrease performance.

    I can't find an article that really pins own this whole multiple time period / series / time template issue, is there one already? And another on series update / access overheads would help.

    I'm also not sure whether there is something I should do with a "study" that is different to simply creating a series for each of the moving averages that get used (from a post 02-01-2006 06:45 PM Alexis C. Montenegro which mentions them in passing in terms of EFS1 and EFS2).
    f you use it in a way that is functionally equivalent to the EFS1 study ie you declare the study globally then initialize it once and return the value using the getValue() method then my experience is that the EFS2 studies are actually slightly more efficient. If instead you return the series then the EFS2 study is going to use more computational time but at that point it is also perfoming functions that are not available to the EFS1 version (ie it is enabled to maintain full synchronization between intervals)
    Sorry this is so long.
Working...
X