Skip to content
FXNook HubBeta

Alex / Break Even and Partial Close Manager for MT4

MetaTrader 4Expert AdvisorMITCompiled · build 2425
Compile logCompiled
MetaEditor build 2425 · MT4 · 1 Dec 2026, 10:19 UTCcompiling FXN_BreakevenPartialManager.mq4✓ Result: 0 errors, 0 warnings, 3.7 soutput FXN_BreakevenPartialManager.ex4 · 21 KBsha256 e5f15c7626319452…9d022e9f

Files version 1.0

FileLinesSize
FXN_BreakevenPartialManager.mq432012 KB
FXN_BreakevenPartialManager.ex4 compiled by the Lab–21 KB
FXN_BreakevenPartialManager.mq4320 lines
//+------------------------------------------------------------------+//| FXN_BreakevenPartialManager.mq4                                  |//| FXNook Lab Hub starter library - MIT licence                     |//| https://lab.fxnook.com/hub                                       |//+------------------------------------------------------------------+#property copyright "FXNook Lab (MIT licence)"#property link      "https://lab.fxnook.com/hub"#property version   "1.00"#property description "Moves the stop to break-even plus a few locked points and can close part of the trade at a profit in points or R."#property strict//--- which trades the manager looks afterenum ENUM_FXN_SCOPE  {   SCOPE_ALL    = 0, // All trades on this symbol   SCOPE_MAGIC  = 1, // Only trades with the magic number below   SCOPE_MANUAL = 2  // Only manual trades (magic 0)  };//--- how the partial close trigger is measuredenum ENUM_FXN_PARTIAL  {   PARTIAL_POINTS = 0, // Profit in points   PARTIAL_R      = 1  // Profit in R (multiples of the first stop distance)  };sinput string          InpGroup1         = "=== Which trades ===";   // ===== Which trades =====input ENUM_FXN_SCOPE   InpScope          = SCOPE_ALL;                // Trades to manageinput int              InpMagic          = 0;                        // Magic number (used with "Only trades with the magic number")sinput string          InpGroup2         = "=== Break-even ===";     // ===== Break-even =====input bool             InpUseBreakEven   = true;                     // Move the stop to break-eveninput int              InpBeTrigger      = 150;                      // Profit in points that triggers the moveinput int              InpBeLock         = 10;                       // Points of profit to lock beyond the entry pricesinput string          InpGroup3         = "=== Partial close ===";  // ===== Partial close =====input bool             InpUsePartial     = true;                     // Close part of the trade onceinput double           InpPartialPercent = 50.0;                     // Percent of the volume to closeinput ENUM_FXN_PARTIAL InpPartialMode    = PARTIAL_POINTS;           // Trigger measured in points or Rinput int              InpPartialPoints  = 200;                      // Points mode: profit in points that triggers the close
Sign in to read all the code and download it

It is free. A free account lets you see every line, copy it, download the source and open a copy in your Lab. The compiled file can be downloaded without an account.

Sign in Create a free account

Version history

  1. Version 1.0Live1 Dec 2026

    First version.

    Source · Compiled