5.5 KiB
QuantPulse is a specialized Expert Advisor for MetaTrader 5 designed to automate trading around high-impact economic news releases. It strategically places a trade moments before a scheduled event and manages it using a volatility-based approach derived from the Average True Range (ATR) indicator.
The core feature of this EA is its powerful dynamic risk management system, which calculates position sizes automatically based on your precise risk tolerance, ensuring you never risk more than you intend.
Key Features
- Automated Event-Based Entry: Set the date and time of a news event, and the EA will open a position seconds before the release.
- Dynamic Risk Management: Automatically calculates the correct lot size based on your defined maximum drawdown and risk-per-trade settings. No more manual calculations.
- Volatility-Based SL/TP: Stop Loss and Take Profit levels are not fixed; they are dynamically calculated using the market's volatility (ATR) at the time of the trade, adapting to current conditions.
- Two Trading Modes:
- Pyramid Trading: Adds to a winning position to maximize profits while moving the stop loss of previous trades to breakeven.
- Trailing Stop: Once the initial take profit level is reached, the EA trails the price using an ATR-based stop to lock in profits while letting the winner run.
- Customizable: Fully configurable parameters to tailor the EA to your specific strategy and risk profile.
Input Parameters
Event & Time Settings
NewsDate (YYYY.MM.DD): The date of the economic event.NewsTime (HH:MM:SS): The time of the event. The EA will open its trade just before this time.TimeBeforeNews (HH:MM:SS:mmm): How long before the event to place the trade (Hours:Minutes:Seconds:Milliseconds). Default is 2 seconds (00:00:02:000).UniqueChartID: A unique name if you run the EA on multiple charts with the same symbol. This prevents one instance from interfering with another.
Risk Management Settings
MaxDrawdownPercent: The maximum percentage of your total account balance you are willing to risk. This sets your total "risk capital."- Example: If your account is $10,000 and you set this to
10.0, your maximum drawdown is $1,000. The EA will base its risk calculations on this amount.
- Example: If your account is $10,000 and you set this to
RiskPerTradePercent: The percentage of theMaxDrawdownAmountyou want to risk on a single trade.- Example: Continuing the above, if you set
RiskPerTradePercentto5.0, the EA will calculate the lot size so that the stop loss for one trade is equal to 5% of $1,000, which is $50.
- Example: Continuing the above, if you set
Trade Logic Settings
OrderType: ChooseORDER_TYPE_BUYfor a long position orORDER_TYPE_SELLfor a short position.ATRFactor: A multiplier for the ATR value to calculate the "Volatility Unit." A higher factor results in a wider stop loss. A value of1.5means the initial stop distance is 150% of the current ATR.VolatilityUnitMultiple: A multiplier for the Volatility Unit to set the final stop loss distance. Default is1.0.RiskRewardRatio: The ratio of take profit to stop loss. A value of2.0means the take profit distance will be twice the stop loss distance.
Position Management Settings
UseTrailingStop:true: Activates the ATR-based trailing stop mode once the initial take profit is hit. Disables pyramid logic.false: Uses the pyramid trading logic.
MaxTrades: The maximum number of positions to open in the pyramid ifUseTrailingStopisfalse.TrailingStopATRFactor: ATR multiplier used to determine the distance of the trailing stop. Only active ifUseTrailingStopistrue.
How It Works: The Logic Explained
-
Risk Calculation: Before anything else, the EA determines your risk for the next trade in your account currency (e.g., USD).
Max Drawdown Amount = Account Balance * (MaxDrawdownPercent / 100)Stop Loss Amount ($) = Max Drawdown Amount * (RiskPerTradePercent / 100)- This
$ amountis the exact loss you will incur if your stop loss is triggered.
-
Stop Loss Distance: Just before the trade is placed, the EA measures the current market volatility using ATR.
Stop Loss Distance (in points) = (Current ATR * ATRFactor) + Spread- This determines how far away the stop loss price will be from the entry price.
-
Automatic Position Sizing: This is the key. The EA connects the risk amount ($) with the stop loss distance (points) to calculate the perfect lot size.
Lot Size = Stop Loss Amount ($) / (Stop Loss Distance * Value per Point)- The result is a position sized precisely so that a move to your stop loss equals your predefined risk.
-
Trade Execution: At the specified time before the news, the EA opens the trade with the calculated lot size, stop loss, and take profit.
How to Use
- Open the chart of the asset you want to trade (e.g., EURUSD).
- Attach the QuantPulse to the chart.
- In the
Inputstab, configure all the parameters, especially theNewsDate,NewsTime, and your desiredMaxDrawdownPercentandRiskPerTradePercent. - Ensure "Algo Trading" is enabled in your terminal.
- The EA will display the calculated risk in the top-left corner of the chart and wait for the event time to execute.
Disclaimer: Trading news events is inherently risky. Past performance is not indicative of future results. Use this tool responsibly and at your own risk. It is highly recommended to test the EA on a demo account before using it on a live account.