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 |

simple way to determin that data exists X bars ago Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
stoker
Posted : Monday, May 9, 2011 11:48:32 AM
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

Bruce_L
Posted : Monday, May 9, 2011 11:59:16 AM


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
stoker
Posted : Tuesday, May 10, 2011 9:20:32 AM
Registered User
Joined: 1/19/2009
Posts: 32
Thanks Bruce that worked great
Bruce_L
Posted : Tuesday, May 10, 2011 9:24:01 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

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