Mark Break Stop Order Trader
- Experts
- Versione: 3.2
- Attivazioni: 10
Mark Break Stop Order Trader is an automated Expert Advisor for MetaTrader 5.
IMPORTANT RISK NOTICE
This EA uses a grid / multi-trade technique and can keep many trades open in the same direction without a stop loss on each trade. A basket can show a large floating loss and a long drawdown before it recovers. Position size and the number of open trades can grow. Past or simulated results do not guarantee future results. Test on a demo account first and only risk money you can afford to lose.
How it works
- A waiting set is one pin/doji candle or two candles of opposite colour. The EA marks its high and low.
- A Buy Stop is placed above the high mark and a Sell Stop below the low mark, with a stop loss at the opposite side of the set. The breakout candle must close beyond the mark, otherwise the basket is closed.
- Each of up to nine timeframes (M1 to MN1) can be switched on from the panel and has its own magic number.
- Follow-trend grid trades and retest trades can be added, the target is the next zone, and trades are closed when a reversal candle appears. After an add the stop loss can move to break-even.
- Filters: market regime (trend or range), large-timeframe direction, large engulfing candle, spread and ATR-versus-spread checks. Hedge pairs are closed when they are in total profit.
- Panel with buttons for timeframes, mode (OFF / ALERT / FULL), lot, grid and CLOSE.
Safety and broker compatibility
- Volume is normalized to the symbol minimum, maximum and step before every order.
- Free margin is checked with OrderCalcMargin before an order is sent.
- Stops level and freeze level are respected when placing or modifying orders and SL/TP; a modification is not sent when the values are unchanged and nothing is modified inside the freeze zone.
- Symbol trade mode, trading session, order limit and filling mode are checked before sending requests.
- No DLL, no web requests, no files are written.
BOTKRIT recovery core and dashboard
This build includes a basket recovery core and a standard BOTKRIT panel. When the open basket of this EA loses more than the set percentage of the balance the EA pauses its own new entries and the core can open balancing (hedge) trades with its own magic number until the basket can be closed at break-even plus a target; the basket is cut at the set loss percentage. Balancing trades can increase exposure. The core works on hedging accounts only and can be switched off with InpRKOn = false. The panel can be collapsed and moved to another corner.
Inputs
- InpCoreOnly (default false): Diagnostic: silence EVERY layer and run the bare core (all layers stay measured and logged)
- InpUseForm1 (default true): FORM 1 - one pin / doji candle
- InpUseForm2 (default true): FORM 2 - two candles of alternating colour
- InpPinBodyPct (default 0.35): PIN: body no more than this share of the candle's range
- InpPinWickPct (default 0.45): PIN: the rejection wick at least this share of the range
- InpDojiBodyPct (default 0.12): DOJI: body no more than this share of the range (no wick rule)
- InpForm1NeedRed (default true): FORM 1 must be a RED candle for a buy setup (mirror for sells)
- InpSetMinATR (default 0.00): The whole set must span at least this x ATR of its own TF (0 = off)
- InpSetMaxATR (default 0.00): ...and no more than this x ATR (0 = off)
- InpBuyStopAddSpread (default true): Buy stop sits at mark + spread, so it fires when the BID crosses (sell side needs no such thing)
- InpMarkOffsetPts (default 0): Extra points beyond the mark, on top of that (0 = none)
- InpReLevelPct (default 30.0): Re-price a waiting BUY stop once the spread has moved this many % since it was parked (0 = never)
- InpMaxFillSlipATR (default 0.50): Close at once when the fill lands further than this x ATR from where the order was parked (0 = off)
- InpSetExpireBars (default 3): Cancel an untaken mark order after this many bars of its own TF (0 = never)
- InpNeedConfirm (default true): The bar that breaks the mark must CLOSE beyond it, or the basket goes out
- InpStrictAbove (default true): "Beyond" means strictly past the wick, never level with it
- InpMaxLiveTF (default 3): Most timeframes holding a basket at the same time
- InpSLBufferPts (default 20): Stop this many points beyond the set's far wick
- InpSLSpreadX (default 1.5): ...plus this many spreads (the stop is hit at the far side of the book)
- InpMinSLPoints (default 0): Hard floor on the stop distance in points (0 = off)
- InpLotMode (default LOT_RISKPCT): Lot sizing - RISKPCT keeps the risk equal whatever the stop distance
- InpFixedLot (default 0.01): Fixed lot - the LOT box on the panel is the live value
- InpRiskPercent (default 0.50): Risk per BASKET (% of balance) when sizing by risk
- InpMaxLot (default 5.00): Hard lot cap
- InpMagic (default 20260913): Magic base - each timeframe gets InpMagic + its index
- InpGridPts (default 0): Points between adds (0 = use the ATR figure below)
- InpGridATR (default 0.50): Auto grid = this x ATR of the basket's own timeframe
- InpGridMax (default 5): Most adds per basket (0 = no adds, first entry only)
- InpGridNeedProfit (default true): Only add while the NEWEST leg is in profit
- InpGridStopForever (default false): A losing newest leg ends the ladder for good (off = it pauses and resumes)
- InpGridLotMult (default 1.00): Lot of each add = previous add x this (1.00 = flat)
- InpGridLotCap (default 0.00): Largest single add lot (0 = no cap)
- InpRetestOn (default true): After the break, a pullback that closes a candle back in the trend colour adds one
- InpRetestMax (default 2): Most retest adds per basket
- InpRetestGridGap (default true): A retest must be at least one grid distance from every existing entry
- InpTPZone (default true): Target = the near edge of the next zone ahead
- InpTPMinTF (default PERIOD_M5): Smallest timeframe whose levels may hold the basket target
- InpTPSameTFOnly (default false): Only the pattern's OWN timeframe may supply it (overrides the floor above)
- InpTPEarlyPts (default 0): Bank this many points before that edge (0 = at the edge)
- InpDragTP (default true): The basket TARGET line can be dragged on the chart to move every leg at once
- InpDragSL (default true): ...and the basket STOP line the same way - both are whole-basket exits
- InpCloseReverse (default true): A reversal candle on the basket's own timeframe closes the whole lot
- InpReverse2Bar (default false): The reversal must clear BOTH of the last two wicks, not just one
- InpBEAfterAdds (default true): Once the first add has filled, pull the shared stop to break-even
- InpSprGuard (default true): No new entry while the spread is abnormally wide
- InpSprMaxX (default 2.0): ...wider than this many times the symbol's OWN normal spread
- InpSprWinHours (default 24): Hours of history the normal spread is measured over
- InpSprPctile (default 25): Percentile of those readings that counts as normal
- InpSprWarmMins (default 30): Minutes of samples needed before the guard is trusted
- InpMinSetSprX (default 2.0): The set must be at least this many spreads tall (0 = off)
- InpMinATRSprX (default 3.0): A timeframe's own ATR must be at least this many spreads (0 = off)
- InpRunMode (default RUN_FULL): OFF / ALERT (watch only) / FULL - the panel button is the live value
- InpOnM1 (default false): M1
- InpOnM5 (default false): M5
- InpOnM15 (default true): M15
- InpOnM30 (default true): M30
- InpOnH1 (default true): H1
- InpOnH4 (default false): H4
- InpOnD1 (default false): D1
- InpOnW1 (default false): W1
- InpOnMN1 (default false): MN1
- InpScanBars (default 200): Bars scanned per timeframe for the zones
- InpATRPeriod (default 14): ATR period, on every timeframe
- InpDrawMarks (default true): Draw the mark, the stop and the target on the chart
- InpDrawSetBox (default true): Draw a box around the waiting set itself
- InpDrawPA (default true): Draw each big frame's engulf ON THE CHART, so the panel can be checked against the candles
- InpDrawPAMinTF (default PERIOD_H1): Smallest timeframe whose engulf is drawn
- InpLineFromBirth (default true): A level runs from the candle that made it to the live price, and stops there
- InpLinePadBars (default 1): Bars of run-on past the live price before the label
- InpMarkWidth (default 2): Line weight of a mark
(+ 86 more inputs, see the Inputs tab; every input has a description.)
Recovery core and dashboard inputs:
- InpRKOn (default true): Recovery core on/off: when the basket loss grows, new entries of the EA are paused and balancing trades can be opened until the basket closes
- InpRKStartPct (default 3.0): Start recovery when the basket loss exceeds this percent of the balance at basket start
- InpRKStartATR (default 3.0): or when price runs against the net position by this many ATR (0 = off)
- InpRKCutPct (default 30.0): Close the whole basket at this percent loss of the start balance
- InpRKShockATR (default 10.0): Shock distance to survive (ATR multiples), used for the lot ceiling
- InpRKMinMargin (default 300.0): Do not open a recovery trade if the margin level after opening would be below this percent
- InpRKSpreadMul (default 2.0): Pause recovery trades when the spread is above this multiple of the 60-minute median
- InpRKCorner (default bottom right): Corner of the BOTKRIT panel
- InpRKBar0 (default FULL): Bar-0 label (basket profit, spread and leverage)
Recommended setup
- Any liquid symbol. Choose the timeframes on the panel. Make sure the symbol allows pending orders.
- Minimum capital: At least 1,000 USD with the default risk of 0.5 percent per basket.
- Test on a demo account first and keep the lot small.
