Barstrue function for ytd programming

Optuma Forums Optuma Scripting Barstrue function for ytd programming

  • This topic has 2 replies, 2 voices, and was last updated 1 month ago by Yan.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #65355
    Yan
    • Topics: 24
    • Replies: 34
    • Posts: 58

    Hello everyone,

    I am trying to build statistic tools for research purpose.  My objectif is to find:

    1  how many new ytd low a security made since the beginning of this year.
    2 how many 1 year low the security made during the last 1 year period.

    So i find the barstrue function should be used at given circumstance as shown in the page https://help.optuma.com/kb/faq.php?id=1118

    So my question is,  how to change the script here. Can i write lookback=ytd ? or Lookback=1 year ? I can’t find further information in the knowledge base. So if you guys can help me on that,  i would be very thankful.

    BTW, can we just make it available in the optuma ? So everyone can use it directly. I don’t know if this would be a new feature, i really want to know what you guys think of.

    Thanks

    Yan

    #65366
    Matthew
    • Topics: 5
    • Replies: 422
    • Posts: 427

    Hi,

    LowestLow doesn’t have a Year to Date look back option, but it does have a Range, so you can set it up to search for items just from 1st of Jan 2021 to 31 Dec 2021.

    Once you have that, you can check for all the new Lowest Lows set for that same range with a script like this:

    You can see on the following example the result for the year so far is 15.

    Ex3

    The second criteria is similar to the first, only a few adjustments are required…

    Ex4

    • This reply was modified 1 month ago by Matthew.
    2 users thanked author for this post.
    #65375
    Yan
    • Topics: 24
    • Replies: 34
    • Posts: 58

    Hi,

    LowestLow doesn’t have a Year to Date look back option, but it does have a Range, so you can set it up to search for items just from 1st of Jan 2021 to 31 Dec 2021.

    Once you have that, you can check for all the new Lowest Lows set for that same range with a script like this:

    You can see on the following example the result for the year so far is 15.

    Ex3

    The second criteria is similar to the first, only a few adjustments are required…

    Ex4

    • This reply was modified 1 month ago by Matthew.

    Hi Matthew, thanks for your reply.

    The script works on the chart perfectly. I can use it for a specific year that’s true.

    In fact, my intention was to create a watchlist to see how many lows they created each years. I guess that i can make script for each year, but can optuma create a tool that when we open a watchlist with for example 2010-2020 automatically ?

    Just an idea to see if anyone else is interest in digging deeper the market. I didn’t know whether i should put this in the new feature demand part.  Still, very happy to see all the solutions from you guys and the explanation of look back option.  Hope that other people who reach this topic could use that too.

    Thanks again

    Yan

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

Pin It on Pinterest