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.
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)..
A special class of filters which "warps" short data arrays to provide extremely responsive, but very smooth movement.
This indicator also includes coloring based on slope, alerts both audio and visual chart markers. All parameters are configurable and by changing the signal mode from between 1-4 you can make the alerts happen faster.
This works on all instruments, the buffer ticks (used to determine crossovers) are based on the instruments digits so ES one tick is 0.25 where as EURUSD would be .0001
(I commissioned this indicator and it is not copyrighted feel free to modify the code)
I use range and volume bars. Many times it takes an inordinate amount of time to build a bar but it isn't obvious unless you do some basic math to find out. So, I created this indicator that works on any chart that is not time based. Really if you think about it you don't need this indicator on a time based chart.
It has two parameters. One is used to declare the number of bars you want to use to calculate the average time per bar and is called "Period". The second parameter is called "MaxLevel" which is used to set the level that you consider to be the acceptable level. For example, I base everything on 5 minutes so my "MaxLevel" is set to 5. So, if the average time per bar plot is below the "MaxLevel" line, I consider the market to be moving in an acceptable manner. Anything over the "MaxLevel" line is considered too slow for trading.
That about covers it. Pretty simple stuff.
Good luck and I hope you find it useful. In fact, I'm curious if anyone actually finds it to be useful. Please let me know.
September 29th, 2013 10:35 AM mdl060374 very nice!
July 7th, 2011 03:53 PM gg80108 imported into 7 works good
April 25th, 2011 01:29 PM wireford Mike-
Thanks for all your hard work. Downloaded this from NT a year ago but never realized you had programmed it until I joine
d BMT.
Andy Crawford
June 7th, 2010 06:53 AM enriquec Thanks man !!! Great job .I was looking for that . I have some ideas about the aplication of this stuff .Maybe we will
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.