Invalidation Line EA

SHORT DESCRIPTION
Hide your stop loss on the chart. The EA closes only after confirmed candle closes, not wicks.

FULL DESCRIPTION
Have you ever widened your stop to give a trade more room, only to be stopped out and watch price reverse? Most traders have. Widening a stop makes your risk-reward worse, and a stop that sits at an obvious level is easy to wick through.

Invalidation Line EA takes a different approach. Instead of a hard stop at the level, you draw a line where your trade idea is invalid. The EA watches that line and exits only when the breach is confirmed by candle closes, a time delay, or both. A quick wick through the line does not take you out.

HOW IT WORKS
1. Draw a horizontal line or trend line on the chart.
2. Name it with the prefix INV_ and add tokens to set the rules. Example: INV_Trend_H2_3_TIME6
   - H2 = confirm on H2 candles
   - 3 = three consecutive closes beyond the line
   - TIME6 = the breach must also last 6 hours
3. The EA monitors the line. If the confirmation rules are met, it closes the position. If price returns first, the breach resets.

KEY FEATURES
- Confirmation by candle closes, by time, or both, set separately for every line
- Supported timeframes: M1 to monthly (M1, M5, M15, M20, M30, H1, H2, H4, H6, H8, H12, D1, W1, MN)
- Works with horizontal lines and sloping trend lines
- Optional ATR buffer zone to filter out noise
- Direction filter per line (BUY or SELL tokens)
- Optional on-touch actions: INSTANT full close, move to breakeven (BE), or partial close (PARTIAL)
- Multi-chart mode: one EA instance can watch lines on all open charts
- Optional session filter
- Alerts: pop-up and push notification
- On-chart dashboard showing every line, its settings and its state
- Color-coded lines: watching, confirming, closed, offline, trading disabled
- Drag a line and its breach state resets automatically
- Breach progress is saved, so a terminal restart does not lose it. If price crossed the line while MT5 was closed, the EA reconstructs the breach from price history when it reopens
- Rename-aware: renaming a line keeps its age and progress when its confirmation rules are unchanged
- Retries a failed close with an alternative order filling mode
- Optional alert if price returns after a position is closed

IMPORTANT TO KNOW
- This EA manages exits only. It does not open trades and it does not predict price.
- The line is not a server-side stop. The EA must be running, connected and allowed to trade for it to act. If your PC, VPS or internet connection goes down, or AutoTrading is turned off, nothing is protecting the position. Many traders keep a wide emergency stop at the broker as a backup.
- Waiting for confirmation means the exit can happen at a worse price than the line, and in a fast move the loss can be larger than a hard stop would have allowed. Confirmation trades a smaller chance of being wicked out for a larger loss when a breach is real. Choose the settings with your own risk in mind.
- It acts on the open positions of the chart symbol. With no direction token, a line applies to any open position on that symbol.
- Results depend on your lines, your settings and the market. Nothing here is a profit promise or a guarantee of fewer stop-outs.

SETTINGS (all act as defaults for lines that have no tokens in their name)
- Confirmation: use candle closes, timeframe, number of closes, use time, hours to wait
- On-touch action, breakeven fallback, partial close percentage
- ATR buffer: on/off, timeframe, multiplier, period
- Session filter: on/off, start and end time (server time)
- Downtime recovery: late on-touch action if a line was touched while MT5 was closed
- Re-entry alert, pop-up and push alerts
- Dashboard: show/hide, corner, sort order

- Multi-chart mode


TOKEN NOTES (USAGE)

//|  NAME SYNTAX:                                                    |

//|    INV_[label]_[tokens...]                                       |

//|                                                                  |

//|  TOKENS (order-independent, case-insensitive):                   |

//|    INSTANT          → Full close on touch, no confirmation       |

//|    BE               → Move to Breakeven on touch                 |

//|    PARTIAL          → Partial close on touch                     |

//|    BUY              → Only watches BUY positions                 |

//|    SELL             → Only watches SELL positions                |

//|    M1/M5/M15/M20/M30 → UsePeriod=true, ConfirmPeriod=that TF     |

//|    H1/H2/H3/H4/H6/H8/H12 → UsePeriod=true, ConfirmPeriod=that TF |

//|    D1/W1/MN         → UsePeriod=true, ConfirmPeriod=that TF     |

//|    [1-9]            → RequiredCloses=that number                 |

//|    TIME[n]          → UseTime=true, WaitHours=n                  |

//|                                                                  |

//|  EXAMPLES:                                                       |

//|    INV_Soft_H4_2        wait 2xH4 closes (global touch action)  |

//|    INV_Hard_INSTANT     full close immediately on touch          |

//|    INV_Trend_H1_TIME4   1xH1 close AND 4h sustained breach      |

