Registered User Joined: 5/28/2013 Posts: 1
|
Hi!
I'm using a 15min chart and i want to know, if current price is below yesterday's close.
What's the best way to create such realcode condition?
Any help is appreciated. Thanks!
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The easy way is just to create a Daily RealCode Condition:
If Price.Last < Price.Last(1) Then Pass
If you need to create a 15-Minute RealCode Condition for some reason, you would need to track yesterday's close.
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Below Yesterday Close
'|******************************************************************
Static YestClose As Single
If isFirstBar Then
YestClose = Single.NaN
Else If Price.DateValue.Day <> Price.DateValue(1).Day Then
YestClose = Price.Last(1)
End If
If Single.IsNaN(YestClose) Then
SetIndexInvalid
Else If Price.Last < YestClose Then
Pass
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|