Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/15/2008 Posts: 2
|
Have tried to build this, doesn't seem to be working. Can you help out?Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The following RealCode Condition is designed for use on a 1-Day Chart and assumes the "gap" is measured from the previous Close to the current Open:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:My Condition
'|******************************************************************
If Price.Open >= 1.03 * Price.Last(1) Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/15/2008 Posts: 2
|
Bruce,Thanks you!If I wanted to apply to a 15 minute chart,how would this be different?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You'd need to check for it being the first Bar of the day and have a variable to keep track of if the day is True or not if you want it to continue returning True after the first Bar of the day.
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:My Condition
'|******************************************************************
Static Valid As Boolean
Static DayStore As Boolean
If isFirstBar Then
Valid = False
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
If Price.Open >= 1.03 * Price.Last(1) Then
DayStore = True
Else
DayStore = False
End If
Valid = True
End If
If Valid = True Then
If DayStore = True Then
Pass
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |