# HighestHigh in a prior period

Hi,

I'm new to Optuma scripting, so this is probably a dumb question. How do I find the HighestHigh (or LowestLow) for a prior period, like last year or a rolling period ending 12 months ago for example?

Also, is there a web page that briefly describes every formula available?

Thanks

Hi Stephen,

A very simple script like:

HIGHESTHIGH(BARS=66)

will plot a line on your chart showing the highest high within the last 66 bars, or about 3 months.

For Yearly Highs/Lows you can use the standard Optuma Tool "Year High Low Marker". Here's a screenshot with both on it:

As to your request for details of scripting functions, take a look at Formula Functions & General Interface as a starting point, then search for other Optuma Knowledge Base articles on the subject of interest to you.

Cheers

Trevor

The Auld Tyma at

Thanks Trevor.

Stephen: see this post for other examples of using HIGHESTHIGH() and LOWESTLOW() in scans:

https://forum.optuma.com/topic/new-52-week-highs-and-lows/

Sign in here to watch tutorial videos to help get started with scripting:

https://learn.optuma.com/scripting-courses/

Thanks for getting back so quickly, really appreciated. I've been through all the scripting videos and read through much of the KB; I am excited by the opportunities.

With the scripting tool, there's just so many similarly named options, it's difficult to get one's head around it. A searchable KB would be fantastic - but I know from personal experience that's not easy to achieve when you've started down another path.

Sadly, I haven't explained my problem well enough. I saw the Optuma "Year High Low Marker" tool and wanted to make more specific use of the calculations behind it.

What I'd like to be able to do is to find the HighestHigh, or LowestLow, for a period that excludes the immediate past. If I could write something like this I'd be able to achieve what I want.

HH1 = HIGHESTHIGH(BARS=26, OFFSET=104) ;

HH2 = HIGHESTHIGH(BARS=26, OFFSET=78);

HH3 = HIGHESTHIGH(BARS=26, OFFSET=52);

HH1 < HH2 and HH3 < HH2

Many thanks again,

Steven (with a v) :-)

Hi Steven,

As I understand how it all works, the positive Offset parameter as set in the square brackets "[]" works backwards from the bar being evaluated, moving forward and testing each Bar from the earliest Market Bar (not the earliest displayed bar) to the latest Market Bar. That determines the points for your HH#s with their Lookback parameter, from which the HH# looks for the Highest High within the previous LookBack Bar range, ie within the previous 26 Bars. If the script requirements are met then a SHOWBAR signal occurs at the bar being tested. The diagram I've included above would not be highlighting a Bar as having met the criteria. If I've got that description of how the functions work screwed up I trust Darren will correct me.

Which can be done with the following script:

HH1 = HIGHESTHIGH(BARS=26)[104] ;

HH2 = HIGHESTHIGH(BARS=26)[78];

HH3 = HIGHESTHIGH(BARS=26)[52];

Signal = If ((HH1 < HH2) and (HH3 < HH2), 1, 0);

Signal

This produces the following result (Magenta SHOWBARS), however I don't think that is what you are expecting

If what you are really looking for is the High that has no other Highs within 52 Bars each side of it then the following script will do that:

Pivot(MIN=52, TYPE=High, DIR=Both)

The Signals produced by this script are the Blue SHOWBAR Arrows in the above screen shot.

Hope that helps with what you are trying to achieve, and also your understanding of how the script functions work.

Cheers

Trevor

The Auld Tyma at

Hi Steven,

I can see how this could be important. I’ve added a “Range” option to the HighestHigh function. When selected you can choose the start date and end date. The highest value within that range will be projected forward to the end of the chart. In the image below the range is Jan 9 2018 to Aug 1 2018. The arrow shows where the testing ended.

Hopefully this will do what you are after. It will be included in a Beta update in the next week or so.

All the best

Mathew

That's fantastic Matthew, glad you could see its relevance and amazed you can action an upgrade so quickly!!

And Trevor, I really appreciate all the effort you put in to show me how to do it with the existing system.

I'm off and running!!?