Highesthigh on RIC

Hi,

I have a chart with weekly price bars and a ShowPlot tool. The script for the ShowPlot tool is:
HIGHESTHIGH(BARS=52)

The script is showing the high looking back 52 bars. I tried to add the same ShowPlot tool and script to a RIC tool. Something is not right. Please see the picture attached. I want to plot the highest high on the RIC tool looking back 52 bars the same way as on the price bars.

I did try a more detailed script on the RIC which did not work:

V1 = GETDATA(CODE=AAPL:US, TIMEFRAME=1 Week) ; 
V2 = RIC(Week(PERIODAMOUNT=1), V1, INDEX=SPY:US) ; 
HIGHESTHIGH(Week(PERIODAMOUNT=1), V2, BARS=52)

As a note: the same ShowPlot tool and highesthigh script worked as planned on a volume tool, but I ran into the same issue on an rsi and macd as with the RIC.

thank you so much!

Hi Louis,

As the RIC is on the chart of AAPL there’s no need to use the GetData function - that’s only needed when you you are referencing a different dataset. Because the RIC() function outputs Open, High, Low, and Close values the HighestHigh will use the high value by default, creating the gap in the Show Plot.

Use this for the closing RIC value:

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

Capture

Hi Louis,

a small change to your script would solve the problem. In the RIC setting set the Normalization to “None” (DATESEL=None), this setting could be better.

V1 = GETDATA(CODE=AAPL:US, TIMEFRAME=1 Week) ; 
V2 = RIC(V1, Week(PERIODAMOUNT=1), DATESEL=None, INDEX=SPY:US) ; 
HIGHESTHIGH(CLOSE(), V2, BACKTYPE=Weeks, BARS=52, INCBAR=True)

For the last script line you can also use the following:

HIGHESTHIGH(CLOSE(V2), BACKTYPE=Weeks, BARS=52, INCBAR=True)

Best wishes,
Thomas

Hi Darren. Thank you. This confirms that I have been incorrectly calculating a few things using Optuma.

All I want to do is plot the current position of a tool, be it the RIC or ADL, in its 52-week range. I tried a stochastic of the RIC, however, as you pointed out the RIC only plots “closes,” so the stochastic tool did not work when applied to the RIC tool.

Here is the script I wrote to place the RIC into a stochastic formula. Please let me know if there is a more efficient or easier way to do this. I plan on doing this with a few tools and them manipulating the results in large watchlists. Perhaps even average a few of the results. Thank you.

//Get the Relative Strength 
V1 = RIC(INDEX=SPY:US) ; 
V2 = HIGHESTHIGH(Close(V1), BARS=52) ; 
V3 = LOWESTLOW(Close(V1), BARS=52) ; 
//Apply the stochastic formula 
P1 = ((V1 - V3) / (V2 - V3)) * 100 ; 
//Plot the normalized RS 
Plot1 = P1 ; 
Plot2 =20 ; 
Plot3 = 80 ;

Optuma.owb (19.5 KB)

Hi Louis,

You can use the same STOCH() formula as this one:

https://forum.optuma.com/topic/normalizing-formula-results-in-a-watchlist/#post-67893

On a weekly chart, change Bar1 to 52 for the yearly range. As of Thursday’s close AAPL is at 99.5% of the yearly RIC range (shaded in yellow):

Capture

Perfect. Thank you for all of your help Darren.