Performance function

Optuma Forums Optuma Scripting Performance function

This topic contains 4 replies, has 3 voices, and was last updated by  Steven 1 week, 2 days ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #51143

    • Topics: 2
    • Replies: 6
    • Posts: 8

    I found the “Performance” function and thought it looked useful for some ideas I have, but I’m not able to reproduce the result.

    In a watch list, I created a script column with the code:


    As an example, for ABCB:NASDAQ i get a result of 18.88, but I can’t get the same result manually no matter which of the Open, Close, High or Low prices I use.

    I feel a bit silly asking, but can you tell me how the 18.88 is calculated please.

    • Topics: 4
    • Replies: 89
    • Posts: 93

    Hi Steven,

    The Performance() function measures the range between two values over a user defined period (1 month by default) and displays the results as a percentage. For example if a charts price moved from $50 to $100 in a month, PERFORMANCE() would return a value of 100%.


    If you are unsure of how a function works, you can find a brief overview / description here:


    • Topics: 2
    • Replies: 6
    • Posts: 8

    Thanks Matthew, much appreciated. BTW, the link you gave me is how I found the function in the first place! 🙂 Sadly, I don’t think it’s the one I want.

    What I’m trying to do (and failing miserably at) is find out how many bars, in this case monthly, have had greater than a certain range in a period as these are the type of stocks I want to trade.

    I thought this should work but the result is either 12 or 0, not the number of bars where the test is true. Can you help?

    // Set minimum percentage range
    RATE1 = 5 ;

    // Check price has risen
    BAR1 = BARTYPES(Month(PERIODAMOUNT=1), DEFAULT=CloseAboveOpen) ;

    // Check percentage range in month is greater than minimum
    BAR2 = (HIGH(MONTH()) – LOW(MONTH())) / LOW(Month()) * 100 > RATE1;

    BAR3 = BAR1 and BAR2;

    // Count how many times that has been true in last 12 months


    • Topics: 31
    • Replies: 172
    • Posts: 203

    Hi Steven,

    I think using the Accumulation ACC() and the monthly Rate of Change ROC() functions is the way to go.

    Here’s the formula in a watchlist and Show View, so WBA and BA both have had 5 months greater than 5% over the last year:




    • Topics: 2
    • Replies: 6
    • Posts: 8

    Hi Darren,

    That’s perfect, exactly what I wanted and I can see so many other uses for ACC. Many thanks indeed!!!

    As a matter of interest only, why did ACC work so much better than BARSTRUE? Will ACC always produce a more reliable result or are there particular circumstance where one is more appropriate than the other??

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.