Announcement

Collapse
No announcement yet.

getValue(-1)

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

  • getValue(-1)

    Hello;

    When I use inv() function inside a series and then I access historical value with, for example, getValue(-1) this value is not from chart time frame, correct?
    Raffaele

  • #2
    Raffaele
    That is correct. If the study is based on an external interval the barIndex parameter in getValue() refers to the external interval and not the one being charted.
    Alex

    Comment


    • #3
      Hello Alexis,

      Thank you for your response. Also offsetSeries() is the same?
      Raffaele

      Comment


      • #4
        Raffaele
        You are most welcome.
        No, offsetSeries() runs in the context (interval and/or symbol) of the function in which it is being used.
        So, if you use offsetSeries() in main() - which runs in the context of the chart interval - the offset will refer to the chart data even if the study is based on an external interval. If instead offsetSeries() is used in a separate function or efs to which you are passing an interval or symbol series then it will refer to the external data.
        Alex

        Comment


        • #5
          Hello Alexis,

          I understand now the difference. Thank you again for your response.
          Raffaele

          Comment


          • #6
            Raffaele
            My pleasure
            Alex

            Comment

            Working...
            X