Reply To: HighestHigh in a prior period

Optuma Forums Optuma Scripting HighestHigh in a prior period Reply To: HighestHigh in a prior period

Trevor R
  • Topics: 36
  • Replies: 117
  • Posts: 153

Hi Steven,

If I’m reading your requirements of your script outline correctly you are looking at doing this:

20190109 Steven's Script

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:




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


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

20190109 Steven's Script Chart Result

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.



The Auld Tyma at

Auld Tyma Data Logo with URL 1 cm

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.