Swap Shield Auto Close And Reopen for Prop Firms
- Utilità
- Mostafa Mahmoud
- Versione: 1.11
- Aggiornato: 7 gennaio 2026
- Attivazioni: 5
The ultimate tool for Prop Firm traders. Automatically closes trades before weekends/swaps and reopens them later. Features spread protection, CSV crash recovery, and multi-schedule support.
Swap Shield is a professional utility designed specifically for traders dealing with Proprietary Trading Firms (Prop Firms) rules and those looking to avoid negative Swap fees.
Many Prop Firms strictly prohibit holding positions over the weekend. Failing to close trades can lead to the immediate loss of your funded account. Additionally, holding trades overnight often incurs significant Swap fees. Swap Shield solves these problems by automating the process of closing positions at specific scheduled times and reopening them automatically when the market resumes.
This is not just a simple script; it is a robust system that records your trades into a database (CSV files), ensuring that even if your terminal restarts or crashes between the Close and Reopen times, the EA remembers exactly what to reopen.
Key Features
-
Prop Firm Guardian: Avoid "Weekend Holding" violations by scheduling auto-closure minutes before the market closes.
-
Smart Multi-Scheduling: You are not limited to one time. The EA accepts unlimited schedule entries in a single field, allowing you to handle multiple days or specific times effortlessly.
-
Swap Avoider: Close trades just before the daily rollover (Swap time) and reopen them immediately after.
-
Smart Spread Protection: The EA monitors the spread when attempting to reopen. If the spread is too high (common at market open), it waits until spreads normalize to protect your entry price.
-
Crash Recovery System: Uses secure local files to store trade details (Lots, SL, TP, Comment). If the VPS reboots, the EA reads the file and resumes its job.
-
Flexible Filtering: Choose to manage ALL trades, specific Symbols, or specific Magic Numbers (including Manual trades).
How It Works
-
Schedule: You set closing and reopening times (e.g., Close Friday 23:50, Reopen Monday 00:05).
-
Snapshot: When the close time arrives, the EA saves all open trade details (Symbol, Type, Volume, StopLoss, TakeProfit) to a file.
-
Close: The EA closes the specified positions.
-
Wait & Reopen: At the reopen time, the EA checks the market conditions (Spread). If safe, it reopens the positions with the same parameters.
Input Parameters Guide
Please read the settings carefully to configure the EA according to your broker's time and rules.
1. Trade Selection Settings
-
Expert_Enabled: Master switch to enable/disable the EA.
-
Positions_Type: Choose which positions to handle (BUYs only, SELLs only, or AllTypes).
-
ApplyToSymbol:
-
ChartSymbolOnly: Manages trades only for the symbol the EA is attached to.
-
AllSymbols: Manages trades for ALL symbols in the terminal (Use with caution).
-
WriteCustomSymbols: Manages a specific list of symbols (separated by semicolon, e.g., "EURUSD;GBPUSD").
-
-
ApplyToMagicNumber:
-
AnyMagicNumber: Manages all trades regardless of who opened them.
-
WriteMagicNumbers: Manages specific Magic Numbers defined in the next field.
-
-
MagicNumbers: Enter the IDs here separated by semicolon (e.g., "12345;998877"). Note: Use "0" to manage manual trades.
2. Execution & Protection
-
SlippageTicks: Maximum allowed slippage when closing/reopening.
-
DelayRetryOnError: Minutes to wait before retrying if an error occurs.
-
WaitSecondsBeforeExecution: Safety delay when initializing the EA.
-
ReOpenMaxSpreadTicks: Crucial Setting. The EA will NOT reopen trades if the current spread (in points) is higher than this value. This protects you from the massive spreads usually seen at market opening.
-
AvoidMaxSpreadWhenExceedMinutes: If the spread remains high for longer than this time (in minutes), the EA will force the reopen anyway to ensure you don't miss the move.
3. Smart Scheduling System
-
Time Settings (time_type, dst_region...): It is highly recommended to leave these at default (TIME_SERVER) to rely on your broker's server time. This ensures synchronization with the market watch.
-
Close_Positions_As_Scheduled: Enable to activate auto-closing.
-
close_positions_schedule: The trigger time. format Day=Hour:Minute .
-
Unlimited Schedules: You can add multiple times separated by a semicolon ; . The system is smart enough to parse and schedule them all.
-
Example (Weekend): Friday=23:30
-
Example (Daily Swap): Monday=23:55;Tuesday=23:55;Wednesday=23:55;Thursday=23:55
-
-
ReOpen_Positions_As_Scheduled: Enable to activate auto-reopening.
-
reopen_positions_schedule: The trigger time. Same format as closing.
-
Example: Monday=00:05 (Reopens trades Monday shortly after market open).
-
-
Expire_CloseSchedule_mins: If the EA is started X minutes after the scheduled close time, it will ignore the close command (safety feature).
-
Expire_ReOpenSchedule_mins: Validity period for the reopen command.
Advanced Usage & Multi-Chart Setup
Can I use it on multiple charts?
Yes. The EA creates unique data files based on your "Symbols" and "Magic Numbers" selection.
-
Scenario A: Attach to EURUSD chart, select "ChartSymbolOnly". It will manage EURUSD only.
-
Scenario B: Attach to another chart (e.g., GBPUSD), select "ChartSymbolOnly". It will manage GBPUSD separately with its own schedule.
-
Important: Do not attach the EA to two charts that target the same symbol and same magic numbers, as they will conflict.
Requirements
-
Algo Trading: Must be enabled in your terminal.
-
VPS: Recommended to ensure the EA is running at the scheduled times.
Disclaimer
Always test the EA and your schedule settings on a Demo Account first to confirm that the "Server Time" matches your expectations and that the spread protection settings are suitable for your broker.
