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 |

XX days high Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Bulard
Posted : Tuesday, August 10, 2010 8:02:58 AM
Registered User
Joined: 7/26/2010
Posts: 14
Hi,can you please guide me for my first scanning condition ?Can you give please code or method for scanning a list of stocks that meet following condition:- High of last bar is highest of XX bars ago- this condition never happened within these XX bars, which means it's the first time it happens since XX bars as specified above.Thanks.
Bruce_L
Posted : Tuesday, August 10, 2010 10:05:25 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If I'm understanding the request correctly, the following RealCode Condition might do what you want:

Writing Conditions in RealCode
Scanning with Conditions

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:XX Bars High
'|******************************************************************
'# XX = UserInput.Integer = 10
Static Count As Integer
If CurrentIndex >= XX Then
    If CurrentIndex >= 2 * XX Then
        If Price.High(XX) > Price.MaxHigh(XX, XX + 1) Then
            Count -= 1
        End If
    Else
        SetIndexInvalid
    End If
    If Price.High > Price.MaxHigh(XX, 1) Then
        Count += 1
        If Count = 1 Then Pass
    End If
Else
    If isFirstBar Then
        Count = 0
    End If
    SetIndexInvalid
End If

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