Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/12/2007 Posts: 10
|
How would I write a condtion to find a price.maxhigh(period) followed by three days where the high did not take out the maxhigh and then use this condition to paint all four bars on the chart? I have been able to write a condition but it only paints the last bar of the condition and I would like it to paint all four bars.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Something like the following RealCode Condition should work:
'# Period = UserInput.Integer = 20
If (Price.High(3) = Price.MaxHigh(Period,3) And _
Price.MaxHigh(3) <= Price.MaxHigh(Period,3)) Or _
(Price.High(2) = Price.MaxHigh(Period,2) And _
Price.MaxHigh(3,-1) <= Price.MaxHigh(Period,2)) Or _
(Price.High(1) = Price.MaxHigh(Period,1) And _
Price.MaxHigh(3,-2) <= Price.MaxHigh(Period,1)) Or _
(Price.High = Price.MaxHigh(Period) And _
Price.MaxHigh(3,-3) <= Price.MaxHigh(Period)) Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/12/2007 Posts: 10
|
Thank you very much. Worked perfectly.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/12/2007 Posts: 10
|
Now I would like to know if there is a way to expand upon this condition. Can we find the min low after the aforementioned maxhigh and find three days after the minlow with higher lows which do not take out the max high. I know we will have period issues but just say it has to happen within 20 periods.
|
|
Guest-1 |