All previous versions of the ADXVMA are based on a dirty transcript from MetaTrader which has a number of bugs, inconsistencies or variables that are not being used. This is just an attempt to clean up the mess and come up with a proper version. These are the changes:
Initialization: Most versions are initialized with a value of 0 instead of Input[0], this usually creates false values for the first 100 or 200 bars.
Redundant variables: The transscripts from MetaTrader use 4 different variables for the period, although it is always the same period. A variable used for the shift in MetaTrader is carried around, although it always has the value 0.
Inefficient algorithms: The indicator mostly uses Wilder's smoothing for calculating exponential averages from the positive and negative Momentum. The smoothing constant k is calculated once and applied to the various steps required for smoothing. Searching the highest and lowest value for the last n+1 period was hidden in a complex algorithm.
Input Series: The prior versions can only be applied to the close, this version also accepts other input series, such as the high, low or the typical price of the selected instrument.
Trendfilter: The indicator can best be used as a trendfilter. The trend state, which can be positive, negative and neutral, is exposed via an IntSeries, which can then be accessed by other indicators and strategies. The trend can also be shown via a paintbar option.
Update June 11, 2012: Trendfilter and colors modified to avoid frequent trend changes.
Update July 3, 2012: Serialization of display options changed. This will make it simpler to call the indicator from other indicators or strategies.
This strategy will buy/sell when the candle closes above or below the specified moving average. For example, if candle closes above the moving average line, a buy order is placed. If the candle closes below the moving average, a sell order is placed. The moving average length can be set in the strategy inputs. A simple using average is used if the Simple option in the strategy inputs is set to True. If false, the calculation is based on an exponential average.
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.
I´ve found this indicator in my TOS platform and translated to NT. It also has a LinReg option (set to true by default) to make it smoother, but it also works grate with out it... I´ve foud it grate to confirm mayor swings... look at the chart and good trading...
Ehlers Distant Coefficient Filter
vorol
In attempt to create a new kind of Moving Average with some friends/colleagues (because i was a little bit tired of the classical set of MA everybody's use for the last 10 years), we've created this new one (ALMA)..
The ALMA can give some excellent results if you take the time to tweak the parameters (don't need to explain this part, it will be easy for you to find the right setting in less than hour)..
March 23rd, 2012 02:31 AM jwdixon Thanks! great to have such control on a moving average of some kind, great work!
April 15th, 2010 08:35 PM greathopes Very smooth operator. Kind thank yous.
April 11th, 2010 11:01 PM Velocity hmmmm.... "can give some excellent results if you take the time to tweak the parameters " sounds like curve fitting.
March 23rd, 2010 01:05 PM Poocher This is better than Jurick for me just using the default settings on range bars.