Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/13/2005 Posts: 20
|
I searched the forum but could not find any information related to this. Is there a way to scan for stocks that are approaching intraday high using the RealCode? I have created a watch list using a certain criteria and I want to scan the list for any stock now approaching the intraday high (highlight the stock). Is it possible to do this?
Say the stock XYZ gained at the open and then later consolidated and now approaching the intraday high. I would like to highlight those in my watch list.
Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I guess that would depend on how you define approaching. The following RealCode Rule is designed for use on an intraday Chart and should only return True if the current Price is above the Close of the previous Bar, the High of the current Bar is not the High of the Day and current Price is in the top 10% of the Price Range for the day. If this does not meet your needs, please provide an unambiguous objective definition of approaching so we can provide something that more closely matches your intent.
'# TopPercent = UserInput.Single = 10
Static DayHigh As Single
Static DayLow As Single
Static Valid(1) As Boolean
Static Check As Single
If isFirstBar Then
DayHigh = Single.NaN
DayLow = Single.NaN
Valid(0) = False
Valid(1) = False
Check = (100 - TopPercent) / 100
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
DayHigh = Price.High
DayLow = Price.Low
Valid(0) = True
Valid(1) = False
Else If Valid(0) = True Then
Valid(1) = True
End If
DayHigh = System.Math.Max(DayHigh, Price.High)
DayLow = System.Math.Min(DayLow, Price.Low)
If Valid(0) = True Then
If Valid(1) = True AndAlso _
Price.Last > Price.Last(1) AndAlso _
Price.High < DayHigh AndAlso _
(Price.Last - DayLow) / (DayHigh - DayLow) >= Check Then
Pass
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/13/2005 Posts: 20
|
Thanks Bruce. I knew my definition is bit ambiguous. I'll use this as an example and see if I can build on it. Thanks for your help. regards.
|
|
Platinum Customer
Joined: 10/7/2004 Posts: 2
|
I have a question similar to the one asked above.How can I make a rule to identify intraday highs in a chart and also for a watchlist.Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Pularis,
Please try the following RealCode Rule on an intraday Chart:
Static DayHigh As Single
Static Valid As Boolean
If isFirstBar Then
DayHigh = Single.NaN
Valid = False
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
DayHigh = Price.High
Valid = True
End If
DayHigh = System.Math.Max(DayHigh, Price.High)
If Valid = True Then
If Price.High = DayHigh Then
Pass
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |