Loading…

Weekend Hold Decision Helper

Deciding whether to close a position before the weekend usually means eyeballing three numbers separately: "does this pair gap a lot", "what does the swap cost", and "how much profit do I have to lose". This script puts all three into one figure per open position instead. For each position it measures the symbol's own signed Friday-close to Monday-open gap, oldest sample onward on the daily chart, oriented to the position's own direction so a favourable historical gap shows as a positive number regardless of whether the position is long or short. It prices the coming weekend's triple-swap charge from the broker's own published swap figure - unit-decoded from points, base currency or annual interest percentage, the same conversion used elsewhere in this catalogue - rather than assuming a fixed cost. Added together, this is the projected weekend impact. If that projection is not negative, the recommendation is HOLD - the numbers do not argue for closing. If it is negative, the script checks whether the position's current floating profit provides enough cushion (a configurable fraction of it) to absorb the projected hit; only when the negative projection exceeds that cushion does it recommend closing or reducing before the weekend. Every recommendation prints its own reasoning line, and the historical sample size is flagged as low confidence when too small to trust, rather than presented with the same weight as a well-sampled one. This is a projection built from a limited historical sample, not a forecast - it states what the numbers say about that specific pair's past behaviour, nothing more. Notes and limitations - Requires enough daily history on each symbol to find Monday bars; symbols with too little D1 history are reported with "n/a" gap statistics rather than a guessed number. - The gap statistic assumes the immediately preceding daily bar to a Monday bar was the last trading session before it, which holds around ordinary weekends but can be thrown off by a holiday-shortened week. - Swap rates are read live from the broker at the moment the script runs and can change without notice before the actual weekend arrives. - This is a one-shot report, not a live monitor - re-run it as the weekend approaches for an up-to-date read. - Does not place any order or modify any position itself; it only reports a recommendation for the trader to act on.

Script · MT5 · v1.0 · Free

About Weekend Hold Decision Helper

Weekend Hold Decision Helper is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Magic filter, Weeks to analyze and Min samples. MQL source code included.

Files in the download: WeekendHoldDecisionHelper.ex5, WeekendHoldDecisionHelper.mq5, WeekendHoldDecisionHelper.txt.

Settings

SettingDefaultWhat it does
Magic filter00 = every open position, otherwise only this magic number
Weeks to analyze52How many Monday gaps back to measure per symbol
Min samples8Below this many usable gap samples, confidence is flagged LOW
Profit cushion fraction0.5Fraction of current floating profit allowed to absorb a negative projection before recommending CLOS

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria