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 |

Help with real Code: Pocket Pivot Indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tomham
Posted : Monday, September 20, 2010 4:53:40 PM
Registered User
Joined: 11/21/2004
Posts: 84

I have written an indicator in TC 2007, and it would be great if I could "port" this formula over to StockFinder 5.  (the indicator is my version of the "pocket pivot" from the recent book "Trade Like an O'Neil Disciple").
The output of the formula is "True" (% True in TC terms), so it is binary; "1" if true "0" is false.  My Thanks for any assistance.  Take Care & Good Trading.       ..........  Tom  ............

(C > C1 AND V > ABS(C1 < C2) * V1 AND V > ABS(C2 < C3) * V2 AND V > ABS(C3 < C4) * V3 AND V > ABS(C4 < C5) * V4 AND V > ABS(C5 < C6) * V5 AND V > ABS(C6 < C7) * V6 AND V > ABS(C7 < C8) * V7 AND V > ABS(C8 < C9) * V8 AND V > ABS(C9 < C10) * V9 AND V > ABS(C10 < C11) * V10)  And
((L1<AVGC10.1 or L2<AVGC10.2 or L3<AVGC10.3 or L4<AVGC10.4 or L5<AVGC10.5) Or
(L1<AVGC50.1 or L2<AVGC50.2 or L3<AVGC50.3 or L4<AVGC50.4 or L5<AVGC50.5)) And
C > ((H-L)*.66)+L

Bruce_L
Posted : Monday, September 20, 2010 7:12:43 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Writing Conditions in RealCode

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:tomham pocket pivot
'|******************************************************************
Static Count As Integer
If CurrentIndex >= 55 Then
    If Price.Low(6 ) < Price.AVGC(10, 6) OrElse _
        Price.Low(6 ) < Price.AVGC(50, 6) Then
        Count -= 1
    End If
End If
If CurrentIndex >= 50 Then
    If Price.Low(1) < Price.AVGC(10, 1) OrElse _
        Price.Low(1) < Price.AVGC(50, 1) Then
        Count += 1
    End If
Else If isFirstBar Then
    Count = 0
End If
If CurrentIndex >= 54 Then
    If Count > 0 AndAlso _
        Price.Last > Price.Last(1) AndAlso _
        3 * Price.Last > 2 * Price.High + Price.Low Then
        Dim Test As Boolean = True
        For i As Integer = 1 To 10
            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
tomham
Posted : Wednesday, September 22, 2010 9:24:25 PM
Registered User
Joined: 11/21/2004
Posts: 84
Thank You Bruce !  This will be a big help in my studies.   ...........  Tom  ..............
tomham
Posted : Wednesday, September 22, 2010 9:33:59 PM
Registered User
Joined: 11/21/2004
Posts: 84
One problem when I created a New Real Code Indicator.  After Pasting the code above, and attempting to Save it, I received a "Complie Failed" error message.
In the Error Message window it stated:  Name 'Pass' is not declared.

It must be thinking that Pass is a varible, and not a standard Basic command to continue if true.

What should I change to correct this (my Visual Basic skills need help).  :)    ........  Tom  ............
StockGuy
Posted : Wednesday, September 22, 2010 10:31:31 PM

Administration

Joined: 9/30/2004
Posts: 9,187
It sounds like you tried to paste the code into a RealCode Indicator and not a RealCode Condition.
tomham
Posted : Thursday, September 23, 2010 3:17:00 PM
Registered User
Joined: 11/21/2004
Posts: 84
Yes, that's it.
Sounds like I will need to change the logic on it; sort of like removing a "% True" on TC.  :)
Bruce_L
Posted : Friday, September 24, 2010 7:43:33 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
tomham,
You can show the Condition on the Chart by just right-clicking on it and selecting Show True Markers.

Creating Conditions

-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.