Using FANN Neural Networks as MACD Signal Filters in MetaTrader
Summary
This article explains how to connect the Fast Artificial Neural Network library to MQL4 through a wrapper that hides C pointers and variable-length arguments from the trading platform. It outlines creating feedforward networks, training them incrementally, running inference, saving and loading models, and releasing network handles. Its practical example uses neural networks to filter signals generated by a MACD-based expert advisor, rather than presenting neural networks as a stand-alone forecasting method.
The author reports that filtering changed the example system from losing to profitable in the stated test, but the excerpt provides no detailed performance measures or enough information to assess generalization. The article itself cautions that price prediction may not provide a real trading advantage and labels the EA an illustration of library use. It also discloses an order-closing bug that distorted position handling; the corrected version removed that closing rule and reportedly changed the balance curve while leaving the overall comparison intact. These results are specific to the example and should not be taken as evidence that neural filtering will improve other strategies.
Key ideas
- FANN networks can be exposed to MQL4 through wrapper functions that replace unsupported pointers with integer handles.
- The described workflow creates a feedforward network, trains it with input and target vectors, and runs it to produce outputs.
- The example applies neural networks as a filter to MACD-generated trading signals.
- The author reports an improved test outcome after filtering but does not provide enough detail here to judge robustness.
- A disclosed order-management error affected the original example, limiting confidence in its reported balance curve.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.