Watchlist column showing days since current streak

Optuma Forums Optuma Scripting Watchlist column showing days since current streak

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #67023
    Jason
    • Topics: 3
    • Replies: 2
    • Posts: 5

    Hi,

    I’m looking for a way to add a column to a watchlist that would show the # of days since a stock’s current Days Up (or Days Down) streak. For example, if the stock is currently up 3 days in a row, and it has been 45 days since it was last up 3 days in a row, the column would show “45”. If the stock rises tomorrow, so it’s up 4 days in a row, then the column would change to “125” (or however long it’s been since it was last up 4 days in a row).

    I can do this easily by hardcoding the DU()==3, but then I’d have to change it each day, and it would differ depending on the stocks in the watchlist.

    I can’t figure out how to get the TIMESINCESIGNAL formula to reflect today’s value, because it’s kind of circular.

    Thanks for any help!

    #67034
    Matthew
    • Topics: 5
    • Replies: 521
    • Posts: 526

    Hi,

    I would use a mix of the LAST(), TIMESINCESIGNAL() and NONZERO() functions to get this result.

    On the chart / watchlist the above script would look like this:

    Ex3

    In the above example the current Days Up Streak is two, which last occurred 10 bars ago.

    This script is dynamic, it will take the current Days Up streak value, and find when that same value streak last occurred.

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

Pin It on Pinterest