January 9, 2019 at 4:03 pm #50595
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?
ThanksJanuary 9, 2019 at 7:50 pm #50611
- Topics: 36
- Replies: 117
- Posts: 153
A very simple script like:
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.
The Auld Tyma atJanuary 9, 2019 at 9:31 pm #50631
January 9, 2019 at 10:17 pm #50635
- Topics: 37
- Replies: 220
- Posts: 257
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) 🙂January 10, 2019 at 1:34 am #50643
- Topics: 36
- Replies: 117
- Posts: 153
If I’m reading your requirements of your script outline correctly you are looking at doing this:
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) ;
HH2 = HIGHESTHIGH(BARS=26);
HH3 = HIGHESTHIGH(BARS=26);
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 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.
The Auld Tyma atJanuary 10, 2019 at 2:09 am #50647
- Topics: 16
- Replies: 1,018
- Posts: 1,034
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
MathewJanuary 10, 2019 at 8:09 am #50651
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!!?
You must be logged in to reply to this topic.