A signal to noise ratio. Returns the total delta for the period divided by the sum of each individual period's delta. Does not iterate, so can reasonably be used with CalculateOnBarClose == false. Might be known by other names, documented as 'Efficiency' in 'Smarter Trading' by Perry J. Kaufman. Version 1.0.
Returns the Pearson product-moment correlation coefficient of the input series. This requires iteration, so should probably be used with CalculateOnBarClose == true.
Version 2 - Solves a /0 error, returns 0 if price is unchanged for all of the bars in the calculation.
July 4th, 2010
Size: 2.52 KB
Downloaded: 212 times
529
fluxsmith
Maximum value seen in period. Should return the same values as the standard MAX, which as of b18 has been fixed to reduce iteration. With that fixed the only advantage this has over the standard is memory reduction when used as a component and not displayed. (Both versions are now efficient with CalculateOnBarClose == false.)
Version 2 - Corrected calculation errors when COBC == false && Input != High
July 4th, 2010
Size: 2.31 KB
Downloaded: 279 times
527
fluxsmith
Minimum value seen in period. Should return the same values as the standard MIN, which as of b18 has been fixed to reduce iteration. With that fixed the only advantage this has over the standard is memory reduction when used as a component and not displayed. (Both versions are now efficient with CalculateOnBarClose == false.)
Version 2 - Corrected calculation errors when COBC == false && Input != Low
July 4th, 2010
Size: 2.32 KB
Downloaded: 261 times
526
fluxsmith
R-Squared, Coefficient of Determination, the square of the Correlation Coefficient. This should return the same values as the standard supplied RSquared. Unfortunately both versions always iterate, so should probably be used with CalculateOnBarClose == true.
I believe my version to be slightly more CPU efficient, as it does not require a square root calculation used in the distribution version.
Version 1.0.
July 3rd, 2010
Size: 6.78 KB
Downloaded: 165 times
525
fluxsmith
Weighted Moving Average. Weighting is linear from 1 .. n. Should return the same values as the standard supplied WMA, but intended to be a reusable component. Additionally, the standard WMA always iterates, this does not iterate on intrabar data, making it more efficient with CalculateOnBarClose == false.
Version 2:
Defaults to CalculateOnBarClose = false
Updated with new JHL.Utility.MA
Faster calculation
Wikipedia calls this a 'Modified Moving Average'. Traders may know it as Welles Wilder's Moving Average, as it is the averaging method used in many of his indicators.
It's conceptually simpler than an EMA, the basic formula being:
average = (newValue + priorAverage * (n - 1)) / n
However, for any number of periods 'n', the outcome is identical to EMA(2 * n - 1). Since my basic indicators are all about efficient code reuse that is the implementation used here. Using the EMA formula is also slightly more CPU efficient than the formula above.