Announcement

Collapse
No announcement yet.

Running an EFS with RTH and 24 hours Time Templates in one chart

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

  • Running an EFS with RTH and 24 hours Time Templates in one chart

    I have been trying to write an EFS to run a simple Built-in Study like a Moving Average in one chart that has a 24 hours Time Template taking into the calculation all the bars and also to run it on the same chart, but to ignore all Extended Hours bars, as is the case with RTH Time Templates, with no success.

    Or to put in other words to run a Moving Average study with intraday time intervals while selecting some bars not be calculated each day? That is have the chart set on a certain Time Template and a study inside it to run on a different Time Template.

    I will appreciate any ideas and thank you in advance.

  • #2
    gem2004
    Assuming I understood you correctly you could accomplish this by storing in an array only the required values of the RTH bars (while interrupting execution on the bars outside of RTH) and then using that array as the source for your study
    In the following image you can see a sample script that does this



    The result is shown in the top chart in the following image while the bottom chart shows the built-in MA study using the same parameters and running on an RTH chart of the same symbol.



    As you can see the values at the cursor and on the most recent bar are exactly the same
    Alex


    Originally posted by gem2004 View Post
    I have been trying to write an EFS to run a simple Built-in Study like a Moving Average in one chart that has a 24 hours Time Template taking into the calculation all the bars and also to run it on the same chart, but to ignore all Extended Hours bars, as is the case with RTH Time Templates, with no success.

    Or to put in other words to run a Moving Average study with intraday time intervals while selecting some bars not be calculated each day? That is have the chart set on a certain Time Template and a study inside it to run on a different Time Template.

    I will appreciate any ideas and thank you in advance.

    Comment


    • #3
      Thank you Alex, it works fine.

      Comment

      Working...
      X