Registered User Joined: 3/6/2005 Posts: 16
|
I need help writing Real Code for the following:
PULLBACK
The stock shows 3 consecutive lower highs, and
The stock has three consecutive days of lower volume than the previous day, and
The highest high of the last two weeks is higher that the highest high of the previous two weeks and the lowest low of the last two weeks is higher that the lowest low of the previous two weeks.
PRICE TRIGGER
The price trigger occurs when today's high is greater than yesterday's high and the 21 day simple moving average is greater than 200,000.
ENTRY
If the pullback happened yesterday and a trigger occurs today, then enter the market.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I suspect you really only need RealCode for the Entry, but a RealCode Condition for the Pullback could be created as:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Pullback
'|******************************************************************
Static Count As Integer
If Price.High < Price.High(1) AndAlso _
Volume.Value < Volume.Value(1) Then
Count += 1
Else
Count = 0
End If
If CurrentIndex >= 20 Then
If Count >= 3 AndAlso _
Price.MaxHigh(10) > Price.MaxHigh(10, 10) AndAlso _
Price.MinLow(10) > Price.MinLow(10, 10) Then
Pass
End If
Else
SetIndexInvalid
End If
A RealCode Condition for the Price Trigger could be created as:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Price Trigger
'|******************************************************************
If Volume.AVG(21) > 2000 AndAlso _
Price.High > Price.High(1) Then Pass
And a RealCode Condition for the Entry could be created as:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Entry
'|******************************************************************
Static Count As Integer
If Price.High(1) < Price.High(2) AndAlso _
Volume.Value(1) < Volume.Value(2) Then
Count += 1
Else
Count = 0
End If
If CurrentIndex >= 21 Then
If Count >= 3 AndAlso _
Price.High > Price.High(1) AndAlso _
Volume.AVG(21) > 2000 AndAlso _
Price.MaxHigh(10, 1) > Price.MaxHigh(10, 11) AndAlso _
Price.MinLow(10, 1) > Price.MinLow(10, 11) Then
Pass
End If
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 3/6/2011 Posts: 4
|
Hi Bruce,
can you please write me a PCF for that formula as I do not have Stock finder. Thanks
PULLBACK
The stock shows 3 consecutive lower highs, and
The stock has three consecutive days of lower volume than the previous day, and
The highest high of the last two weeks is higher that the highest high of the previous two weeks and the lowest low of the last two weeks is higher that the lowest low of the previous two weeks.
PRICE TRIGGER
The price trigger occurs when today's high is greater than yesterday's high and the 21 day simple moving average is greater than 200,000.
ENTRY
If the pullback happened yesterday and a trigger occurs today, then enter the market.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A Condition Formula for the Pullback can be written as follows.
H < H1 AND H1 < H2 AND H2 < H3 AND MAXH10 > MAXH10.10 AND MINL10 > MINL10.10
A Condition Formula for the Price Trigger can be written as follows.
AVGV21 > 200000 AND H > H1
A Condition Formula for the Entry can be written as follows.
H > H1 AND H1 < H2 AND H2 < H3 AND H3 < H4 AND AVGV21 > 200000 AND MAXH10.1 > MAXH10.11 AND MINL10.1 > MINL10.11
PCF Formula Descriptions
-Bruce Personal Criteria Formulas TC2000 Support Articles
|