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 |

Filter Out New Stocks Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
pianopilot
Posted : Tuesday, November 18, 2014 4:22:41 PM
Registered User
Joined: 5/27/2011
Posts: 45

Bruce,

In StockFinder I'm trying to find a conditon to filter out new stocks, say less than 1 year of trading.  I found this realcode in an earlier discussion forum, but I can't seem to correctly load it as either a condition or an indicator.  Would like to have a condition. I put the formula (below) below the inherits line in the class tab under new indicator, but errors came up. What am I doing wrong?  Thanks for your help... Ed

 

Sub New

     Autoloop = False

  End Sub

  Public Overrides Sub CallUsrCode()

     '#Cumuatve

     '#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_L
Posted : Tuesday, November 18, 2014 4:32:56 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The pasted RealCode appears to be missing at least two characters. There should be an e between the s and r in CallUserCode() and there should be a . between price and bar in the second AddToOutput line.

    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
pianopilot
Posted : Tuesday, November 18, 2014 4:55:01 PM
Registered User
Joined: 5/27/2011
Posts: 45

Bruce,

I made he changes, but still find errors on line 2 and 8.

Line 2: "class realcode indicator" must either be declared "must inherit" or override the following inherited "must override" member(s)

Line 8: "sub call user code" can not be declared overrides because it does not override a sub in a base class.

 

I am erassing everything in the New Indicator option below the line which says..

"Inherits RealCodeIndicator_base

Then I am pasting the RealCode formula you gave.. What am I doing wrong?

Thanks, Ed

 
 
Bruce_L
Posted : Tuesday, November 18, 2014 4:57:08 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I'm guessing from the RealCodeIndicator_base reference that the problem is pasting this into a RealCode Indicator instead of into a RealCode Condition.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
pianopilot
Posted : Wednesday, November 19, 2014 11:26:28 AM
Registered User
Joined: 5/27/2011
Posts: 45

Bruce,

You were right.. I must of tried pasting the formula as an Indicator instead of a Condition. It works great as a Condition.

Thanks, Ed

Bruce_L
Posted : Wednesday, November 19, 2014 11:47:56 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.