Registered User Joined: 4/30/2009 Posts: 3
|
Hello Bruce
I came across a previous topic were you helped a customer create a realcode indicator to plot the high of the first 15 minutes of trading. The code you develope is shown below. I need some help to come up with a condition that will allow me to filter a watchlist based on the stocks that are crossing above the 15 minute high bar. I would appreciate any guidance you can provide.
lease try something similar to the following RealCode Indicator instead:
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Opening 15-Minute High
'|******************************************************************
Static Open15MinHigh As Single
If isFirstBar Then
Open15MinHigh = Single.NaN
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
Open15MinHigh = Price.High
Else If Price.DateValue.TimeOfDay <= Date.Parse("09:45").TimeOfDay Then
Open15MinHigh = System.Math.Max(Open15MinHigh, Price.High)
End If
Plot = Open15MinHigh
Regards
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The following RealCode Condition assumes you are using a 1, 3, 5 or 15 minute time frame. It also assumes that crossing up means that price is currently above the high of the first 15 minutes but closed at or below that high during the previous bar.
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:xUp Opening 15-Minute High
'|******************************************************************
Static Open15MinHigh As Single
If isFirstBar Then
Open15MinHigh = Single.NaN
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
Open15MinHigh = Price.High
Else If Price.DateValue.TimeOfDay <= Date.Parse("09:45").TimeOfDay Then
Open15MinHigh = System.Math.Max(Open15MinHigh, Price.High)
Else If Price.Last > Open15MinHigh AndAlso Price.Last(1) <= Open15MinHigh Then
Pass
End If
If Single.IsNaN(Open15MinHigh) Then
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|