Registered User Joined: 1/19/2009 Posts: 32
|
Hi,
What is the simplest way via a condition or realcode to filter a watchlist to confirm that each symbol has greater than X bars of data? I want to filter out new stocks basically, and I cannot think of a simple/elegant way to do it.
cheers
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Replace everything below the Inherits line in the Class tab of a RealCode Condition with the following:
Sub New
AutoLoop = False
End Sub
Public Overrides Sub CallUserCode()
'# Cumulative
'# MinBars = UserInput.Integer = 252
If Price.Bar.Count >= MinBars Then
AddToOutput(Price.Bar.DateValue(Price.Bar.Count - 1), True)
Else
AddToOutput(Price.Bar.DateValue(Price.Bar.Count - 1), False)
End If
End Sub
End Class
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 1/19/2009 Posts: 32
|
Thanks Bruce that worked great
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|