Announcement

Collapse
No announcement yet.

Average of a Variable

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

  • Average of a Variable

    I would appreciate some help with this EFS

    i am trying to get the average of vPR21 for the last 1240 days and divide it by 2

    i did that by using SMA( 1240, vPR21) /2 but the results is incorrect as it should be about 7.20 for the symbol XGD-TC

    then the next problem is to put that result in upperEnv(21,0,vPRMA21) once i do that it does not give me results for the last 10 days or so

    if I replace vPRMA21 by the 7.20 that we should be getting as a result for vPRMA21 then it works

    thanks in advance for your help

    PS then i need to do same for 63 but once the first works it should be easy to do the other
    Attached Files

  • #2
    richbois
    The reason the script is not working correctly is because both vPR21 and vPR63 are values and not series which the sma() function instead requires.
    In order to do what you want you will need to first calculate vPR21 and vPR63 in a separate function (or efs) and then call them using either the efsInternal() or efsExternal() functions. This will create the series which you can then use as a source for the sma() functions used to calculate vPRMA21 and vPRMA63
    For a more complete explanation and solution see this post in reply to a similar question. In that reply you will also find links to other examples on creating studies on studies using efs2 functions
    Alex

    Comment


    • #3
      Thank You

      Thanks Alex

      I finally got it thanks to your great knowledge

      Comment


      • #4
        richbois
        You are most welcome
        Alex

        Comment

        Working...
        X