Skip to content
All library documents

Building Mamdani and Sugeno Fuzzy Inference Models in MQL4

Article MQL5 code base

Summary

This document explains how to build fuzzy inference systems in MQL4 with the FuzzyNet library. It covers Mamdani and Sugeno model types, fuzzy input and output variables, membership functions, terms, and rule sets. Mamdani rules map fuzzy conditions to fuzzy conclusions, while Sugeno outputs use functions, including linear functions whose coefficients correspond to input variables and optionally a constant term.

For Mamdani systems, the stated defaults use minimum implication, maximum aggregation, and center-of-gravity defuzzification; the library also allows configuration before calculation. The guide walks through defining model components, parsing and registering rules, passing input values, and reading outputs. It lists the library’s membership functions and includes example applications for tipping and cruise control. These examples demonstrate general fuzzy-modeling mechanics rather than trading strategies or evidence of trading performance. The material is primarily an implementation guide, so it does not discuss market data, validation, or how to design rules for a trading system.

Key ideas

  • FuzzyNet supports both Mamdani and Sugeno inference systems in MQL4.
  • A fuzzy model requires input and output variables, terms or functions, membership functions, and rules.
  • Mamdani systems use configurable implication, aggregation, and defuzzification, with stated defaults of minimum, maximum, and center of gravity.
  • Sugeno output functions use coefficients ordered to match the model’s input variables, with an optional constant term.
  • The examples illustrate general fuzzy modeling and do not provide trading rules or performance evidence.

Tags

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