//|    INV_Entry_BE_D1      move to BE on touch, wait D1 confirm     |

//|    INV_Structure        uses all global EA input defaults        |

//|                                                                  |

//|  Prefix: INV_ or inv_                                            |

//|  Single-chart or multi-chart mode                                |

//|  Naming conflicts resolved via ChartID::ObjectName key           |

//|                                                                  |

//|  LINE STYLES:                                                    |

//|    WATCHING          : DodgerBlue, dashed                        |

//|    CONFIRMING        : Orange, dash-dot                          |

//|    CLOSED            : Red, solid                                |

//|    OFFLINE (EA gone) : Gray, dotted                              |

//|    TRADING DISABLED  : Yellow, dash-dot-dot                      |

//+------------------------------------------------------------------+


RECOMMENDATIONS
- Works on any symbol and any timeframe you can draw a line on.
- Run it on a VPS so it stays connected.
- Test on a demo account first and watch how the dashboard moves through WATCHING and CONFIRMING.
- Pick the confirmation timeframe from the structure you trade, for example H2 or H4 closes for swing trades.

Author: Ebuka Obiakor is an AI Product Manager and Business Analyst based in Calgary, Alberta, Canada. He holds an MBA, A-CSPO, and CBAP certifications. He is an independent retail trader with handson experience in MQL5 indicator and EA development.

Yazarın diğer ürünleri
True Move AD
Ebuka Francis Obiakor
True Move A/D The flow-level read. One line. Two combined signals. The standard Chaikin Accumulation/Distribution line uses a single factor — where the close sits within the bar's range. True Move A/D uses three, and weights them by their actual reliability. The composite formula: K = 0.3 × Midpoint Bias + 0.70 × Close-to-Close Direction The 70% weight on close-to-close momentum is deliberate. Where a candle closed relative to where it opened is the most consistent signal of genuine directiona
FREE
Close Open AD
Ebuka Francis Obiakor
Close-Open A/D (CO A/D): A Cumulative Volume-Efficiency Line for Accumulation/Distribution Analysis CO A/D is a cumulative Accumulation/Distribution-style indicator built around a simple question On-Balance Volume and Chaikin A/D don't directly ask: how efficiently did each bar convert its own volume into open-to-close travel? Formula CO_raw = (Close − Open) / (High − Low) Volume = Log(TickVolume + 1) [or raw volume — selectable] CO A/D = Previous CO A/D + (CO_raw × Volume) Where OBV assigns ful
FREE
Directional Impulse
Ebuka Francis Obiakor
Directional Impulse  One formula. Every candle. Instantly legible. Most indicators tell you where price is or how fast it's moving. Directional Impulse tells you something different: who won this candle, and by how much. Built on an original formula — X = (2C − H − L) × (H − L) & X = (C − O) x (H − L) — it multiplies directional bias by the bar's full range rather than normalising it away like every preceding indicator in this lineage. The result is a signed energy measure for each bar that ca
FREE
Equity Guard Dog: the guardrails your trading account is missing You’re probably not losing because you can’t read a chart. You’re losing because nothing stops you on the bad days: the oversized position, the third entry stacked on the same level, the revenge trade after a loss, the drawdown that creeps past the point you swore you’d stop. Equity Guard Dog is the discipline you wish you always had, running quietly on your MetaTrader 5 chart. It watches your entire account, enforces the rules you
BRIEF DESCRIPTION On-chart panel showing SL, TP, risk and RR for every position, with optional break-even and loss caps. FULL DESCRIPTION TradeMonitor puts all of your open positions and pending orders on one clean chart panel, so you can see exactly what you are risking and what you stand to make on every trade, in dollars. It does not open trades. It watches the trades you already have and, if you choose, helps protect them. SEE EVERY POSITION AT A GLANCE - Stop loss risk in account curren
Swap Checker
Ebuka Francis Obiakor
SHORT SUMMARY See the daily and weekly swap for every symbol you trade, Buy and Sell, in your account currency, before you hold a position overnight. ------------------------------------------------------------ DESCRIPTION ------------------------------------------------------------ Swap is easy to ignore when you open a trade and hard to ignore when it adds up. Swap Checker puts the overnight cost of holding, or the credit you earn, for every symbol you trade into one compact table on your c
FREE
Average Entry Price Lines draws one horizontal line at the volume-weighted average entry price of your open positions, with Buy and Sell calculated separately. When you are scaled into a position across several tickets, that single line tells you where the whole basket actually sits. With one position, the average collapses to that position's own entry, so the line lands exactly on it. What it draws Volume-weighted average entry per direction: avg = SUM(entry x lots) / SUM(lots) Optional project
FREE
Filtrele:
Değerlendirme yok
Değerlendirmeye yanıt