Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

scan for X number days ago, hi or lo Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
videohero
Posted : Friday, April 1, 2011 3:39:31 PM
Registered User
Joined: 5/27/2010
Posts: 6
Good day,

Usually can get scans down as I like, but this simple one is not getting results so far. Any help appreciated.
Simply looking for scan to find a hi or lo X number days prior. Say find stocks with highs 30 days ago, etc. Thanks in advance.
Bruce_L
Posted : Friday, April 1, 2011 3:55:24 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
There are a variety of ways to do this. The following is more complicated on its face than most, but is fairly efficient since it avoids looping at each Bar. A RealCode Indicator returning the number of Bars Ago that the Maximum High over the Period most recently occurred could be written as:

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Bars Since High
'|******************************************************************
'# Period = UserInput.Integer = 30
If Period >= 2 Then
    Static Value As Single
    Static Count As Integer
    Static Index As Integer
    If CurrentIndex = 0 OrElse Price.High > Value Then
        Value = Price.High
        Count = 1
        Index = CurrentIndex
    Else If Value = Price.High Then
        Count += 1
        Index = CurrentIndex
    End If
    If CurrentIndex >= Period Then
        If Price.High(Period) = Value Then Count -= 1
        If Count = 0 Then
            Value = Price.High(Period - 1)
            Count = 1
            Index = CurrentIndex - (Period - 1)
            For i As Integer = Period - 2 To 0 Step -1
                If Price.High(i) > Value Then
                    Value = Price.High(i)
                    Count = 1
                    Index = CurrentIndex - i
                Else If Price.High(i) = Value Then
                    Count += 1
                    Index = CurrentIndex - i
                End If
            Next
        End If
    End If
    If CurrentIndex >= Period - 1 Then
        Plot = CurrentIndex - Index
    Else
        Plot = Single.NaN
    End If
Else
    Plot = 0
End If

While a RealCode Indicator returning the number of Bars Ago that the Minimum Low over the Period most recently occurred could be written as:

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Bars Since Low
'|******************************************************************
'# Period = UserInput.Integer = 30
If Period >= 2 Then
    Static Value As Single
    Static Count As Integer
    Static Index As Integer
    If CurrentIndex = 0 OrElse Price.Low < Value Then
        Value = Price.Low
        Count = 1
        Index = CurrentIndex
    Else If Value = Price.Low Then
        Count += 1
        Index = CurrentIndex
    End If
    If CurrentIndex >= Period Then
        If Price.Low(Period) = Value Then Count -= 1
        If Count = 0 Then
            Value = Price.Low(Period - 1)
            Count = 1
            Index = CurrentIndex - (Period - 1)
            For i As Integer = Period - 2 To 0 Step -1
                If Price.Low(i) < Value Then
                    Value = Price.Low(i)
                    Count = 1
                    Index = CurrentIndex - i
                Else If Price.Low(i) = Value Then
                    Count += 1
                    Index = CurrentIndex - i
                End If
            Next
        End If
    End If
    If CurrentIndex >= Period - 1 Then
        Plot = CurrentIndex - Index
    Else
        Plot = Single.NaN
    End If
Else
    Plot = 0
End If

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
videohero
Posted : Friday, April 1, 2011 6:05:27 PM
Registered User
Joined: 5/27/2010
Posts: 6
Thank you Bruce, you are appreciated.
videohero
Posted : Monday, February 18, 2013 6:42:19 PM
Registered User
Joined: 5/27/2010
Posts: 6

I'm unsure how to use this scan type in the new TC2000. Can you assist - is this pre-built now? Will a scan populate a list with those stocks closest to the X number of days? Thanks! 

Bruce_L
Posted : Tuesday, February 19, 2013 9:35:55 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

This is not built into TC2000, but you might be able to use the Aroon Indicator for this if you are willing to use the percentages returned instead of count.

Aroon and Aroon Oscillator

The Aroon indicator was created by Tushar Chande in 1995. The Aroon Up line measures the strength of the uptrend by measuring the number of periods that have passed since prices reached the highest high in Period + 1 points on the chart. The Aroon Down line measures the strength of the downtrend by measuring the number of periods that have passed since prices reached the lowest low in Period + 1 points on the chart.

The Aroon Oscillator is calculated by subtracting the Aroon Down line from the Aroon Up line.

If those numbers do not work, we could use the techniques described in the Days Since Last Peak (or other day-counting needs) topic to create an actual count, but we would need to know the exact period of the high or low to create the Indicator Formula.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
videohero
Posted : Wednesday, February 20, 2013 5:07:37 PM
Registered User
Joined: 5/27/2010
Posts: 6

Hi Bruce,

Thank you for the reply. I tried the Aroon - it works but a bit clunky. 

I'd llke a large period in order to search. Say 250. Based on that large formula, I could pare it down lower as needed. Thank you very much.

 

Bruce_L
Posted : Thursday, February 21, 2013 9:30:08 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Using a period of 250 results in indicator formulas which are too long and slow to be practical or post in the forums. The longest period I can post is 241. An Indicator Formula for how many bars ago price was most recently at its current 241-Period High could be written as:

