Trend Color MA
- Göstergeler
-
Ola Marten Hamberg
A guy from Sweden using this platform to exist, download indicators and EAs and vibe code my own and selling some of it for free. - Sürüm: 1.0
Trend Color MA is a free indicator for MetaTrader 5. It draws one moving average line on the chart and changes the colour of the line with the direction of the trend. The line is lime green in an uptrend and red in a downtrend, so the current direction can be seen at a glance.
How the indicator works
The indicator calculates a moving average and then decides the trend direction for each bar. Two methods are available:
Slope: the trend is up while the line is rising and down while the line is falling. When the line is flat, it keeps its previous colour.
Price: the trend is up when the bar closes above the line and down when the bar closes below the line.
By default the indicator uses an exponential moving average with a period of 21 and the slope method.
Features
- One moving average line coloured by trend direction.
- Sixteen calculation methods: Simple, Exponential, Smoothed, Linear Weighted, Double Exponential, Triple Exponential, Hull, Zero Lag Exponential, Triangular, Tillson T3, Arnaud Legoux, Linear Regression, Quadratic Regression, Kaufman Adaptive, Variable Index Dynamic and McGinley Dynamic.
- Choice of applied price: close, open, high, low, median, typical or weighted.
- Two trend methods: slope of the line or position of the price relative to the line.
- Adjustable colours and line width.
- Optional alert when the trend changes, with a message window and sound, push notification to the mobile terminal and email. The alert is sent once, when the bar that changed the trend has closed.
- Works on all symbols and timeframes.
Colour behaviour on the current bar
On closed bars the colour does not change. On the current bar the colour can change until the bar closes. Set the Shift parameter to 1 to use closed bars only.
Input parameters
- MA Mode: the calculation method of the moving average.
- MA period: the number of bars used in the calculation.
- Applied price: the price used for the calculation.
- Trend method: Slope or Price, as described above.
- Shift: 0 uses the current bar, 1 uses closed bars only.
- Uptrend colour: colour of the line in an uptrend. Default is lime green.
- Downtrend colour: colour of the line in a downtrend. Default is red.
- Line width: thickness of the line.
- Alert when the trend changes: turns trend change alerts on or off.
- Alert: shows a message window with sound.
- PushNotification: sends a notification to the mobile terminal.
- SendEmail: sends an email.
Use in Expert Advisors
The values can be read with the iCustom function. Buffer 0 holds the value of the moving average. Buffer 1 holds the colour index: 0 for uptrend and 1 for downtrend. Buffer 2 holds the trend direction: 1 for uptrend, -1 for downtrend and 0 before the first trend is known.
Notes
Push notifications and email must first be set up in the terminal under Tools, Options.
The indicator is an analysis tool and does not guarantee any trading result. Test the settings on your symbol and timeframe before using them in live trading.
