Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |