Registered User Joined: 1/20/2005 Posts: 129
|
Hi Bruce, So far so good! What you did to straighten out "Condition to find stocks that are up huge" works great! Can you please do the same thing for my unreliable condition: Deep PullBack:
If Price.Low/Price.MaxHigh(5,1) <= 0.7 Then Pass
Again, just like the last one, I want to evaluate this condition based on daily candles but see it on an intraday chart. I case it changes anything (so I don't waste your time), where this is heading/next step: putting these together in a sequence condition.
In advance, thanks. Richard
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following RealCode Condition:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Deep Pullback
'|******************************************************************
Static DayHigh(5) As Single
Static DaysHigh As Single
If isFirstBar Then
For i As Integer = 0 To 5
DayHigh(i) = Single.NaN
Next
DaysHigh = Single.NaN
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
DaysHigh = Single.MinValue
For i As Integer = 5 To 1 Step -1
DayHigh(i) = DayHigh(i - 1)
DaysHigh = System.Math.Max(DaysHigh, DayHigh(i))
Next
DayHigh(0) = Price.High
Else
DayHigh(0) = System.Math.Max(DayHigh(0), Price.High)
End If
If Single.IsNaN(DayHigh(5)) Then
SetIndexInvalid
Else
If Price.Low <= .7 * DaysHigh Then
Pass
End If
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|