Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 4/12/2008 Posts: 41
|
I Draged n Droped a rule in the main wacht list, then I can sort by " % true in a period" . Can I modify this for: "# true in a period" ?Ps: Im very thankfull for all the answers given to me, thay have been very helpfull. Can I rate the answers given to me as a recognition for youre excellent work and to express my satisfaction ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
That is not one of the Drag and Drop options currently available. You could create a RealCode Indicator for this and Drag and Drop it to the Watchlist and select Raw Value if you really want this however. Dragging and Dropping the Rule into the RealCode Editor would create something similar to the first line of the following RealCode Indicator (you may need to change the variable name if something besides MR is assigned):
'# MR = condition.MyRule
'# Period = UserInput.Integer = 50
Static Count As Integer
If isFirstBar Then
Count = 0
End If
If MR.Value = True Then
Count += 1
End If
If CurrentIndex >= Period Then
If MR.Value(Period) = True Then
Count -= 1
End If
Plot = Count
Else
Plot = Single.NaN
End If
You can rate the topic as a whole by selecting 1, 2, 3, 4 or 5 stars where it says Rate this Topic in the upper right hand corner of the topic, but I do not know of an automated mechanism for rating the answers or individual posts within a topic.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/12/2008 Posts: 41
|
I copyed and pasted the sintax in a new indicator RC but, an error appeared, twice:Name 'MR' is not declared .PS: I didn't understand this part of your answer: "Dragging and Dropping the Rule into the RealCode Editor would create something similar to the first line of the following RealCode Indicator:"Help !
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
- Select Add Indicator | Create in RealCode.
- Give the Indicator a Name and select OK.
I'm assuming your Watchlist Column was created by Dragging and Dropping a Rule to the Watchlist and selecting % Bars True In Period.
- Drag and Drop that same Rule into RealCode Editor.
Doing so should add a line to your RealCode. What this line looks like is going to depend on the specific Rule that was Dragged and Dropped int othe RealCode Editor, but the basic structure is going to be:
'# MR = condition.MyRule
Where '# lets the RealCode Editor know that this is special instructions for StockFinder that are not part of standard Visual Basic, where MR is the variable name assigned to the Dragged and Dropped Rule and where = condition.MyRule tells the RealCode Editor what Rule is being assigned to the variable.
The variable name is generally constructed from the Name of the Rule... in this case My Rule. You will need to change it to MR if a different name is assigned, or use the name assigned to replace MR throughout the rest of the RealCode.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/12/2008 Posts: 41
|
The column works perfectly, thanks. Can I filter the watch list, so only stocks that have a value of 1 or more , in the column, stay and the rest with 0 value removed? thanks again.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You could right-click on the RealCode Indicator and select Create Rule | Greater Than Value: 0 to create a Rule that could be used as a Filter (by Dragging and Dropping the Rule to the Filter).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |