MA Angle Indicator
Hello,
I have created this indicator that shows on each candle the value of the "Angle" of the MA as used in CommunityPower
https://communitypowerea.com/docs/signals-and-filters#ma-filters
Doc:
- Buy on rising MA / Sell on falling MA:
- BUYs are allowed if the MA rises with a slope >= Angle
- SELLs are allowed if the MA falls with a slope >= Angle
Slope is calculated as (MA[1] - MA[2]), meaning that the MA should change by Angle points per bar to generate a signal
MT5:
Any improvements to the code, please share.
The indicator has an issue that does not "Refresh" when it is on a live chart, you have to press the "Refresh" button to show the value of the last candle. I don't know how to fix it, if anyone knows, can you help.
Check indexes here:
You need to calculate all the bars up to bar #0 and refresh it on every tick. With new bar arrived, you need update bar #1 and bar#0 again.
Look for example of indicators in mql5 codebase.