Enhance Your Trading with a Custom Trend Estimator

Mike 2008.05.16 15:37 43 0 0
Attachments

Hey fellow traders! Today, I’m excited to share a handy trend estimator I’ve developed that tackles a common issue we face with traditional averaging methods. You know how regular averages can lag behind, only giving insights about events half the averaging period in the past? Well, this tool aims to change that!

How It Works

This trend estimator employs an algorithm similar to the one used in the MT STD channel. It fits a straight line over a fixed number of periods and provides the latest point along with two deviation channels. The width of these channels can be adjusted based on your preferences. Pretty neat, right?

Important Notes

  • New to MQL4: I’m still learning the ropes of MQL4 programming (though I have some background in programming), so I’m open to feedback! If you spot any code errors or have suggestions for optimization, please let me know, and I’ll make the necessary changes.
  • Geometric vs. Linear Averaging: I prefer geometric averaging over linear averaging for its reduced sensitivity to outliers. However, you can switch this up in the function “get_avg” if that’s your jam.
  • Best Timeframes: From my experience, this estimator works like a charm on hourly charts over 5 days (120 points) or on 4-hour charts over 20 days (also 120 points).
  • Deviation Channels: Just a heads up, the deviation channels here aren’t standard channels. The deviations above and below the trend are calculated separately, and while I do my best, stats isn’t my strong suit, so they might not be perfect!

Happy trading, and I look forward to hearing your thoughts on this tool!

List
Comments 0