Week To Date Change

Optuma Forums Optuma Scripting Week To Date Change

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #68455
    Edward
    • Topics: 11
    • Replies: 8
    • Posts: 19

    I know this is simple but I cannot get a consistent result.  I simply want to script a column that displays the percentage price change for the week from Fridays close.
    This script works up until Friday every week:

    then I have to change the code to :

    Is there a way to capture the price change weekly that I’m missing?

    #68473
    Darren
    • Topics: 70
    • Replies: 832
    • Posts: 902

    Hi Ed,

    Try using the Rate of Change function set to weekly timeframe and 1 bar to give week-to-date change:

    Capture

    Similarly, month-to-date:

    Quarter-to-date:

    Year-to-date:

    Don’t forget to divide by 100 if you want to display the results as a percentage in a watchlist:

    Capture

    2 users thanked author for this post.
    #68481
    Edward
    • Topics: 11
    • Replies: 8
    • Posts: 19

    Perfect!  Thank you!  Why I didn’t think to use ROC puzzles me….

    #68627
    Edward
    • Topics: 11
    • Replies: 8
    • Posts: 19

    It seems the code provided does not work-(at least not on Monday) which was the issue I had before? The script column is the last one where as the day change(and its Tuesday while yesterday was a holiday, so it should be week to date as well) is the Change % column

    #68651
    Darren
    • Topics: 70
    • Replies: 832
    • Posts: 902

    Hi Ed,

    Is this still giving incorrect values? If so please right-click on the page tab and Export Page and send to support and we’ll take a look.

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

Pin It on Pinterest