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 |

IPO's Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thnkbigr
Posted : Thursday, August 5, 2010 1:37:09 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
Guys 

How can I write a RC to screen for stocks that have 1 or 2 days of trading history?

thx
Bruce_L
Posted : Thursday, August 5, 2010 2:22:39 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Replacing everything after the Inherits line in the Class tab of a RealCode Condition with the following should probably work (you may need to add a '# Cumulative line, but I doubt it - in my testing this is quite slow).

    Sub New
        AutoLoop = False
    End Sub
    Public Overrides Sub CallUserCode()
        If Price.Bar.Count = 2 OrElse Price.Bar.Count = 1 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
thnkbigr
Posted : Thursday, August 5, 2010 2:35:00 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
thx

and if I need to screen for IPO's 3 and 4 days ago what do I need to adjust

  Sub New
        AutoLoop = False
    End Sub
    Public Overrides Sub CallUserCode()
        If Price.Bar.Count = 2 OrElse Price.Bar.Count = 1 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_L
Posted : Thursday, August 5, 2010 2:41:30 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The following should work for up to four days:

Sub New
        AutoLoop = False
    End Sub
    Public Overrides Sub CallUserCode()
        If Price.Bar.Count <= 1 AndAlso Price.Bar.Count <= 4 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
thnkbigr
Posted : Thursday, August 5, 2010 2:44:55 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207
thx
Bruce_L
Posted : Thursday, August 5, 2010 2:46:40 PM


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.