MQL5_Wizard_MACD_Parabolic_SAR
Download scriptThis automated trading script, designed for the MetaTrader 5 platform, is an Expert Advisor (EA) that combines multiple technical analysis tools to execute trades automatically. It uses a modular logic structure, meaning it pulls in various "components" to make decisions rather than relying on a single indicator.
Here is a breakdown of how the logic works in plain language:
Core Trading Mechanics
The script operates by monitoring market data and reacting to specific conditions. Its primary goal is to identify high-probability entries and exits based on three main pillars:
- Signal Generation: It uses a "Main Signal" object that handles the basic rules for opening and closing positions. This includes defining your target profit (Take Profit), your maximum loss (Stop Loss), and the specific price levels where actions should occur.
- Trend Filtering: To avoid trading against the market's momentum, the script applies two primary filters:
- MACD (Moving Average Convergence Divergence): This is used to analyze the strength and direction of a trend by comparing two moving averages. The script allows you to customize the "fast" and "slow" periods to suit different trading styles.
- Parabolic SAR: This is typically used to identify potential reversals in price. It acts as a secondary confirmation to ensure that the trade aligns with the current trajectory of the market.
Money Management & Safety
The script includes a dedicated money management module designed to handle your risk profile:
- Fixed Lot Trading: It allows you to set a specific volume (lot size) for every trade.
- Risk Percentages: You can define how much of your capital you wish to allocate to a specific trade, ensuring that the EA remains consistent with your financial goals.
Execution Flow
When you run this script, it follows a systematic "startup" sequence:
- Initialization: The script first checks if the trading environment is valid. If it cannot connect to the market or load its components, it will alert you and stop.
- Component Loading: It then builds itself by loading the MACD filter, the SAR filter, the money management rules, and the trade execution logic into a single cohesive unit.
- Real-Time Monitoring: Once active, it listens to every "tick" (every small price movement). It constantly compares the live price against its internal filters.
- Trade Action: Only when the MACD and Parabolic SAR indicators agree with the "Main Signal" requirements will the script execute a trade. It also manages "Trailing" logic, which is a way to adjust your exit points automatically as the market moves in your favor.
User Customization
The logic is highly flexible. Even though it follows a strict set of rules, it provides several "knobs" for you to turn:
- Sensitivity: You can adjust how fast or slow the MACD and SAR react to price changes.
- Thresholds: You can define exactly what percentage of a signal is required before the EA considers it "strong enough" to open a position.
- Expiration: You can set rules for how long a pending order should remain active before being cancelled.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | M Q L 5 W i z a r d M A C D P a r a b o l i c S A R . m q 5 |
/ / | C o p y r i g h t © 2 0 1 7 , V l a d i m i r K a r p u t o v |
/ / | h t t p : / / w m u a . r u / s l e s a r / |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "