Announcement

Collapse
No announcement yet.

MA [in base interval] of an external time interval indicator

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

  • MA [in base interval] of an external time interval indicator

    Hi,
    This question is [somewhat] related to my previous post.

    Is it possible to calculate, in base interval, a moving average of a data series declared in in an external time interval?

    Thank you.
    Mihai Buta

  • #2
    Hello Mihai,

    I'm assuming you mean the main chart interval by base interval. If I'm wrong, please clarify.

    This can be done, but not with the EFS2 functions. For example, when you pass an external time frame moving average as a source to the sma() function, the sma will be calculated on the base interval of the source. To do what you're asking, you would need to manually code a moving average into your EFS using a pop/unshift routine on a global array. This array would be updated with the .getValue(0) value from the external time frame moving average.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Hi Jason,

      Yes, your assumption was correct.
      I, again, hopped that there is a way to address those data series in base interval, because all decisions are made in base interval.

      For example, what hapens if we do NOT pass the time interval info as LAST parameter, as required???

      I wonder why I don't see this issue raised more often.

      regards,
      Mihai
      Mihai Buta

      Comment


      • #4
        Hello Mihai,

        For example, what hapens if we do NOT pass the time interval info as LAST parameter, as required???
        Then the series will be based on your chart's interval.

        var myMA = sma(20, inv(10)) // Series is based on the 10 min chart
        var myMA = sma(20) // Series is based on your current chart's interval
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          Hi Jason.

          I was referring to more complex series, eventually declared with efsInternal, but I can't seem to find the right sintax for them.

          For example, to calculate the sma3 of CCIM2/100, where CCIM2 is in an external interval, but I would like sma3 to be in base interval.

          Is this possible?
          Thank you.
          Mihai
          Mihai Buta

          Comment


          • #6
            Hello Mihai,

            Yes this is possible. You would still use the same method I described previously in this thread using the global array and the pop/unshift routine. It's the same scenario because efsInternal()/efsExternal() both create a Series just as the sma() function creates a series.

            The only difference is that with efsInternal()/efsExternal() you can add a sym()/inv() as the last parameter that tells the EFS2 engine to create the series on the basis of that symbol or interval passed. However, if one of the parameters before the sym()/inv() parameter happens to be an external time frame series, then efsInternal()/efsExternal() will be based on the sym/inv of that series and the last sym()/inv() parameter will be ignored.
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment


            • #7
              Hi Jason,

              Yes, I understand what you are saying and, probably, the array solution is less time consuming than efsInternal [which executes every tick].

              As to passing data series and what happens, it is not very clear to me, maybe some clarification in documentaion of this subject would be useful.

              I will play around with them and see what happens.

              Thanks a lot.
              Mihai
              Last edited by mbuta; 08-27-2005, 08:06 AM.
              Mihai Buta

              Comment

              Working...
              X