Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Scripts

Neural Loss-Pattern Auditor - script for MetaTrader 5

Real Author
Published by:
Cristian David Castillo Arrieta
Cristian David Castillo Arrieta
Finance and International Business professional with a specialization in Financial Management. Self-taught MQL5 and Python developer focused on algorithmic trading, multi-asset portfolio construction, and quantitative risk management.
Views:
161
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance



Aggregate statistics such as win rate or profit factor cannot show whether the probability of a loss depends on what a trader just did, such as sizing up right after a previous loss. Neural Loss-Pattern Auditor tests for exactly that kind of behavioral pattern, directly on the trader's own trade history.

The main script builds an eight-feature dataset per closed deal and prints a full diagnostic report to the Experts tab:

  • Accuracy uplift — the trained network's validation accuracy against the accuracy of always guessing the majority class.
  • Calibration table — each probability bin's average prediction against the actual observed loss frequency in that bin.
  • Permutation feature importance — which of the eight features the network actually relies on, ranked by the accuracy drop when that column is shuffled.
  • A composite score (A to F) combining the three diagnostics, with written recommendations.

Input. With the default InpUseDemoData=true, the script generates 480 synthetic closing deals with a known injected pattern (larger position size right after a loss) and analyzes those, so the output is visible immediately. Set InpUseDemoData=false to read real closed-deal history instead, through HistorySelect() and the HistoryDealGet*() functions; no file or CSV is needed in this mode.

Parameters. InpMinTrades sets the minimum closed trades required before training; InpValidationFraction sets how much of the most recent history is held out for validation; InpHiddenNeurons, InpLearningRate, and InpEpochs control the network; InpCalibrationBins and InpPermutationRepeats control the two diagnostics; and InpWeightUplift, InpWeightCalibration, InpWeightTopFeature plus the three *Scale and four Grade inputs control the composite score.

The tool is written in pure MQL5. It needs no external libraries, no Python, and no AI service of any kind. A full description of the method, the math behind each diagnostic, and the code is available in the article: [ARTICLE_URL].

Fair Value Gap Detector Indicator Fair Value Gap Detector Indicator

Detects 3-candle Fair Value Gaps (price imbalances) and draws them as boxes that extend live until price trades back through the gap. Detection runs only on fully closed bars, so gaps never flicker in and out as the current candle forms.

Interactive On-Chart Risk Management and Execution Panel Interactive On-Chart Risk Management and Execution Panel

An interactive GUI panel for MetaTrader 5 designed for manual traders and quant developers. It automates dynamic position sizing based on exact account equity risk percentage, features one-click order execution (Buy/Sell), instant BreakEven, Close All functionality, and continuous real-time Trailing Stop management.

MT5 View MT5 View

This allows mt5 chart to scroll like tradingview chart with auto button to reset

MACD Signals MACD Signals

Indicator edition for new platform.