Astra Pact V24
- Experts
- Versão: 24.1
- Ativações: 5
Astra Pact V24
Astra Pact V24 is an Expert Advisor for gold (XAUUSD) that trades intraday range breakouts in the direction of the H4 trend. It runs six independent time windows. Each window measures the price range of its own part of the trading day and enters on the first M15 close beyond that range, only when the higher-timeframe trend agrees. Every window manages its own small basket (up to three positions), which is closed as a whole at a common target, with a basket stop expressed as a fixed percentage of the balance.
How it works
- Six windows (server time): B1 00-06, B2 02-08, B3 01-09, B4 04-10, B5 02-12, B6 00-14. Each window can open at most one basket per day, between the end of its range and its last entry hour.
- Range filter: the range must be between 0.12% and 1.30% of the price, so that very quiet and very wild sessions are skipped.
- Trend filter (H4, closed candle): for buys, EMA 50 above EMA 200, close above EMA 200, EMA 200 rising over the last 3 candles and ADX(14) at least 20; the mirror conditions for sells. A breakout against the trend is ignored.
- Basket: if the price moves against the first position by one grid step (the larger of 40 pips and half of the H1 ATR, x1.2 for the following step), the basket can add a second and then a third position with lot x1.3, only after an M15 candle closes in the basket direction. All positions share the same target and the same stop.
- Target: 0.7 x H1 ATR from the average price (at least 20 pips). With three positions the target moves to breakeven plus 3 pips.
- Exits are placed on the server as TP and SL of every position, so open baskets stay protected even if the terminal is offline.
Risk management
- Basket stop: the loss of a basket is limited to 2% of the balance (adjustable), however many positions it holds. Adding a level moves the stop closer in price; it does not increase the money at risk.
- Lot size: auto lot of 0.01 lot per 2,000 / 1,000 / 600 / 400 / 300 of balance (Very Low to Very High), fixed lot, or fixed lot per balance step. The lot is reduced automatically when the H1 ATR exceeds 0.30% of the price.
- Minimum-lot check: if the minimum lot would put the basket stop closer than one H1 ATR, the entry is skipped. This protects small accounts.
- At most three baskets at the same time (adjustable).
- Account protection: close all baskets at 30% floating drawdown (percent or money), optional daily loss limit.
- Calendar: no new entries on NFP day, a pause from 15 December to 15 January, no entries on Friday after 22:00, selectable trading days and hours, maximum spread and slippage.
- News filter: NFP, CPI and FOMC from the MetaTrader economic calendar (60 minutes before, 30 minutes after). A built-in date table is used in the Strategy Tester.
- No DLLs and no web requests.
Disclosure
Astra Pact V24 uses a limited averaging grid: up to three positions per basket with an increasing lot (x1.3). It is not an unlimited martingale, but a losing basket closes with a loss of up to 2% of the balance, and several baskets can lose on the same day. On most days the EA does not trade at all: it waits for a range breakout that agrees with the H4 trend.
Backtest results
Strategy Tester, MetaQuotes-Demo history, 1-minute OHLC model, default settings, deposit 10,000 USD, leverage 1:100, no commission.
- April 2024 - October 2026: net profit +265%, profit factor 1.35, maximum equity drawdown 29.9%, 1,840 trades, 74.7% winning trades.
- January 2020 - October 2026: net profit +138%, profit factor 1.17, maximum equity drawdown 45.1%. 2020 (-25.9%) and 2022 (-19.4%) were losing years. The strategy works best when gold is trending; in ranging markets the results are flat or negative.
Past results do not guarantee future results.
Recommendations
- Symbol: XAUUSD (gold), any chart timeframe (the EA uses M15, H1 and H4 internally). Attach it to one chart only.
- Account: hedging recommended. On netting accounts the EA uses one basket at a time.
- Balance: at least about 2,000 USD (or the equivalent) with the default Very Low risk. With smaller balances the EA skips most entries by design.
- Leverage: 1:20 or higher. The lot size does not depend on the leverage; a low leverage only limits how many levels fit in the margin.
- A low-spread broker and a VPS are recommended. Start on a demo account.
Order comments and journal
Each order carries a short code such as "AP24 B4L2 04-10 T94 S75 A106": window B4, level 2, range 04-10 server time, target 94 pips and stop 75 pips away from this entry, H1 ATR 106 pips (1 pip = 0.10 USD). Every opening and closing is described in full in the Experts log and saved to MQL5\Files\AstraPact_journal.csv.
Main input parameters
- General: magic number base, order comment prefix, allowed direction, maximum baskets at the same time.
- Money management: lot mode, risk level, fixed lot, lot per balance step, maximum lot, volatility adjustment, minimum stop distance in ATR.
- Basket and grid: grid step, ATR multiplier, step expansion, lot multiplier, maximum positions per basket, one level per bar, confirmation candle, pause after a close, target, breakeven level, basket stop in %, time limit, commission, server stops.
- Trend filter: timeframe, fast and slow EMA, slope, minimum ADX.
- Breakout windows: breakout candle timeframe, minimum and maximum range width, breakout buffer and, for each window B1-B6: enabled, range start, range end, last entry hour.
- Protection: maximum drawdown mode and value, pause after the close, daily loss limit, maximum spread and slippage.
- Calendar filters and news: trading days and hours, NFP day, year-end pause, Friday cut-off and close, news filter settings, server time offset used in the tester.
- Chart and journal: status panel, chart lines, CSV journal.
Server time
The window hours refer to the broker server time. The defaults assume a server at GMT+2 in winter and GMT+3 in summer (New York close), which is common for gold. If your broker uses a different time zone, shift the window hours accordingly.
Support
Questions and help with the set-up through private messages on MQL5.
