Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Plotting opening 15 minute high Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Weappa
Posted : Monday, December 31, 2012 7:58:43 PM
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
 
Bruce_L
Posted : Tuesday, January 1, 2013 9:47:08 AM


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
Weappa
Posted : Tuesday, January 1, 2013 11:39:02 AM
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.

Bruce_L
Posted : Wednesday, January 2, 2013 8:03:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.