LowestLow Date

Optuma Forums Optuma Scripting LowestLow Date

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #57319
    Thomas
    • Topics: 98
    • Replies: 124
    • Posts: 222

    Hi,

    I have created a scripts to show the date of the highest 52-week high and a script to show the lowest 52-week low.

    The shown dates in the watch list for the highest 52-week highs seem to be correct but the dates for the lowest 52-week lows are mostly wrong.

    lowest low date

    highest high

    lowest low

    Here are the scripts:

    Date of the highest 52-week high

    Var1 = HIGH() == HIGHESTHIGH(BACKTYPE=Weeks, BARS=52, INCBAR=True);
    BARDATE(Var1)

    Date of the lowest 52-week low

    Var1 = LOW() == LOWESTLOW(BACKTYPE=Weeks, BARS=52, INCBAR=True);
    BARDATE(Var1)

    I have also uploaded my watch list.

    Interestingly the values of the highest 52-week highs and the lowest 52-week lows are correct but not the dates.

    My script for the highest 52-week high

    HIGHESTHIGH(High(), BACKTYPE=Weeks, BARS=52, INCBAR=True)

    My script for the lowest 52-week low

    LOWESTLOW(Low(), BACKTYPE=Weeks, BARS=52, INCBAR=True)

    Inform me please what I have made wrong.

    Thanks

    Thomas

    #57327
    Thomas
    • Topics: 98
    • Replies: 124
    • Posts: 222

    Hi,

    here is my updated watch list.

    The one in my last post used data only available on my computer.

    #57333
    Thomas
    • Topics: 98
    • Replies: 124
    • Posts: 222

    My final updated watch list, with data from the Optuma databases

    #57340
    Matthew
    • Topics: 5
    • Replies: 381
    • Posts: 386

    Hi Thomas,

    The results for the low you are seeing are from the first match found within the 52 week range. The result you are after is from the most recent bar, the way to do this in a Watchlist is to use a script like this (i’ve included notes on what each step does):

    This should return the results you’re expecting to see in the WL column.

    1 user thanked author for this post.
    #57349
    Thomas
    • Topics: 98
    • Replies: 124
    • Posts: 222

    Hi Matthew,

    thank you for your script. In my watch list it works almost perfect but unfortunately not for Microsoft. The watch list shows the date 9/17/1987, that date is the first day data are available.

    I have again attached my watch list.

    date lowest low

    Thanks

    Thomas

    #57353
    Thomas
    • Topics: 98
    • Replies: 124
    • Posts: 222

    Hi Matthew,

    perhaps I have figured out the issue in the script.

    The lowest low was 114.59 (see watch list). That low was on Friday, March 15, 2019.

    If you multiply 52 * 7 you get 364, if you subtract 364 calendar days from March 12, 2020 (last bar date) you get Thursday, March 14, 2019.

    Perhaps since the lowest low date and the start of the script (start = BARDATE() == LAST(BARDATE()) – (52*7)) are so close together the issue occurs.

    #57383
    Thomas
    • Topics: 98
    • Replies: 124
    • Posts: 222

    Hi Matthew,

    have you any idea how to solve the issue of the lowest low date script as outlined above?

    Thanks

    Thomas

    #57402
    Matthew
    • Topics: 5
    • Replies: 381
    • Posts: 386

    Hi Thomas,

    We think it’s the LowestSince() function that’s causing this outlier issue, we’re looking into it further.  For now the following adjusted script seems to be working without producing the outliers:

    1 user thanked author for this post.
    #64979
    Darren
    • Topics: 66
    • Replies: 634
    • Posts: 700

    Here’s a variation to get the date of the 52 week lowest close, rather than the lowest low:

    For highest close change V4 from LOWESTLOW to HIGHESTHIGH. This example shows the highest 52 week close date for AMGN was July 20th 2020:

    Capture

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

Pin It on Pinterest