ABS(H < MAXH241) * (ABS(H1 = MAXH241) + ABS(H1 < MAXH241) * (ABS(H2 = MAXH241) * 2 + ABS(H2 < MAXH241) * (ABS(H3 = MAXH241) * 3 + ABS(H3 < MAXH241) * (ABS(H4 = MAXH241) * 4 + ABS(H4 < MAXH241) * (ABS(H5 = MAXH241) * 5 + ABS(H5 < MAXH241) * (ABS(H6 = MAXH241) * 6 + ABS(H6 < MAXH241) * (ABS(H7 = MAXH241) * 7 + ABS(H7 < MAXH241) * (ABS(H8 = MAXH241) * 8 + ABS(H8 < MAXH241) * (ABS(H9 = MAXH241) * 9 + ABS(H9 < MAXH241) * (ABS(H10 = MAXH241) * 10 + ABS(H10 < MAXH241) * (ABS(H11 = MAXH241) * 11 + ABS(H11 < MAXH241) * (ABS(H12 = MAXH241) * 12 + ABS(H12 < MAXH241) * (ABS(H13 = MAXH241) * 13 + ABS(H13 < MAXH241) * (ABS(H14 = MAXH241) * 14 + ABS(H14 < MAXH241) * (ABS(H15 = MAXH241) * 15 + ABS(H15 < MAXH241) * (ABS(H16 = MAXH241) * 16 + ABS(H16 < MAXH241) * (ABS(H17 = MAXH241) * 17 + ABS(H17 < MAXH241) * (ABS(H18 = MAXH241) * 18 + ABS(H18 < MAXH241) * (ABS(H19 = MAXH241) * 19 + ABS(H19 < MAXH241) * (ABS(H20 = MAXH241) * 20 + ABS(H20 < MAXH241) * (ABS(H21 = MAXH241) * 21 + ABS(H21 < MAXH241) * (ABS(H22 = MAXH241) * 22 + ABS(H22 < MAXH241) * (ABS(H23 = MAXH241) * 23 + ABS(H23 < MAXH241) * (ABS(H24 = MAXH241) * 24 + ABS(H24 < MAXH241) * (ABS(H25 = MAXH241) * 25 + ABS(H25 < MAXH241) * (ABS(H26 = MAXH241) * 26 + ABS(H26 < MAXH241) * (ABS(H27 = MAXH241) * 27 + ABS(H27 < MAXH241) * (ABS(H28 = MAXH241) * 28 + ABS(H28 < MAXH241) * (ABS(H29 = MAXH241) * 29 + ABS(H29 < MAXH241) * (ABS(H30 = MAXH241) * 30 + ABS(H30 < MAXH241) * (ABS(H31 = MAXH241) * 31 + ABS(H31 < MAXH241) * (ABS(H32 = MAXH241) * 32 + ABS(H32 < MAXH241) * (ABS(H33 = MAXH241) * 33 + ABS(H33 < MAXH241) * (ABS(H34 = MAXH241) * 34 + ABS(H34 < MAXH241) * (ABS(H35 = MAXH241) * 35 + ABS(H35 < MAXH241) * (ABS(H36 = MAXH241) * 36 + ABS(H36 < MAXH241) * (ABS(H37 = MAXH241) * 37 + ABS(H37 < MAXH241) * (ABS(H38 = MAXH241) * 38 + ABS(H38 < MAXH241) * (ABS(H39 = MAXH241) * 39 + ABS(H39 < MAXH241) * (ABS(H40 = MAXH241) * 40 + ABS(H40 < MAXH241) * (ABS(H41 = MAXH241) * 41 + ABS(H41 < MAXH241) * (ABS(H42 = MAXH241) * 42 + ABS(H42 < MAXH241) * (ABS(H43 = MAXH241) * 43 + ABS(H43 < MAXH241) * (ABS(H44 = MAXH241) * 44 + ABS(H44 < MAXH241) * (ABS(H45 = MAXH241) * 45 + ABS(H45 < MAXH241) * (ABS(H46 = MAXH241) * 46 + ABS(H46 < MAXH241) * (ABS(H47 = MAXH241) * 47 + ABS(H47 < MAXH241) * (ABS(H48 = MAXH241) * 48 + ABS(H48 < MAXH241) * (ABS(H49 = MAXH241) * 49 + ABS(H49 < MAXH241) * (ABS(H50 = MAXH241) * 50 + ABS(H50 < MAXH241) * (ABS(H51 = MAXH241) * 51 + ABS(H51 < MAXH241) * (ABS(H52 = MAXH241) * 52 + ABS(H52 < MAXH241) * (ABS(H53 = MAXH241) * 53 + ABS(H53 < MAXH241) * (ABS(H54 = MAXH241) * 54 + ABS(H54 < MAXH241) * (ABS(H55 = MAXH241) * 55 + ABS(H55 < MAXH241) * (ABS(H56 = MAXH241) * 56 + ABS(H56 < MAXH241) * (ABS(H57 = MAXH241) * 57 + ABS(H57 < MAXH241) * (ABS(H58 = MAXH241) * 58 + ABS(H58 < MAXH241) * (ABS(H59 = MAXH241) * 59 + ABS(H59 < MAXH241) * (ABS(H60 = MAXH241) * 60 + ABS(H60 < MAXH241) * (ABS(H61 = MAXH241) * 61 + ABS(H61 < MAXH241) * (ABS(H62 = MAXH241) * 62 + ABS(H62 < MAXH241) * (ABS(H63 = MAXH241) * 63 + ABS(H63 < MAXH241) * (ABS(H64 = MAXH241) * 64 + ABS(H64 < MAXH241) * (ABS(H65 = MAXH241) * 65 + ABS(H65 < MAXH241) * (ABS(H66 = MAXH241) * 66 + ABS(H66 < MAXH241) * (ABS(H67 = MAXH241) * 67 + ABS(H67 < MAXH241) * (ABS(H68 = MAXH241) * 68 + ABS(H68 < MAXH241) * (ABS(H69 = MAXH241) * 69 + ABS(H69 < MAXH241) * (ABS(H70 = MAXH241) * 70 + ABS(H70 < MAXH241) * (ABS(H71 = MAXH241) * 71 + ABS(H71 < MAXH241) * (ABS(H72 = MAXH241) * 72 + ABS(H72 < MAXH241) * (ABS(H73 = MAXH241) * 73 + ABS(H73 < MAXH241) * (ABS(H74 = MAXH241) * 74 + ABS(H74 < MAXH241) * (ABS(H75 = MAXH241) * 75 + ABS(H75 < MAXH241) * (ABS(H76 = MAXH241) * 76 + ABS(H76 < MAXH241) * (ABS(H77 = MAXH241) * 77 + ABS(H77 < MAXH241) * (ABS(H78 = MAXH241) * 78 + ABS(H78 < MAXH241) * (ABS(H79 = MAXH241) * 79 + ABS(H79 < MAXH241) * (ABS(H80 = MAXH241) * 80 + ABS(H80 < MAXH241) * (ABS(H81 = MAXH241) * 81 + ABS(H81 < MAXH241) * (ABS(H82 = MAXH241) * 82 + ABS(H82 < MAXH241) * (ABS(H83 = MAXH241) * 83 + ABS(H83 < MAXH241) * (ABS(H84 = MAXH241) * 84 + ABS(H84 < MAXH241) * (ABS(H85 = MAXH241) * 85 + ABS(H85 < MAXH241) * (ABS(H86 = MAXH241) * 86 + ABS(H86 < MAXH241) * (ABS(H87 = MAXH241) * 87 + ABS(H87 < MAXH241) * (ABS(H88 = MAXH241) * 88 + ABS(H88 < MAXH241) * (ABS(H89 = MAXH241) * 89 + ABS(H89 < MAXH241) * (ABS(H90 = MAXH241) * 90 + ABS(H90 < MAXH241) * (ABS(H91 = MAXH241) * 91 + ABS(H91 < MAXH241) * (ABS(H92 = MAXH241) * 92 + ABS(H92 < MAXH241) * (ABS(H93 = MAXH241) * 93 + ABS(H93 < MAXH241) * (ABS(H94 = MAXH241) * 94 + ABS(H94 < MAXH241) * (ABS(H95 = MAXH241) * 95 + ABS(H95 < MAXH241) * (ABS(H96 = MAXH241) * 96 + ABS(H96 < MAXH241) * (ABS(H97 = MAXH241) * 97 + ABS(H97 < MAXH241) * (ABS(H98 = MAXH241) * 98 + ABS(H98 < MAXH241) * (ABS(H99 = MAXH241) * 99 + ABS(H99 < MAXH241) * (ABS(H100 = MAXH241) * 100 + ABS(H100 < MAXH241) * (ABS(H101 = MAXH241) * 101 + ABS(H101 < MAXH241) * (ABS(H102 = MAXH241) * 102 + ABS(H102 < MAXH241) * (ABS(H103 = MAXH241) * 103 + ABS(H103 < MAXH241) * (ABS(H104 = MAXH241) * 104 + ABS(H104 < MAXH241) * (ABS(H105 = MAXH241) * 105 + ABS(H105 < MAXH241) * (ABS(H106 = MAXH241) * 106 + ABS(H106 < MAXH241) * (ABS(H107 = MAXH241) * 107 + ABS(H107 < MAXH241) * (ABS(H108 = MAXH241) * 108 + ABS(H108 < MAXH241) * (ABS(H109 = MAXH241) * 109 + ABS(H109 < MAXH241) * (ABS(H110 = MAXH241) * 110 + ABS(H110 < MAXH241) * (ABS(H111 = MAXH241) * 111 + ABS(H111 < MAXH241) * (ABS(H112 = MAXH241) * 112 + ABS(H112 < MAXH241) * (ABS(H113 = MAXH241) * 113 + ABS(H113 < MAXH241) * (ABS(H114 = MAXH241) * 114 + ABS(H114 < MAXH241) * (ABS(H115 = MAXH241) * 115 + ABS(H115 < MAXH241) * (ABS(H116 = MAXH241) * 116 + ABS(H116 < MAXH241) * (ABS(H117 = MAXH241) * 117 + ABS(H117 < MAXH241) * (ABS(H118 = MAXH241) * 118 + ABS(H118 < MAXH241) * (ABS(H119 = MAXH241) * 119 + ABS(H119 < MAXH241) * (ABS(H120 = MAXH241) * 120 + ABS(H120 < MAXH241) * (ABS(H121 = MAXH241) * 121 + ABS(H121 < MAXH241) * (ABS(H122 = MAXH241) * 122 + ABS(H122 < MAXH241) * (ABS(H123 = MAXH241) * 123 + ABS(H123 < MAXH241) * (ABS(H124 = MAXH241) * 124 + ABS(H124 < MAXH241) * (ABS(H125 = MAXH241) * 125 + ABS(H125 < MAXH241) * (ABS(H126 = MAXH241) * 126 + ABS(H126 < MAXH241) * (ABS(H127 = MAXH241) * 127 + ABS(H127 < MAXH241) * (ABS(H128 = MAXH241) * 128 + ABS(H128 < MAXH241) * (ABS(H129 = MAXH241) * 129 + ABS(H129 < MAXH241) * (ABS(H130 = MAXH241) * 130 + ABS(H130 < MAXH241) * (ABS(H131 = MAXH241) * 131 + ABS(H131 < MAXH241) * (ABS(H132 = MAXH241) * 132 + ABS(H132 < MAXH241) * (ABS(H133 = MAXH241) * 133 + ABS(H133 < MAXH241) * (ABS(H134 = MAXH241) * 134 + ABS(H134 < MAXH241) * (ABS(H135 = MAXH241) * 135 + ABS(H135 < MAXH241) * (ABS(H136 = MAXH241) * 136 + ABS(H136 < MAXH241) * (ABS(H137 = MAXH241) * 137 + ABS(H137 < MAXH241) * (ABS(H138 = MAXH241) * 138 + ABS(H138 < MAXH241) * (ABS(H139 = MAXH241) * 139 + ABS(H139 < MAXH241) * (ABS(H140 = MAXH241) * 140 + ABS(H140 < MAXH241) * (ABS(H141 = MAXH241) * 141 + ABS(H141 < MAXH241) * (ABS(H142 = MAXH241) * 142 + ABS(H142 < MAXH241) * (ABS(H143 = MAXH241) * 143 + ABS(H143 < MAXH241) * (ABS(H144 = MAXH241) * 144 + ABS(H144 < MAXH241) * (ABS(H145 = MAXH241) * 145 + ABS(H145 < MAXH241) * (ABS(H146 = MAXH241) * 146 + ABS(H146 < MAXH241) * (ABS(H147 = MAXH241) * 147 + ABS(H147 < MAXH241) * (ABS(H148 = MAXH241) * 148 + ABS(H148 < MAXH241) * (ABS(H149 = MAXH241) * 149 + ABS(H149 < MAXH241) * (ABS(H150 = MAXH241) * 150 + ABS(H150 < MAXH241) * (ABS(H151 = MAXH241) * 151 + ABS(H151 < MAXH241) * (ABS(H152 = MAXH241) * 152 + ABS(H152 < MAXH241) * (ABS(H153 = MAXH241) * 153 + ABS(H153 < MAXH241) * (ABS(H154 = MAXH241) * 154 + ABS(H154 < MAXH241) * (ABS(H155 = MAXH241) * 155 + ABS(H155 < MAXH241) * (ABS(H156 = MAXH241) * 156 + ABS(H156 < MAXH241) * (ABS(H157 = MAXH241) * 157 + ABS(H157 < MAXH241) * (ABS(H158 = MAXH241) * 158 + ABS(H158 < MAXH241) * (ABS(H159 = MAXH241) * 159 + ABS(H159 < MAXH241) * (ABS(H160 = MAXH241) * 160 + ABS(H160 < MAXH241) * (ABS(H161 = MAXH241) * 161 + ABS(H161 < MAXH241) * (ABS(H162 = MAXH241) * 162 + ABS(H162 < MAXH241) * (ABS(H163 = MAXH241) * 163 + ABS(H163 < MAXH241) * (ABS(H164 = MAXH241) * 164 + ABS(H164 < MAXH241) * (ABS(H165 = MAXH241) * 165 + ABS(H165 < MAXH241) * (ABS(H166 = MAXH241) * 166 + ABS(H166 < MAXH241) * (ABS(H167 = MAXH241) * 167 + ABS(H167 < MAXH241) * (ABS(H168 = MAXH241) * 168 + ABS(H168 < MAXH241) * (ABS(H169 = MAXH241) * 169 + ABS(H169 < MAXH241) * (ABS(H170 = MAXH241) * 170 + ABS(H170 < MAXH241) * (ABS(H171 = MAXH241) * 171 + ABS(H171 < MAXH241) * (ABS(H172 = MAXH241) * 172 + ABS(H172 < MAXH241) * (ABS(H173 = MAXH241) * 173 + ABS(H173 < MAXH241) * (ABS(H174 = MAXH241) * 174 + ABS(H174 < MAXH241) * (ABS(H175 = MAXH241) * 175 + ABS(H175 < MAXH241) * (ABS(H176 = MAXH241) * 176 + ABS(H176 < MAXH241) * (ABS(H177 = MAXH241) * 177 + ABS(H177 < MAXH241) * (ABS(H178 = MAXH241) * 178 + ABS(H178 < MAXH241) * (ABS(H179 = MAXH241) * 179 + ABS(H179 < MAXH241) * (ABS(H180 = MAXH241) * 180 + ABS(H180 < MAXH241) * (ABS(H181 = MAXH241) * 181 + ABS(H181 < MAXH241) * (ABS(H182 = MAXH241) * 182 + ABS(H182 < MAXH241) * (ABS(H183 = MAXH241) * 183 + ABS(H183 < MAXH241) * (ABS(H184 = MAXH241) * 184 + ABS(H184 < MAXH241) * (ABS(H185 = MAXH241) * 185 + ABS(H185 < MAXH241) * (ABS(H186 = MAXH241) * 186 + ABS(H186 < MAXH241) * (ABS(H187 = MAXH241) * 187 + ABS(H187 < MAXH241) * (ABS(H188 = MAXH241) * 188 + ABS(H188 < MAXH241) * (ABS(H189 = MAXH241) * 189 + ABS(H189 < MAXH241) * (ABS(H190 = MAXH241) * 190 + ABS(H190 < MAXH241) * (ABS(H191 = MAXH241) * 191 + ABS(H191 < MAXH241) * (ABS(H192 = MAXH241) * 192 + ABS(H192 < MAXH241) * (ABS(H193 = MAXH241) * 193 + ABS(H193 < MAXH241) * (ABS(H194 = MAXH241) * 194 + ABS(H194 < MAXH241) * (ABS(H195 = MAXH241) * 195 + ABS(H195 < MAXH241) * (ABS(H196 = MAXH241) * 196 + ABS(H196 < MAXH241) * (ABS(H197 = MAXH241) * 197 + ABS(H197 < MAXH241) * (ABS(H198 = MAXH241) * 198 + ABS(H198 < MAXH241) * (ABS(H199 = MAXH241) * 199 + ABS(H199 < MAXH241) * (ABS(H200 = MAXH241) * 200 + ABS(H200 < MAXH241) * (ABS(H201 = MAXH241) * 201 + ABS(H201 < MAXH241) * (ABS(H202 = MAXH241) * 202 + ABS(H202 < MAXH241) * (ABS(H203 = MAXH241) * 203 + ABS(H203 < MAXH241) * (ABS(H204 = MAXH241) * 204 + ABS(H204 < MAXH241) * (ABS(H205 = MAXH241) * 205 + ABS(H205 < MAXH241) * (ABS(H206 = MAXH241) * 206 + ABS(H206 < MAXH241) * (ABS(H207 = MAXH241) * 207 + ABS(H207 < MAXH241) * (ABS(H208 = MAXH241) * 208 + ABS(H208 < MAXH241) * (ABS(H209 = MAXH241) * 209 + ABS(H209 < MAXH241) * (ABS(H210 = MAXH241) * 210 + ABS(H210 < MAXH241) * (ABS(H211 = MAXH241) * 211 + ABS(H211 < MAXH241) * (ABS(H212 = MAXH241) * 212 + ABS(H212 < MAXH241) * (ABS(H213 = MAXH241) * 213 + ABS(H213 < MAXH241) * (ABS(H214 = MAXH241) * 214 + ABS(H214 < MAXH241) * (ABS(H215 = MAXH241) * 215 + ABS(H215 < MAXH241) * (ABS(H216 = MAXH241) * 216 + ABS(H216 < MAXH241) * (ABS(H217 = MAXH241) * 217 + ABS(H217 < MAXH241) * (ABS(H218 = MAXH241) * 218 + ABS(H218 < MAXH241) * (ABS(H219 = MAXH241) * 219 + ABS(H219 < MAXH241) * (ABS(H220 = MAXH241) * 220 + ABS(H220 < MAXH241) * (ABS(H221 = MAXH241) * 221 + ABS(H221 < MAXH241) * (ABS(H222 = MAXH241) * 222 + ABS(H222 < MAXH241) * (ABS(H223 = MAXH241) * 223 + ABS(H223 < MAXH241) * (ABS(H224 = MAXH241) * 224 + ABS(H224 < MAXH241) * (ABS(H225 = MAXH241) * 225 + ABS(H225 < MAXH241) * (ABS(H226 = MAXH241) * 226 + ABS(H226 < MAXH241) * (ABS(H227 = MAXH241) * 227 + ABS(H227 < MAXH241) * (ABS(H228 = MAXH241) * 228 + ABS(H228 < MAXH241) * (ABS(H229 = MAXH241) * 229 + ABS(H229 < MAXH241) * (ABS(H230 = MAXH241) * 230 + ABS(H230 < MAXH241) * (ABS(H231 = MAXH241) * 231 + ABS(H231 < MAXH241) * (ABS(H232 = MAXH241) * 232 + ABS(H232 < MAXH241) * (ABS(H233 = MAXH241) * 233 + ABS(H233 < MAXH241) * (ABS(H234 = MAXH241) * 234 + ABS(H234 < MAXH241) * (ABS(H235 = MAXH241) * 235 + ABS(H235 < MAXH241) * (ABS(H236 = MAXH241) * 236 + ABS(H236 < MAXH241) * (ABS(H237 = MAXH241) * 237 + ABS(H237 < MAXH241) * (ABS(H238 = MAXH241) * 238 + ABS(H238 < MAXH241) * (ABS(H239 = MAXH241) * 239 + ABS(H239 < MAXH241) * 240)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

And an Indicator Formula for the number of bars ago that price was most recently at its current 241-Period Low could be written as:

ABS(L > MINL241) * (ABS(L1 = MINL241) + ABS(L1 > MINL241) * (ABS(L2 = MINL241) * 2 + ABS(L2 > MINL241) * (ABS(L3 = MINL241) * 3 + ABS(L3 > MINL241) * (ABS(L4 = MINL241) * 4 + ABS(L4 > MINL241) * (ABS(L5 = MINL241) * 5 + ABS(L5 > MINL241) * (ABS(L6 = MINL241) * 6 + ABS(L6 > MINL241) * (ABS(L7 = MINL241) * 7 + ABS(L7 > MINL241) * (ABS(L8 = MINL241) * 8 + ABS(L8 > MINL241) * (ABS(L9 = MINL241) * 9 + ABS(L9 > MINL241) * (ABS(L10 = MINL241) * 10 + ABS(L10 > MINL241) * (ABS(L11 = MINL241) * 11 + ABS(L11 > MINL241) * (ABS(L12 = MINL241) * 12 + ABS(L12 > MINL241) * (ABS(L13 = MINL241) * 13 + ABS(L13 > MINL241) * (ABS(L14 = MINL241) * 14 + ABS(L14 > MINL241) * (ABS(L15 = MINL241) * 15 + ABS(L15 > MINL241) * (ABS(L16 = MINL241) * 16 + ABS(L16 > MINL241) * (ABS(L17 = MINL241) * 17 + ABS(L17 > MINL241) * (ABS(L18 = MINL241) * 18 + ABS(L18 > MINL241) * (ABS(L19 = MINL241) * 19 + ABS(L19 > MINL241) * (ABS(L20 = MINL241) * 20 + ABS(L20 > MINL241) * (ABS(L21 = MINL241) * 21 + ABS(L21 > MINL241) * (ABS(L22 = MINL241) * 22 + ABS(L22 > MINL241) * (ABS(L23 = MINL241) * 23 + ABS(L23 > MINL241) * (ABS(L24 = MINL241) * 24 + ABS(L24 > MINL241) * (ABS(L25 = MINL241) * 25 + ABS(L25 > MINL241) * (ABS(L26 = MINL241) * 26 + ABS(L26 > MINL241) * (ABS(L27 = MINL241) * 27 + ABS(L27 > MINL241) * (ABS(L28 = MINL241) * 28 + ABS(L28 > MINL241) * (ABS(L29 = MINL241) * 29 + ABS(L29 > MINL241) * (ABS(L30 = MINL241) * 30 + ABS(L30 > MINL241) * (ABS(L31 = MINL241) * 31 + ABS(L31 > MINL241) * (ABS(L32 = MINL241) * 32 + ABS(L32 > MINL241) * (ABS(L33 = MINL241) * 33 + ABS(L33 > MINL241) * (ABS(L34 = MINL241) * 34 + ABS(L34 > MINL241) * (ABS(L35 = MINL241) * 35 + ABS(L35 > MINL241) * (ABS(L36 = MINL241) * 36 + ABS(L36 > MINL241) * (ABS(L37 = MINL241) * 37 + ABS(L37 > MINL241) * (ABS(L38 = MINL241) * 38 + ABS(L38 > MINL241) * (ABS(L39 = MINL241) * 39 + ABS(L39 > MINL241) * (ABS(L40 = MINL241) * 40 + ABS(L40 > MINL241) * (ABS(L41 = MINL241) * 41 + ABS(L41 > MINL241) * (ABS(L42 = MINL241) * 42 + ABS(L42 > MINL241) * (ABS(L43 = MINL241) * 43 + ABS(L43 > MINL241) * (ABS(L44 = MINL241) * 44 + ABS(L44 > MINL241) * (ABS(L45 = MINL241) * 45 + ABS(L45 > MINL241) * (ABS(L46 = MINL241) * 46 + ABS(L46 > MINL241) * (ABS(L47 = MINL241) * 47 + ABS(L47 > MINL241) * (ABS(L48 = MINL241) * 48 + ABS(L48 > MINL241) * (ABS(L49 = MINL241) * 49 + ABS(L49 > MINL241) * (ABS(L50 = MINL241) * 50 + ABS(L50 > MINL241) * (ABS(L51 = MINL241) * 51 + ABS(L51 > MINL241) * (ABS(L52 = MINL241) * 52 + ABS(L52 > MINL241) * (ABS(L53 = MINL241) * 53 + ABS(L53 > MINL241) * (ABS(L54 = MINL241) * 54 + ABS(L54 > MINL241) * (ABS(L55 = MINL241) * 55 + ABS(L55 > MINL241) * (ABS(L56 = MINL241) * 56 + ABS(L56 > MINL241) * (ABS(L57 = MINL241) * 57 + ABS(L57 > MINL241) * (ABS(L58 = MINL241) * 58 + ABS(L58 > MINL241) * (ABS(L59 = MINL241) * 59 + ABS(L59 > MINL241) * (ABS(L60 = MINL241) * 60 + ABS(L60 > MINL241) * (ABS(L61 = MINL241) * 61 + ABS(L61 > MINL241) * (ABS(L62 = MINL241) * 62 + ABS(L62 > MINL241) * (ABS(L63 = MINL241) * 63 + ABS(L63 > MINL241) * (ABS(L64 = MINL241) * 64 + ABS(L64 > MINL241) * (ABS(L65 = MINL241) * 65 + ABS(L65 > MINL241) * (ABS(L66 = MINL241) * 66 + ABS(L66 > MINL241) * (ABS(L67 = MINL241) * 67 + ABS(L67 > MINL241) * (ABS(L68 = MINL241) * 68 + ABS(L68 > MINL241) * (ABS(L69 = MINL241) * 69 + ABS(L69 > MINL241) * (ABS(L70 = MINL241) * 70 + ABS(L70 > MINL241) * (ABS(L71 = MINL241) * 71 + ABS(L71 > MINL241) * (ABS(L72 = MINL241) * 72 + ABS(L72 > MINL241) * (ABS(L73 = MINL241) * 73 + ABS(L73 > MINL241) * (ABS(L74 = MINL241) * 74 + ABS(L74 > MINL241) * (ABS(L75 = MINL241) * 75 + ABS(L75 > MINL241) * (ABS(L76 = MINL241) * 76 + ABS(L76 > MINL241) * (ABS(L77 = MINL241) * 77 + ABS(L77 > MINL241) * (ABS(L78 = MINL241) * 78 + ABS(L78 > MINL241) * (ABS(L79 = MINL241) * 79 + ABS(L79 > MINL241) * (ABS(L80 = MINL241) * 80 + ABS(L80 > MINL241) * (ABS(L81 = MINL241) * 81 + ABS(L81 > MINL241) * (ABS(L82 = MINL241) * 82 + ABS(L82 > MINL241) * (ABS(L83 = MINL241) * 83 + ABS(L83 > MINL241) * (ABS(L84 = MINL241) * 84 + ABS(L84 > MINL241) * (ABS(L85 = MINL241) * 85 + ABS(L85 > MINL241) * (ABS(L86 = MINL241) * 86 + ABS(L86 > MINL241) * (ABS(L87 = MINL241) * 87 + ABS(L87 > MINL241) * (ABS(L88 = MINL241) * 88 + ABS(L88 > MINL241) * (ABS(L89 = MINL241) * 89 + ABS(L89 > MINL241) * (ABS(L90 = MINL241) * 90 + ABS(L90 > MINL241) * (ABS(L91 = MINL241) * 91 + ABS(L91 > MINL241) * (ABS(L92 = MINL241) * 92 + ABS(L92 > MINL241) * (ABS(L93 = MINL241) * 93 + ABS(L93 > MINL241) * (ABS(L94 = MINL241) * 94 + ABS(L94 > MINL241) * (ABS(L95 = MINL241) * 95 + ABS(L95 > MINL241) * (ABS(L96 = MINL241) * 96 + ABS(L96 > MINL241) * (ABS(L97 = MINL241) * 97 + ABS(L97 > MINL241) * (ABS(L98 = MINL241) * 98 + ABS(L98 > MINL241) * (ABS(L99 = MINL241) * 99 + ABS(L99 > MINL241) * (ABS(L100 = MINL241) * 100 + ABS(L100 > MINL241) * (ABS(L101 = MINL241) * 101 + ABS(L101 > MINL241) * (ABS(L102 = MINL241) * 102 + ABS(L102 > MINL241) * (ABS(L103 = MINL241) * 103 + ABS(L103 > MINL241) * (ABS(L104 = MINL241) * 104 + ABS(L104 > MINL241) * (ABS(L105 = MINL241) * 105 + ABS(L105 > MINL241) * (ABS(L106 = MINL241) * 106 + ABS(L106 > MINL241) * (ABS(L107 = MINL241) * 107 + ABS(L107 > MINL241) * (ABS(L108 = MINL241) * 108 + ABS(L108 > MINL241) * (ABS(L109 = MINL241) * 109 + ABS(L109 > MINL241) * (ABS(L110 = MINL241) * 110 + ABS(L110 > MINL241) * (ABS(L111 = MINL241) * 111 + ABS(L111 > MINL241) * (ABS(L112 = MINL241) * 112 + ABS(L112 > MINL241) * (ABS(L113 = MINL241) * 113 + ABS(L113 > MINL241) * (ABS(L114 = MINL241) * 114 + ABS(L114 > MINL241) * (ABS(L115 = MINL241) * 115 + ABS(L115 > MINL241) * (ABS(L116 = MINL241) * 116 + ABS(L116 > MINL241) * (ABS(L117 = MINL241) * 117 + ABS(L117 > MINL241) * (ABS(L118 = MINL241) * 118 + ABS(L118 > MINL241) * (ABS(L119 = MINL241) * 119 + ABS(L119 > MINL241) * (ABS(L120 = MINL241) * 120 + ABS(L120 > MINL241) * (ABS(L121 = MINL241) * 121 + ABS(L121 > MINL241) * (ABS(L122 = MINL241) * 122 + ABS(L122 > MINL241) * (ABS(L123 = MINL241) * 123 + ABS(L123 > MINL241) * (ABS(L124 = MINL241) * 124 + ABS(L124 > MINL241) * (ABS(L125 = MINL241) * 125 + ABS(L125 > MINL241) * (ABS(L126 = MINL241) * 126 + ABS(L126 > MINL241) * (ABS(L127 = MINL241) * 127 + ABS(L127 > MINL241) * (ABS(L128 = MINL241) * 128 + ABS(L128 > MINL241) * (ABS(L129 = MINL241) * 129 + ABS(L129 > MINL241) * (ABS(L130 = MINL241) * 130 + ABS(L130 > MINL241) * (ABS(L131 = MINL241) * 131 + ABS(L131 > MINL241) * (ABS(L132 = MINL241) * 132 + ABS(L132 > MINL241) * (ABS(L133 = MINL241) * 133 + ABS(L133 > MINL241) * (ABS(L134 = MINL241) * 134 + ABS(L134 > MINL241) * (ABS(L135 = MINL241) * 135 + ABS(L135 > MINL241) * (ABS(L136 = MINL241) * 136 + ABS(L136 > MINL241) * (ABS(L137 = MINL241) * 137 + ABS(L137 > MINL241) * (ABS(L138 = MINL241) * 138 + ABS(L138 > MINL241) * (ABS(L139 = MINL241) * 139 + ABS(L139 > MINL241) * (ABS(L140 = MINL241) * 140 + ABS(L140 > MINL241) * (ABS(L141 = MINL241) * 141 + ABS(L141 > MINL241) * (ABS(L142 = MINL241) * 142 + ABS(L142 > MINL241) * (ABS(L143 = MINL241) * 143 + ABS(L143 > MINL241) * (ABS(L144 = MINL241) * 144 + ABS(L144 > MINL241) * (ABS(L145 = MINL241) * 145 + ABS(L145 > MINL241) * (ABS(L146 = MINL241) * 146 + ABS(L146 > MINL241) * (ABS(L147 = MINL241) * 147 + ABS(L147 > MINL241) * (ABS(L148 = MINL241) * 148 + ABS(L148 > MINL241) * (ABS(L149 = MINL241) * 149 + ABS(L149 > MINL241) * (ABS(L150 = MINL241) * 150 + ABS(L150 > MINL241) * (ABS(L151 = MINL241) * 151 + ABS(L151 > MINL241) * (ABS(L152 = MINL241) * 152 + ABS(L152 > MINL241) * (ABS(L153 = MINL241) * 153 + ABS(L153 > MINL241) * (ABS(L154 = MINL241) * 154 + ABS(L154 > MINL241) * (ABS(L155 = MINL241) * 155 + ABS(L155 > MINL241) * (ABS(L156 = MINL241) * 156 + ABS(L156 > MINL241) * (ABS(L157 = MINL241) * 157 + ABS(L157 > MINL241) * (ABS(L158 = MINL241) * 158 + ABS(L158 > MINL241) * (ABS(L159 = MINL241) * 159 + ABS(L159 > MINL241) * (ABS(L160 = MINL241) * 160 + ABS(L160 > MINL241) * (ABS(L161 = MINL241) * 161 + ABS(L161 > MINL241) * (ABS(L162 = MINL241) * 162 + ABS(L162 > MINL241) * (ABS(L163 = MINL241) * 163 + ABS(L163 > MINL241) * (ABS(L164 = MINL241) * 164 + ABS(L164 > MINL241) * (ABS(L165 = MINL241) * 165 + ABS(L165 > MINL241) * (ABS(L166 = MINL241) * 166 + ABS(L166 > MINL241) * (ABS(L167 = MINL241) * 167 + ABS(L167 > MINL241) * (ABS(L168 = MINL241) * 168 + ABS(L168 > MINL241) * (ABS(L169 = MINL241) * 169 + ABS(L169 > MINL241) * (ABS(L170 = MINL241) * 170 + ABS(L170 > MINL241) * (ABS(L171 = MINL241) * 171 + ABS(L171 > MINL241) * (ABS(L172 = MINL241) * 172 + ABS(L172 > MINL241) * (ABS(L173 = MINL241) * 173 + ABS(L173 > MINL241) * (ABS(L174 = MINL241) * 174 + ABS(L174 > MINL241) * (ABS(L175 = MINL241) * 175 + ABS(L175 > MINL241) * (ABS(L176 = MINL241) * 176 + ABS(L176 > MINL241) * (ABS(L177 = MINL241) * 177 + ABS(L177 > MINL241) * (ABS(L178 = MINL241) * 178 + ABS(L178 > MINL241) * (ABS(L179 = MINL241) * 179 + ABS(L179 > MINL241) * (ABS(L180 = MINL241) * 180 + ABS(L180 > MINL241) * (ABS(L181 = MINL241) * 181 + ABS(L181 > MINL241) * (ABS(L182 = MINL241) * 182 + ABS(L182 > MINL241) * (ABS(L183 = MINL241) * 183 + ABS(L183 > MINL241) * (ABS(L184 = MINL241) * 184 + ABS(L184 > MINL241) * (ABS(L185 = MINL241) * 185 + ABS(L185 > MINL241) * (ABS(L186 = MINL241) * 186 + ABS(L186 > MINL241) * (ABS(L187 = MINL241) * 187 + ABS(L187 > MINL241) * (ABS(L188 = MINL241) * 188 + ABS(L188 > MINL241) * (ABS(L189 = MINL241) * 189 + ABS(L189 > MINL241) * (ABS(L190 = MINL241) * 190 + ABS(L190 > MINL241) * (ABS(L191 = MINL241) * 191 + ABS(L191 > MINL241) * (ABS(L192 = MINL241) * 192 + ABS(L192 > MINL241) * (ABS(L193 = MINL241) * 193 + ABS(L193 > MINL241) * (ABS(L194 = MINL241) * 194 + ABS(L194 > MINL241) * (ABS(L195 = MINL241) * 195 + ABS(L195 > MINL241) * (ABS(L196 = MINL241) * 196 + ABS(L196 > MINL241) * (ABS(L197 = MINL241) * 197 + ABS(L197 > MINL241) * (ABS(L198 = MINL241) * 198 + ABS(L198 > MINL241) * (ABS(L199 = MINL241) * 199 + ABS(L199 > MINL241) * (ABS(L200 = MINL241) * 200 + ABS(L200 > MINL241) * (ABS(L201 = MINL241) * 201 + ABS(L201 > MINL241) * (ABS(L202 = MINL241) * 202 + ABS(L202 > MINL241) * (ABS(L203 = MINL241) * 203 + ABS(L203 > MINL241) * (ABS(L204 = MINL241) * 204 + ABS(L204 > MINL241) * (ABS(L205 = MINL241) * 205 + ABS(L205 > MINL241) * (ABS(L206 = MINL241) * 206 + ABS(L206 > MINL241) * (ABS(L207 = MINL241) * 207 + ABS(L207 > MINL241) * (ABS(L208 = MINL241) * 208 + ABS(L208 > MINL241) * (ABS(L209 = MINL241) * 209 + ABS(L209 > MINL241) * (ABS(L210 = MINL241) * 210 + ABS(L210 > MINL241) * (ABS(L211 = MINL241) * 211 + ABS(L211 > MINL241) * (ABS(L212 = MINL241) * 212 + ABS(L212 > MINL241) * (ABS(L213 = MINL241) * 213 + ABS(L213 > MINL241) * (ABS(L214 = MINL241) * 214 + ABS(L214 > MINL241) * (ABS(L215 = MINL241) * 215 + ABS(L215 > MINL241) * (ABS(L216 = MINL241) * 216 + ABS(L216 > MINL241) * (ABS(L217 = MINL241) * 217 + ABS(L217 > MINL241) * (ABS(L218 = MINL241) * 218 + ABS(L218 > MINL241) * (ABS(L219 = MINL241) * 219 + ABS(L219 > MINL241) * (ABS(L220 = MINL241) * 220 + ABS(L220 > MINL241) * (ABS(L221 = MINL241) * 221 + ABS(L221 > MINL241) * (ABS(L222 = MINL241) * 222 + ABS(L222 > MINL241) * (ABS(L223 = MINL241) * 223 + ABS(L223 > MINL241) * (ABS(L224 = MINL241) * 224 + ABS(L224 > MINL241) * (ABS(L225 = MINL241) * 225 + ABS(L225 > MINL241) * (ABS(L226 = MINL241) * 226 + ABS(L226 > MINL241) * (ABS(L227 = MINL241) * 227 + ABS(L227 > MINL241) * (ABS(L228 = MINL241) * 228 + ABS(L228 > MINL241) * (ABS(L229 = MINL241) * 229 + ABS(L229 > MINL241) * (ABS(L230 = MINL241) * 230 + ABS(L230 > MINL241) * (ABS(L231 = MINL241) * 231 + ABS(L231 > MINL241) * (ABS(L232 = MINL241) * 232 + ABS(L232 > MINL241) * (ABS(L233 = MINL241) * 233 + ABS(L233 > MINL241) * (ABS(L234 = MINL241) * 234 + ABS(L234 > MINL241) * (ABS(L235 = MINL241) * 235 + ABS(L235 > MINL241) * (ABS(L236 = MINL241) * 236 + ABS(L236 > MINL241) * (ABS(L237 = MINL241) * 237 + ABS(L237 > MINL241) * (ABS(L238 = MINL241) * 238 + ABS(L238 > MINL241) * (ABS(L239 = MINL241) * 239 + ABS(L239 > MINL241) * 240)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
mittal
Posted : Tuesday, March 5, 2013 1:03:33 PM
Registered User
Joined: 3/5/2013
Posts: 2

Holy moly that is a big formula, can that even be processed? Imagine if you forget a closing brace somewhere.

Just wanted tot thank Bruce L the first code for StockFinder worked great for me

Bruce_L
Posted : Tuesday, March 5, 2013 1:07:44 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



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