Test at 9:31 price up, test at 9:32 price below 9:31 low Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
egorth
 Posted : Wednesday, September 20, 2017 10:31:46 AM
Platinum Customer

Joined: 3/4/2005
Posts: 53

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

Bruce_L
 Posted : Wednesday, September 20, 2017 12:55:28 PM

Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
egorth
 Posted : Thursday, September 21, 2017 10:51:40 AM
Platinum Customer

Joined: 3/4/2005
Posts: 53

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

Bruce_L
 Posted : Thursday, September 21, 2017 10:53:15 AM

Worden Trainer

Joined: 10/7/2004
Posts: 60,672

You're welcome.

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

 Forum Jump Customer Training & Support - Ask a Trainer - TC2000 version 12/17 - Ask a Trainer - TC2000 version 7 - Ask a Trainer - StockFinder 5.0 - PCFs, EasyScan and Custom Indicators General Discussions - Stock and Market Talk - TC2000 version 12 or 17 - TC2000 version 7 - StockFinder 5.0 - RealCode for StockFinder 5.0 Tutorial Videos - TC2000 version 12 tutorial videos - TC2000 version 7 tutorial videos 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.