- Topics: 31
- Replies: 79
- Posts: 110
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 at