Platinum Customer
Joined: 1/30/2005 Posts: 135
|
I translated Diceman TTM momentum to SF as follows. Does not seem to match TC2000 V17.
Do I have an error?
plot = price.AVGC(20) - ((price.MovingAverage(20).MAXHigh(20) _
+ price.MovingAverage(20).MINLow(20)) / 2 _
+ price.ExponentialAverage(20).AVGC(20)) / 2 _
+ 9.5 * (9.5 * (price.CLOSE - ((price.MAXHIGH(20) + price.MINLOW(20)) / 2 + price.XAVGC(20)) / 2) _
+ 8.5 * (price.Close(1) - ((price.MAXHigh(20, 1) + price.MINLow(20, 1)) / 2 + price.XAVGC(20, 1)) / 2) _
+ 7.5 * (price.Close(2) - ((price.MAXHigh(20, 2) + price.MINLow(20, 2)) / 2 + price.XAVGC(20, 2)) / 2) _
+ 6.5 * (price.Close(3) - ((price.MAXHigh(20, 3) + price.MINLow(20, 3)) / 2 + price.XAVGC(20, 3)) / 2) _
+ 5.5 * (price.Close(4) - ((price.MAXHigh(20, 4) + price.MINLow(20, 4)) / 2 + price.XAVGC(20, 4)) / 2) _
+ 4.5 * (price.Close(5) - ((price.MAXHigh(20, 5) + price.MINLow(20, 5)) / 2 + price.XAVGC(20, 5)) / 2) _
+ 3.5 * (price.Close(6) - ((price.MAXHigh(20, 6) + price.MINLow(20, 6)) / 2 + price.XAVGC(20, 6)) / 2) _
+ 2.5 * (price.Close(7) - ((price.MAXHigh(20, 7) + price.MINLow(20, 7)) / 2 + price.XAVGC(20, 7)) / 2) _
+ 1.5 * (price.Close(8) - ((price.MAXHigh(20, 8) + price.MINLow(20, 8)) / 2 + price.XAVGC(20, 8)) / 2) _
+ .5 * (price.Close(9) - ((price.MAXHigh(20, 9) + price.MINLow(20, 9)) / 2 + price.XAVGC(20, 9)) / 2) _
- .5 * (price.Close(10) - ((price.MAXHigh(20, 10) + price.MINLow(20, 10)) / 2 + price.XAVGC(20, 10)) / 2) _
- 1.5 * (price.Close(11) - ((price.MAXHigh(20, 11) + price.MINLow(20, 11)) / 2 + price.XAVGC(20, 11)) / 2) _
- 2.5 * (price.Close(12) - ((price.MAXHigh(20, 12) + price.MINLow(20, 12)) / 2 + price.XAVGC(20, 12)) / 2) _
- 3.5 * (price.Close(13) - ((price.MAXHigh(20, 13) + price.MINLow(20, 13)) / 2 + price.XAVGC(20, 13)) / 2) _
- 4.5 * (price.Close(14) - ((price.MAXHigh(20, 14) + price.MINLow(20, 14)) / 2 + price.XAVGC(20, 14)) / 2) _
- 5.5 * (price.Close(15) - ((price.MAXHigh(20, 15) + price.MINLow(20, 15)) / 2 + price.XAVGC(20, 15)) / 2) _
- 6.5 * (price.Close(16) - ((price.MAXHigh(20, 16) + price.MINLow(20, 16)) / 2 + price.XAVGC(20, 16)) / 2) _
- 7.5 * (price.Close(17) - ((price.MAXHigh(20, 17) + price.MINLow(20, 17)) / 2 + price.XAVGC(20, 17)) / 2) _
- 8.5 * (price.Close(18) - ((price.MAXHigh(20, 18) + price.MINLow(20, 18)) / 2 + price.XAVGC(20, 18)) / 2) _
- 9.5 * (price.Close(19) - ((price.MAXHigh(20, 19) + price.MINLow(20, 19)) / 2 + price.XAVGC(20, 19)) / 2) ) / 665
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I think the issue is that you are taking the maxhigh and minlow of the moving average instead of the moving average of the maxhigh and minlow.
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:TTM Momentum
'|******************************************************************
Plot = (13 * (price.CLOSE - ((price.MAXHIGH(20) + price.MINLOW(20)) / 2 + price.XAVGC(20)) / 2) _
+ 12 * (price.Close(1) - ((price.MAXHigh(20, 1) + price.MINLow(20, 1)) / 2 + price.XAVGC(20, 1)) / 2) _
+ 11 * (price.Close(2) - ((price.MAXHigh(20, 2) + price.MINLow(20, 2)) / 2 + price.XAVGC(20, 2)) / 2) _
+ 10 * (price.Close(3) - ((price.MAXHigh(20, 3) + price.MINLow(20, 3)) / 2 + price.XAVGC(20, 3)) / 2) _
+ 9 * (price.Close(4) - ((price.MAXHigh(20, 4) + price.MINLow(20, 4)) / 2 + price.XAVGC(20, 4)) / 2) _
+ 8 * (price.Close(5) - ((price.MAXHigh(20, 5) + price.MINLow(20, 5)) / 2 + price.XAVGC(20, 5)) / 2) _
+ 7 * (price.Close(6) - ((price.MAXHigh(20, 6) + price.MINLow(20, 6)) / 2 + price.XAVGC(20, 6)) / 2) _
+ 6 * (price.Close(7) - ((price.MAXHigh(20, 7) + price.MINLow(20, 7)) / 2 + price.XAVGC(20, 7)) / 2) _
+ 5 * (price.Close(8) - ((price.MAXHigh(20, 8) + price.MINLow(20, 8)) / 2 + price.XAVGC(20, 8)) / 2) _
+ 4 * (price.Close(9) - ((price.MAXHigh(20, 9) + price.MINLow(20, 9)) / 2 + price.XAVGC(20, 9)) / 2) _
+ 3 * (price.Close(10) - ((price.MAXHigh(20, 10) + price.MINLow(20, 10)) / 2 + price.XAVGC(20, 10)) / 2) _
+ 2 * (price.Close(11) - ((price.MAXHigh(20, 11) + price.MINLow(20, 11)) / 2 + price.XAVGC(20, 11)) / 2) _
+ (price.Close(12) - ((price.MAXHigh(20, 12) + price.MINLow(20, 12)) / 2 + price.XAVGC(20, 12)) / 2) _
- (price.Close(14) - ((price.MAXHigh(20, 14) + price.MINLow(20, 14)) / 2 + price.XAVGC(20, 14)) / 2) _
- 2 * (price.Close(15) - ((price.MAXHigh(20, 15) + price.MINLow(20, 15)) / 2 + price.XAVGC(20, 15)) / 2) _
- 3 * (price.Close(16) - ((price.MAXHigh(20, 16) + price.MINLow(20, 16)) / 2 + price.XAVGC(20, 16)) / 2) _
- 4 * (price.Close(17) - ((price.MAXHigh(20, 17) + price.MINLow(20, 17)) / 2 + price.XAVGC(20, 17)) / 2) _
- 5 * (price.Close(18) - ((price.MAXHigh(20, 18) + price.MINLow(20, 18)) / 2 + price.XAVGC(20, 18)) / 2) _
- 6 * (price.Close(19) - ((price.MAXHigh(20, 19) + price.MINLow(20, 19)) / 2 + price.XAVGC(20, 19)) / 2)) / 70
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Platinum Customer
Joined: 1/30/2005 Posts: 135
|
Works great. Matches TC and TOS.
Thanks for your help
|