Correlation to 10YY

Optuma Forums Optuma Scripting Correlation to 10YY

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #66177
    Matthew
    • Topics: 10
    • Replies: 3
    • Posts: 13

    I have been trying to make a script to determine correlation of  S&P 500 sectors to the yield on 10 YR Treasury.  I would like to be able to change the look back period.

    Here is what I have…Can anyone tell me if this is accurate, or help me fix it?

    S1 = GETDATA(CODE=TNX:CBOEI);
    C1 = CLOSE();
    CRL(C1, S1, BARS=252, CALCSTYLE=% Change)

    #66181
    Darren
    • Topics: 66
    • Replies: 680
    • Posts: 746

    Hi Matthew,

    If you are using this in a watchlist or column chart then you will need to increase the amount of data that is loaded (for speed, we limit the data loaded to 1 year). Change the Date Range property to Last 10 Years, and change to a Weekly timeframe. Then change the formula to 52 weeks x 5 years = 260:

    CRL(C1, S1, BARS=260, CALCSTYLE=% Change)

    Capture

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

Pin It on Pinterest