Scripts for Relative Rotation Graphs (RRGs)

Optuma Forums Optuma Scripting Scripts for Relative Rotation Graphs (RRGs)

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #46971
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    For Optuma clients with the full RRG module who are interested in scanning or testing RRG scenarios see this blog post with examples using the derived indicators (eg Heading, Distance, Velocity, etc):

    Scripting Guide for Relative Rotation Graphs®

    #47791
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    The distance between each data point on an RRG tail is measured by the velocity – JDKRS().Velocity – so to calculate the tail length you can add them together using the Accumulation function ACC() over the required time period. The longer the tail the more momentum in the relative trend.

    For a 5 period tail you would use the following using the default benchmark index (ie XJO for ASX, SPX for US stocks):

    In this example, the Dow 30 have been ranked by tail length, with the longest 3 (INTC, CVX & JPM) plotted on the RRG with the shortest 3 (HD, WMT & IBM with lowest momentum).
    Capture

    • This reply was modified 3 years ago by Darren.
    #51427
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    To colour code the quadrants in a watchlist column the following (using the default benchmark) will convert the column in to a value, as follows:

    0 = Leading
    1 = Weakening
    2 = Lagging
    3 = Improving

    JDKRS().Quadrant +0

    Then label and colour the column using the following Custom Labels:

    Capture

    #54121
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    Attached is a workbook for US industry ETF watchlist with RRG quadrant info in a column and 4 coloured Show View scripts dragged over each other.

    Capture

     

    #54379
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    A sure sign of strength is when a stock moves from Weakening back to Leading without rotating to Lagging – basically it rotates on the right side of the RRG chart without the RS Ratio crossing below 100.

    We can scan (and test) for when that happens using the following formula:

    Scan results:

    Capture

    #64301
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    Using the Heading value we can define ranges to show the general RRG direction in a watchlist by splitting the 360° of the circle into eight equal 45° segments. For example, we can define those heading northeast as being between 22.5° and 67.5° i.e. both have increasing relative strength and momentum (good), whereas those moving in a southwest direction (between 202.5° and 247.5°) have the opposite (bad).

    We can also break up the remainder of the ranges as follows:

    North – between 337.5° and 22.5°
    East – between 67.5° and 112.5°
    Southeast – between 112.5° and 157.5°
    South – between 157.5° and 202.5°
    West – between 247.5° and 292.5°
    Northwest – between 292.5° and 337.5°

    These can be scripted as follows, and when the condition is true the IF() statement assigns a value, such as Southeast = 4, with the other IF statements being false (giving a result of zero):

    When added as a watchlist column the values can then be used in the conditional formatting for labels and/or colours:

    Capture

    #64689
    Jan
    • Topics: 2
    • Replies: 3
    • Posts: 5

    Thanks for this code.
    However, when I wanted to use it, it didn’t work for me. I live in Europe, and there they use a comma instead of a period for the decimal.
    Sixty-seven and a half is written in Europe as 67,5 However, the code mentions 67.5 To get the code to work I had to modify it and use extra(). This can cause problems with more complex encodings. Is this due to my Optuma settings, and if so how do I adjust this? I’m attaching the code I modified so you can see what I’ve changed to make it work here in Europe. Kind regards, Jan.

    #64735
    Darren
    • Topics: 67
    • Replies: 705
    • Posts: 772

    Thanks Jan. There’s no settings in Optuma as it uses your Windows regional format settings. However, I’m using the next release of Optuma and after setting the regional settings to display 67,5 instead of 67.5 the RRG script provided works without adding the additional () or changing the ‘.’ to ‘,’

    The beta version should be available for client testing in a couple of weeks when you will be able to try it for yourself (we’ll let you know when it’s available).

    Capture

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest