MESA Adaptive Moving Average - Improved MTF

This indicator is a huge upgrade to my original MTF MESA

Plots are now extremely smooth and accurate on all timeframes **
Missing data points are automatically filled with the "best fit"

This is a Trend indicator and should be used to trade "top-down" aka:
  • Start with the Daily chart to confirm a trend
  • Move to 4H
  • 2H
  • Etc...

Use your favorite entry method or simply watch for wicks forming when the price gets near the MESA adaptive moving average .
This is one of the few indicators that I've been using for years with success. Being able to plot both the current & higher timeframe MESA
can sometimes feel like cheating.

Due to the nature of the recursive calculation, you may notice slight differences between this version of MESA and others that either
approximate higher timeframes with fewer samples or make use of the latest "Resolution" argument in Pinescript V4. Both of which are
fine, until you start looking at M5 charts while plotting the Daily MESA.

As always, happy trading!

** Currently supports
M 1,3,5,15,30,45
H 1,2,3,4
Day 1
Week 1
Month 1
เอกสารเผยแพร่: Improved large MT4 differences. For instance, an M15 chart with the Daily MESA had errors that increased the further back you scroll.

จากใจ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ยินดีด้วย! คุณสามารถใช้มันได้ฟรี แต่การใช้โค๊ดนี้ซ้ำเพื่อการเผยเเพร่ อยู่ภายใต้ กฎของเรา คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้กับชาร์ตได้



I'm impressed you managed to do MTF thing, TV is not that friendly for that stuff.lmao
+1 ตอบกลับ
EmpiricalFX Pratik_4Clover
@Pratik_4Clover, No, no it is not lol. Thanks for recognizing that haha
+3 ตอบกลับ
Just one question. Aren't you using the phase of the lower timeframe to calculate both the mama's of the lower and the higher timeframes?
EmpiricalFX sal157011
@sal157011, No. I am however scaling the phase of the lower timeframe to adjust appropriately.
sal157011 EmpiricalFX
@EmpiricalFX, Sorry, got confused with the fast and slow variables inside and outside the function getMESA which are not the same. Comparing the plot of the higher timeframe mama made with your study to the plot made with the original study using the security() function there are discrepancies, specially when the higher timeframe is much higher than the lower, nevertheless your script is a great idea. Thank you for sharing.
EmpiricalFX sal157011
@sal157011, That's right - the original script is incorrect in it's MTF calculations so it makes sense that the plots would look different. By using security(), gaps in data are automatically merged which is essentially feeding the same number multiple times to the getMESA() function. The function doesn't know that these values are only repeated for the sake of filling gaps and uses them in the algorithm.

If I use the Resolution tag in my study() call, then I wouldn't be able to show both time frames at once.

I compared the MTF plot to the "true" higher timeframe plot in my testing and noted that the differences exist, but tend to be small.
sal157011 EmpiricalFX
@EmpiricalFX, Very well explained. Is it possible to input fast and slow as parameters? I like fast=0.50. Two higher timeframes instead of only one it would be better too.
I wonder if this MTF method could also be applied to John Ehlers "Hilbert Sine Wave" !