Skip to content
All library documents

Connecting NeuroSolutions Neural Networks to an MQL5 Expert Advisor

Article MQL5 articles

Summary

This tutorial explains a workflow for using a neural network trained in NeuroSolutions 5 from an MQL5 Expert Advisor. Its example strategy predicts a daily bar’s close at the bar’s opening, using OHLC data from five previous bars represented as changes relative to the current open. A script exports historical examples to a CSV file; a visual wizard builds and trains a network, which is then exported as a DLL with its learned weights.

Because the generated network interface uses complex C++ objects, the tutorial places a small C++ adapter DLL between it and MetaTrader. The adapter loads the network and weights, passes input values, and returns a forecast for the EA to use in a buy or sell decision. The article demonstrates testing on the same period used for training to check that the connection works, while explicitly warning that in-sample performance does not establish profitability on other periods. It supplies no forward-test evidence and focuses on integration, not on validating the example strategy’s predictive or trading edge.

Key ideas

  • Historical OHLC bars are exported as inputs and an output, with prices expressed relative to the current bar’s open.
  • A visual wizard is used to construct and train a network in NeuroSolutions 5.
  • A C++ adapter provides a simpler interface for an MQL5 EA to send inputs and receive the network output.
  • The example uses the forecast to choose a daily buy or sell position.
  • Testing on training data can confirm integration but cannot show that the strategy will work on unseen periods.

Tags

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