Skip to content
All library documents

Building a Trend Indicator with Fuzzy Membership Functions

Article MQL5 articles

Summary

The article explains how fuzzy membership functions can represent degrees of upward trend, flat conditions, and downward trend. It builds an indicator by comparing a short-period exponential moving average of typical price with the upper and lower boundaries of two Envelopes indicators. Each comparison produces a value from negative one to positive one, and the indicator averages the two values. Extreme outputs mark potential buy or sell signals; intermediate values are shown as a color-coded histogram.

The worked implementation describes indicator inputs, calculation buffers, signal markers, and recalculation of only the latest bar. It uses fixed envelope settings as examples and explains the resulting display, but provides no market test, performance statistics, or evidence that the signals are profitable. The membership boundaries and smoothing choices are design decisions that would need separate evaluation across instruments and conditions. The article is chiefly a construction tutorial and introduction to fuzzy logic, rather than a validated trading strategy.

Key ideas

  • Fuzzy membership functions assign gradual values between clearly defined trend states.
  • The example compares a fast moving average with two Envelopes ranges to estimate trend strength.
  • It averages the two fuzzy outputs and displays the result as a color-coded histogram.
  • Extreme positive or negative values trigger visual buy or sell markers in the example.
  • The article explains implementation but supplies no backtest or evidence of trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.