Script Help

Optuma Forums Optuma Scripting Script Help

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #66389
    Matthew
    • Topics: 15
    • Replies: 6
    • Posts: 21

    Is there a way to calculate the percent of S&P 500 stocks that are down 10% or more YTD?
    Any help would be much appreciated.

    #66394
    Matthew
    • Topics: 5
    • Replies: 487
    • Posts: 492

    Hi,

    Yes, if you have the Breadth module you can build a custom breading using a modified version of the following script Darren posted earlier this week:

    Set this up to run on the SP500:

    Ex11

    Based on the current value 7% of SP500 stocks have a YTD performance of -%10 or more.

    1 user thanked author for this post.
    #66397
    Matthew
    • Topics: 15
    • Replies: 6
    • Posts: 21

    Thank you.

    #66405
    Darren
    • Topics: 67
    • Replies: 702
    • Posts: 769

    Hi Matthew,

    I think may work better when creating a time series based on YTD performance over multiple years.

    The signal is when the YEARNUM() changes at the beginning of the year, and using the CHANGESINCESIGNAL() function from that point to calculate the YTD% for each day. However, we need to take the close of the day before the signal (ie the close of the previous year) so need to use the [-1] offset.

    Currently there are 6.5% of SPX stocks (33) down more than 10% this year (confirmed in the watchlist). Because the calculations are from the beginning of the year it resets each January:

    Capture

    1 user thanked author for this post.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest