Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Price change Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Greg777
Posted : Monday, June 10, 2013 7:46:51 AM
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!
Bruce_L
Posted : Monday, June 10, 2013 8:54:50 AM


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
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.