MTC Neural network plus MACD
Download scriptThis script is an automated trading system (Expert Advisor) designed for the MetaTrader 5 platform. It combines traditional technical analysis with a more advanced "Perceptron" logic—a simplified form of neural network processing—to make entry and exit decisions on financial markets.
Core Trading Logic
The system operates by combining two distinct types of data to decide whether to open a trade:
1. Technical Indicator Analysis (MACD) The script utilizes the Moving Average Convergence Divergence (MACD) indicator. It specifically looks for "crossovers"—moments where the MACD line and its signal line cross each other. These crossings are traditional signals used by traders to identify changes in momentum.
2. Neural Network Logic (Perceptron) Unlike standard bots that rely solely on indicators, this script uses a "Supervision" system based on three different Perceptrons (simplified neural networks).
- These perceptrons analyze price action over specific historical bars (defined by the user as
p1,p2, andp3). - They calculate weighted values based on the difference between current prices and historical opening prices.
- The "Supervision" logic acts as a filter: it checks the results of these networks to determine the overall market sentiment (Positive or Negative).
How Trades are Executed
The bot follows a strict set of conditions before interacting with the market:
- Combined Confirmation: A "Buy" order is only placed if the MACD indicates upward momentum and the Perceptron network confirms a positive sentiment. Conversely, a "Sell" order requires both the MACD to show downward momentum and the Perceptron network to confirm a negative sentiment.
- Dynamic Risk Management: The script features three different levels of risk management (Levels 1, 2, and 3). Depending on which Perceptron "passes" the check, the bot automatically adjusts its Take Profit and Stop Loss targets to match the specific settings provided for that level.
- Safety Checks: Before performing any action, the script verifies that:
- The trading account has "Automated Trading" enabled.
- The account is not in "Investor Mode" (read-only).
- The current price data is fresh and valid.
Operational Features
- Hedging Support: The script is specifically designed to run on accounts that allow hedging (holding multiple positions on the same symbol simultaneously).
- Anti-Duplicate Logic: It contains a check to ensure it doesn't open multiple positions for the same symbol at the same time, unless intended by the logic.
- Error Handling: If the bot encounters a connection issue or a price data failure, it includes a "Pause and Retry" mechanism that allows the system to wait briefly and attempt to resume trading automatically.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | M T C N e u r a l n e t w o r k p l u s M A C D ( b a r a b a s h k a k v n '