Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 11/26/2007 Posts: 116
|
I need help converting this PCF to SF:
C > C1 AND V > ABS(C1 < C2) * V1 AND V > ABS(C2 < C3) * V2
Thanks
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Up above Max Down Volume
'|******************************************************************
'# Period = UserInput.Integer = 2
If CurrentIndex > Period Then
If Price.Last > Price.Last(1) Then
Dim Test As Boolean = True
For i As Integer = 1 To Period
If Price.Last(i) < Price.Last(i + 1) AndAlso _
Volume.Value <= Volume.Value(i) Then
Test = False
Exit For
End If
Next
If Test = True Then
Pass
End If
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/26/2007 Posts: 116
|
As usual Bruce....great service.Thanks!!
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 5/3/2010 Posts: 86
|
Bruce....I see you use the CurrentIndex variable - is this a property or method.....
And whats the SetIndexInvalid method doing ?
TIA
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
anindya_chak,
I'm not a programmer, but according to the RealCode API, CurrentIndex is a property.
SetIndexInvalid will force the Condition to not return anything for the currently calculating Bar as opposed to returning either True or False. The reason to do so is this allows for automatic adjustments to the amount of data used when the Condition is used in a WatchList to return only a single result.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |