Bar offset

Optuma Forums Optuma Scripting Bar offset

Tagged: ,

  • This topic has 6 replies, 3 voices, and was last updated 1 month ago by Jon.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #69695
    Jon
    • Topics: 7
    • Replies: 8
    • Posts: 15

    Hello,

    Is it possible to offset indicators (CCI, RSI, etc) similar to how you can offset in high, low, close? ie CCI 1 bar ago is above CCI 2 bars ago.

    #69697
    James
    • Topics: 21
    • Replies: 12
    • Posts: 33

    Hi Jon, this is how I do offsets.

    Attached is a file with the formulas.
    I hope this what you are looking for, Jamie

    Attachments:
    #69715
    Jon
    • Topics: 7
    • Replies: 8
    • Posts: 15

    That worked thanks alot James

    #69723
    Darren
    • Topics: 73
    • Replies: 923
    • Posts: 996

    Another option is to use square brackets for the offset, so [1] is the previous bar’s value, [2] is two bars ago, etc. The following works the same as Jamie’s code above:

    #69935
    Jon
    • Topics: 7
    • Replies: 8
    • Posts: 15

    Thank Darren, So would this example be appropriate with the brackets, MA(CALC=High, BARS=10)[1] – MA(BARS=10, CALC=Low)[1] ?

    #69937
    Darren
    • Topics: 73
    • Replies: 923
    • Posts: 996

    Correct – that would calculate the difference between yesterday’s moving average values.

    #69939
    Jon
    • Topics: 7
    • Replies: 8
    • Posts: 15

    Thanks D!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest