Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/12/2007 Posts: 23
|
I wrote the follwing realcode indicator to plot the high price value of the first 15 minutes of each trading day. It works most of the time. However if the current day's opening 15 minute high doesn't take out the previous day's opening 15 minute high, it plots the previous day's opening 15 minute high. I'm stuck, can anyone help?
Static Open15minhigh As Single
If isFirstBar Then Open15minhigh = price.High
If Price.DateValue.TimeOfDay <= Date.Parse("09:45").TimeOfDay Then Open15minhigh = System.Math.Max(open15minhigh, Price.High)
plot = Open15minhigh
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please 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
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/12/2007 Posts: 23
|
Thanks much Bruce, it works like a charm. You're a real asset to the Worden team and your continued first rate and expedient support is one of the top reasons I've stayed with Worden and SF5.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |