Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 11/26/2007 Posts: 116
|
Bruce,
You have provided PCF's for the Charmill Value Indicator and the Chartmill Bull Indicator in the below TC2000 posts. I am using these in Tc2000 and would like these two indicators in SF 5 in order to do backtesting.
Thanks
Jim
Posted : Thursday, October 31, 2013 8:37:31 AM |
|
|
Worden Trainer
Joined: 10/7/2004
Posts: 50,632 |
You can plot just the close using the formula given in my original response:
(2 * C - AVGH5 - AVGL5) / (AVGH5 - AVGL5 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4)) / 5)
|
Thursday, April 17, 2014 10:43:59 AM |
|
|
Worden Trainer
Joined: 10/7/2004
Posts: 50,633 |
I can't think of a good way to get this to plot only when it is above 3, but you can click on the indicator and select Horizontal Lines to add a line at either 2 or 3 to make it relatively easy to see visually when the Custom Indicator is 3 or greater. I think 2 works better than 3 for this because I'm looking for it to be above the line, but I think it would be a personal preference.
Please try a Custom Indicator with the following settings:
- Plot Style: Histogram
- Period: 20
- Average Type: Simple
- Formula: 20 * ABS(SGN(C - C1) + SGN(C - C2) + SGN(C - C3) + SGN(C - C4) + SGN(C - C5) + SGN(C - C6) + SGN(C - C7) + SGN(C - C8) + SGN(C - C9) + SGN(C - C10) + SGN(C - C11) + SGN(C - C12) + SGN(C - C13) + SGN(C - C14) + SGN(C - C15) + SGN(C - C16) + SGN(C - C17) + SGN(C - C18) + SGN(C - C19) < -10.5 AND SGN(STOC1 - STOC1.1.1) + SGN(STOC1 - STOC1.1.2) + SGN(STOC1 - STOC1.1.3) + SGN(STOC1 - STOC1.1.4) + SGN(STOC1 - STOC1.1.5) + SGN(STOC1 - STOC1.1.6) + SGN(STOC1 - STOC1.1.7) + SGN(STOC1 - STOC1.1.8) + SGN(STOC1 - STOC1.1.9) + SGN(STOC1 - STOC1.1.10) + SGN(STOC1 - STOC1.1.11) + SGN(STOC1 - STOC1.1.12) + SGN(STOC1 - STOC1.1.13) + SGN(STOC1 - STOC1.1.14) + SGN(STOC1 - STOC1.1.15) + SGN(STOC1 - STOC1.1.16) + SGN(STOC1 - STOC1.1.17) + SGN(STOC1 - STOC1.1.18) + SGN(STOC1 - STOC1.1.19) > 10.5)
|
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'll start with the Chartmill Value Indicator.
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Chartmill Value Indicator
'|******************************************************************
'# Period = UserInput.Integer = 5
Static Sum(1) As Single
Static MidPoint As New List(Of Single)
Static TrueRange As New List(Of Single)
If isFirstBar Then
Sum(0) = 0
Sum(1) = 0
MidPoint.Clear
TrueRange.Clear
Else
MidPoint.Add((Price.High + Price.Low) / 2)
Sum(0) += MidPoint(MidPoint.Count - 1)
TrueRange.Add(System.Math.Max(Price.High, Price.Last(1)) - _
System.Math.Min(Price.Low, Price.Last(1)))
Sum(1) += TrueRange(TrueRange.Count - 1)
End If
If TrueRange.Count = Period Then
If Sum(1) > 0 Then
OpenValue = (Price.Open * Period - Sum(0)) / Sum(1)
HighValue = (Price.High * Period - Sum(0)) / Sum(1)
LowValue = (Price.Low * Period - Sum(0)) / Sum(1)
Plot = (Price.Last * Period - Sum(0)) / Sum(1)
Else
OpenValue = Single.NaN
HighValue = Single.NaN
LowValue = Single.NaN
Plot = Single.NaN
End If
Sum(0) -= MidPoint(0)
MidPoint.RemoveAt(0)
Sum(1) -= TrueRange(0)
TrueRange.RemoveAt(0)
Else
OpenValue = Single.NaN
HighValue = Single.NaN
LowValue = Single.NaN
Plot = Single.NaN
End If
If isLastbar Then
MidPoint.Clear
TrueRange.Clear
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I think this should work for the Chartmill Bull Indicator.
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Chartmill Bull Indicator
'|******************************************************************
Static BullBar As New List(Of Boolean)
Static BullCount As Integer
If isFirstBar Then
BullCount = 0
BullBar.Clear
End If
If CurrentIndex >= 19 Then
Dim isBull As Boolean = False
Dim PriceCount As Single = 0
Dim StocCount As Single = 0
For i As Integer = 1 To 19
PriceCount += System.Math.Sign(Price.Last - Price.Last(i))
StocCount += System.Math.Sign(Price.STOC(1, 1, 0) - Price.STOC(1, 1, i))
If PriceCount < -10.5 AndAlso _
StocCount > 10.5 Then
isBull = True
Exit For
End If
Next
BullBar.Add(isBull)
If BullBar(BullBar.Count - 1) = True Then
BullCount += 1
End If
End If
If BullBar.Count = 20 Then
If BullCount > 2.5 Then
Plot = BullCount
Else
Plot = 0
End If
If BullBar(0) = True Then
BullCount -= 1
End If
BullBar.RemoveAt(0)
Else
Plot = Single.NaN
End If
If isLastBar Then
BullBar.Clear
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/26/2007 Posts: 116
|
Thanks Bruce,
I have compared a few of your two indicators against those from the chartmill.com website and they look the same. Onward for more testing.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm sure I could be off a little bit on if I'm comparing the current price to the previous 19 or the previous 20 prices or in the exact numbers for being in the particular 25% ranges, but the basic ideas should be right and only minor adjustments should be necessary to get them to match if the aren't exact.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/26/2007 Posts: 116
|
Bruce,
From what I've seen thus far these indicators are a very good match to the Chartmill signals. But I'll keep this in mind going forward.
Thanks again!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome. If you notice any issues, we can make the necessary adjustments.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |