Announcement

Collapse
No announcement yet.

Study syntax question

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

  • Study syntax question

    Originally posted by Alexis C. Montenegro
    ........Therefore if you are generating signals based on multiple time frames you should always consider using completed bars else you will get false signals in real time or incorrect results in back tests (because they are forward looking).
    Using completed intervals will instead ensure that real time and historical signals always match .....
    Alex
    Further to the recommendation above from this thread, I am trying to decide if I should be using the getSeries command in my final return statement.

    I am working on an EFS to use stochastics (stochs) in two timeframes within a 15 minute chart. When 60 minute stochs is about to or is already rising, and 15 minute stochs turns up, that is my buy signal. I plan to plot the 15 minute stochs, and set the chart BG color based on the 60 minute stochs condition (i.e. not plot the 60 minute stochs)

    If 20 minutes into an hour, a previously flat or falling 60 minute stochs is showing signs of rising, and the 15 minute stochs is turning up, that's fine, I want to see that signal. I understand that by the end of the hour, the 60 minute stochs may not close up but I'd rather see the early potentially false signal, than wait for a later confirmed signal.

    If I understood the previous posts, the getSeries command would make plotting of the non-chart timeframe study more accurate (?), but I don't plan to plot the 60 min stochs in my 15 min chart.

    Without the getSeries command, would my 60 min stochs not be accurate when I first loaded the chart in the morning - would it take 60 minutes of data for it to become accurate? Otherwise, I'm not concerned with historical signals (backtesting).

    Is using getSeries any more processor intensive?

    At the moment, I have one EFS for the 15 minute stochs which I've used for a while now, and I'm working on the 2nd EFS for the 60 minute stochs. Once they both work, I'll consider combining them, if that matters.

    So, in my application is there a need or benefit to using getSeries? I can attach the EFS's if that helps.

    Regards
    shaeffer

  • #2
    shaeffer

    If I understood the previous posts, the getSeries command would make plotting of the non-chart timeframe study more accurate (?), but I don't plan to plot the 60 min stochs in my 15 min chart.
    The values returned by getSeries() or by getValue(0) on historical data and on the current bar are exactly the same so it is not a question of being more (or less) accurate.
    The difference occurrs only when running the efs in in real time where getSeries() will synchronize the plot of all the prior values within the same segment of time of the external interval whereas getValue(0) will only plot the value of the external interval as it is returned at that time leaving prior values unsynchronized. If however you reload the efs the plot returned by getValue(0) up to that moment will then be synchronized since it will be based on historical data (this is explained in the post you reference).
    To answer your question if you are not plotting the 60 min Stochastic on the 15 min chart you don't need to use getSeries() and can use getValue(0) with the understanding that any signal that is generated may not be true at the end of the external interval.

    Is using getSeries any more processor intensive?
    getSeries() will use slightly more resources because it needs to maintain the plots synchronized between all intervals.

    So, in my application is there a need or benefit to using getSeries?
    There isn't if you are not returning those values to the chart. However you still need to consider that unless you are generating signals based on completed bars you could end up with false signals. This is no different that plotting a study on any interval and using signals that are generated intrabar. Until that bar is completed you really have no way of knowing for sure whether those signals will still be true. Just because you are using multiple intervals does not make the logic any different.
    Alex

    Comment

    Working...
    X