nanningbob » 30 Aug 2016, 20:17 wrote:Super CSS codes are now available to all. Basically changed iMA to 7 from 21, ATR from 100 to 50, and changed the T/F statements for individual currencies. There is a lot to play with so good luck.
Hi Bob & everybody contributing to this CSS indicator,
First of all thanks a lot for making your code publicly available!
I had a closer look at your changes applied to the causal part of function getSlope(). You stated that you modified LWMA(21) to LWMA(7). For TMA slope calculation, a modified LWMA is used: obviously, the final FIR coefficient is modified in order to emphasize the latest close price of the series.
Considering the original maPeriod = 21 and the additional weighting applied {231; 20; 251}, a generalized formula for emphasizing the latest close will lead to the factor
(2 * maPeriod - 1) / maPeriod. I must admit: this is kind of guesswork, trying to generalize the formula from just one known case, but I think that this was the original idea behind TMA.
When modifying to maPeriod = 7, you left the additional weighting untouched.
Was this done purposefully? Applying above formula to maPeriod = 7, the resulting set of additional weighting coefficients would be {28; 6; 34}.
In practice, this modification will have minor impact, because the behaviour of TMA slope calculation is most of all ruled by standard LWMA. But from a methodical point of view, a generalization might make sense.
I'll attach a code snippet with a modified function getSlope() featuring the above mentioned generalized formula. If you consider it useful, feel free to use it.
simplex
You do not have the required permissions to view the files attached to this post.
If you can't explain it simply, you don't understand it well enough. (Albert Einstein)
It appears that the Weighted Moving Average was invented by a trader who did not have a firm grasp of filter theory in hopes of reducing lag. (John F. Ehlers)