TradingView
notjoebidness
Feb 15, 2022 8:39 AM

MTF Custom Moving Averages 

Bitcoin / U.S. dollarBitstamp

描述

This user-friendly indicator allows up to 8 moving averages ( EMA or SMA ) from any timeframe, on any time frame. There are plenty of other MTF MA indicators, each with their own pros and cons. I wanted to make one without the cons:

- Independently set each MA to Exponential or Simple
- No preset lengths
- No preset timeframes
- Optional labels to help keep track of the period/length/type of each plot
- Clean, intuitive input layout
- More than enough MAs available to use one indicator for several use cases... just check/uncheck the ones that are relevant to each chart

Watch for death crosses on the 4hr while monitoring the "Bull Market Support band" (Weekly 21 EMA and 20 SMA ) and checking the Monthly 10 EMA for major support or resistance. Toggle between half of the available MAs for long term BTC trends and use the others for your alts. Use this one indicator to support multiple strategies.

Please leave a comment if you find it useful or have suggestions!

Inspired by the first MTF indicator I found: Weekly Moving Average by TommyTompsen.

版本注释

Added multi-condition alerts. Set an alert to trigger when price moves above or below some or all of your customized MTFmoving averages.

Instructions: Right click any MTF Custom MA on your chart and choose "Add alert on MTF Custom MAs." The alert condition will default to "MTF Custom MAs." In the next drop-down you choose the trigger. For example, "Close above MA1-MA5" will trigger an alert only when price closes above your custom settings for M1 (10M EMA), M2 (21W EMA), M3 (21D EMA), M4 (20D SMA), & M5 (4hr 200 SMA). The frequency of alerts can be refined by selecting your desired timeframe before setting the alert and setting the alert to "Once per bar close."

To set alerts based on price crossing a single MA, change the alert condition to the ticker (example: BTCUSDT), then choose "Crossing," then choose the specific MA you want to track (example: MA3).

版本注释

v.04:
- Added optional fill between any two sequential MTF moving averages (finally!)
- Fill color follows the color of the dominant MA at crossovers
- Set fill transparency in settings
- Increased available MAs from 8 to 10
- Label color now follows the color of the MA
- Changed syntax to length-period-type (200 H EMA) to make the labels and status bar more readable

版本注释

Added optional timeframe override. See tooltip in Input Options menu under "Temporary Timeframe Override."
Added new logic for compound alerts based on multiple criteria. See tooltip in Input Options menu under "Compound Alerts" group and related comments on this page.

版本注释

03/11/2023 Corrected "above" to "below" in alert messages for three conditions: Close < MA1:MA8, Close < MA1:MA9, Close < MA1:MA10.
评论
HowardLee
awesome script, would be really nice to have other calculations such as HMA. Thank you for sharing your hard work!
sukiandkam
I just want to use 2 ema and 1 sma across all time frame, when I try to uncheck extra one it won't plot
Jrr7885
@sukiandkam, Did you check the boxes in Input and under style?
notjoebidness
@sukiandkam, Can you clarify what you mean by "trying to uncheck extra one?"
Jrr7885
Hi Joe I set an alert to tell me when price is greater than moving average 1-8 on the five minute time frame with only happen once but it never was triggered any to test alerts Thank You
notjoebidness
@Jrr7885, I just ran two alert tests on BTC 5 min chart, one for price closing above MA1-8 and the other for price closing below MA1-8. Both triggered. The only problem I noticed is the default message text says "closing above" even when the alert is set for closing below. I'll DM you to get the details of your test and see if I can re-create the issue.
Jrr7885
@notjoebidness, Hi Joe I had aud usd 5min chart with 8ema showing from 8hr, 1 day, 1 week, 15 min, 1hr, 4hr and a 3 and 8 ema same as chart , alert set to mtf custom , close > ma1:ma8 , trigger once only, thank you for checking this and getting back to me I'm gald it worked for you maybe I had something set wrong Thank you!
notjoebidness
@Jrr7885, I ran a few more close-above and close-below tests on the 5m timeframe using MA1:8 conditions set to timeframes as low as the 3(1-min) to 10(1-month). All alerts triggered on the 5 minute chart when all conditions were met. However, I did find that the alert messaging for condition "Close < MA1:MA8" incorrectly displayed "Price closing **above** MA1, MA2, MA3, MA4, MA5, MA6, MA7 & MA8 at {{timenow}}" when it should have read "Price closing **below**..." The same script error was present for alert-conditions "Close < MA1:MA9" and ""Close < MA1:MA10"." So I think the most likely explanation is that you accidentally picked lert condition "Close < MA1:MA8" but didn't notice when you were creating it because the alert message was saying "Price closing **above**" I've updated the script with corrections to the alert messages. Please DM me if you have this problem again, and include the security, alert condition, and settings for each MA used as a condition.
Ross-J-Burland
Would be great if the indi alerted to a crossover of the mas. i use 10 and 20 and would like to be alerted to when they touch or cross as currently, this indi only alerts to when price moves over one or the other emas...
Jrr7885
@Ross-J-Burland, I believe you can do that i cant attach a picture here but the top 2 boxes mtf (top left box) ma1 (top right box ) (middle box) crossing (bottom right box) mtf (bottom right box) ma 2
更多