TRX calculation works beautifully.
It also tracks position correctly (I believe). Now I must write R code