Registered User Joined: 3/4/2005 Posts: 55
|
Bruce,
Is there a way, using RealCode, to test stocks in a Watchlist that are up at the 9:31 bar on a 1-Minute Chart, followed by price down below previous low of the 9:31 bar on the 9:32 bar, then x-bars later price close above closing price of 9:31 bar?
Thanks,
Ed
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
This is time frame agnostic as long as it is intraday. It just looks at the first and second bars for the setup. Then checks all subsequent bars for if the close (or current price of the most recent bar) is higher.
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:My Condition
'|******************************************************************
Static NewDay As Boolean
Static FirstTwo As Boolean
Static Count As Short
Static FirstBar As Single
Count += 1
If isFirstBar Then
NewDay = False
FirstTwo = False
Count = 0
FirstBar = Single.NaN
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
NewDay = True
FirstTwo = False
Count = 0
FirstBar = Price.Last
Else If Count = 1 Then
If Price.Last < Price.Low(1) Then
FirstTwo = True
End If
End If
If NewDay = True Then
If FirstTwo = True AndAlso _
Count >= 2 Then
If Price.Last > FirstBar Then
Pass
End If
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 3/4/2005 Posts: 55
|
Thank you Bruce.
Works as I had wanted for it to.
Hope you enjoy coding as much as I appreciate you creating this code.
Ed
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|