Hi gary,
garyfritz wrote:Paul (or Neo or anybody else), I'm trying to understand the code in your indicators so I can re-implement them for some testing in Tradestation. I have a few questions... specifically about TMA, which I know you didn't develop, but hopefully you understand it well enough to clear up a few things.
welcome to the club...
garyfritz wrote:* TMA appears to be a simple weighted average -- (21 * Close[0] + 20 * Close[1] + ...) / (21 + 20 + ...) -- correct?
yep, it seems so...the value 20 is originally described as halfLength and is a external Parameter in the orig. TMA. I renamed it as tmaPeriod in my indicator.
garyfritz wrote:* The "if (jnx < shift)" code in calcTMA() makes no sense to me, on several counts: you sum into dblSum and dblSumw twice, and you sum values from "future" bars to the right of the "shift" bar. (E.g. if shift is 5, then the first time through the loop you sum bars 6 and 4, then 7 and 3, then 8 and 2, ...) To me that code seems wrong and should be removed. Am I missing something?
I had the same problems like you...

but i think that this has something to do with the repainting effect that we experience in the ordinary tma...since this sequence is not in the tmatrue calculations.
This sequence is only called as long as the jnx <= the shift value. jnx on the other hand <= tmaPeriod, which is 20, that is approximate bars that are repainted in tma and tmaslope. But it is only an assumption..

could also be related to the smoothing effect...
But the calculation is correct...you can also check in the tmaslope indicator from by nb 10.2...I also had a decompiled version of the Currency Slope Strength true...that was edited by zznbrm. it is correct as it is.
garyfritz wrote:* Why does the ATR calculation in GetSlope grab the ATR of 10 bars ago?
good question....next question...

only zznbrm can tell you this i think
garyfritz wrote:* The values I get (not using 10-bar-old ATR) are similar to your indicator's, but your results are smoother than mine -- see attached pic. (For some bizarre reason the magenta line I used for JPY is a barely-visible dark gray in this uploaded image, but it's there...) I would expect some jagged results without smoothing, but I don't see any smoothing in your code. Do you have some smoothing in there somewhere?
I would say that you first use the algorithm to the letter to get e a equal result to tma. And then experiment with atr and tmaPeriod and so on. The algorithm in baludas css and cssdiff is correct and is in sync with the original algo from zznbrm.
I don't know Tradestation...but it should be a much better development Platform than our Empty4.
garyfritz wrote:* For some reason my values are about 2.5x larger than yours. No idea why but I'll have to track it down.
I had same issues when i tried to regenerate the tmatrue and at the and i just had put an - instead of an + and the whole thing didn't line up...

I know you are a experienced programmer...but bugman is everywhere...an just wait s for his chance..
garyfritz wrote:Thanks!
You,re welcome...don't know if I could really help you, but was worth a shot...maybe baluga can add some more insight.
happy weekend,
NeoTrader
-