Blau Tidegate EA
- Uzmanlar
- Sürüm: 3.40
- Etkinleştirmeler: 5
Stochastic Momentum Index grid trading for traders who want the first grid level to wait for a clear turn, not a guess. One promise: no grid starts until William Blau's Stochastic Momentum Index (SMI) has gone deep into its low or high zone and then crossed back over its own signal line, in the direction of the long trend. Mechanism: the SMI computed inside the EA from finished candles, a cross of its signal line beyond -40 or +40, an EMA 200 trend filter and a Range Guard, then an ATR-spaced grid that banks small closures.
Put simply, Blau Tidegate EA is a Stochastic Momentum Index grid EA for MetaTrader 5, a pullback-turn expert advisor: in an up-trend it waits for a dip to stretch the close far below the middle of the recent range and buys the moment the SMI turns back up; in a down-trend it does the mirror image.
How it differs from the stochastic you know: the classic Stochastic measures the close against the LOW of the range (0 to 100). The SMI measures the close against the MIDDLE of the range, so it runs from -100 to +100 around 0, and both the distance and the range are smoothed twice, which removes much of the jitter that makes the classic Stochastic flip back and forth.
Which side it takes, in one line: the SMI crossing up through its signal line while at or below -40 arms a BUY, crossing down through it while at or above +40 arms a SELL, and only when the close sits on the trade's side of the EMA 200.
Its known weak spot, and what covers it: on its own the SMI turns early in a strong trend and keeps calling tops that are not there. That is why the default trend filter only accepts turns in the direction of the EMA 200: a dip that turns up in an up-trend, a rally that turns down in a down-trend.
Why it costs less: the grid engine, the safety fixes and the panel are the very same code as our full grid EAs; the difference is one focused signal and nothing stacked on top.
The price gap in plain numbers: our full grid EAs sit around $213 to $249; this one is $78. The lighter part is the signal (one indicator, 17 signal inputs, hedge cycle off by default), not the money handling.
Tested on: EURUSD H1, $10,000, default inputs, 2025.01.01 to 2026.09.30: net +286.34, maximal equity drawdown 248.61 (2.44%), 140 trades, 99 of 140 won, profit factor 3.27, no stop-out, no margin refusal. 140 trades in about 91 weeks is roughly 1 to 2 a week: this is a patient EA.
Try it free first: open Blau Tidegate EA in the MetaTrader 5 Strategy Tester, visual mode on, default inputs, EURUSD H1. Every turn it takes gets an arrow on the candle; on a live chart every turn a guard refused shows as a grey dot.
The one input to touch first, and which way: InpSMILevel. Lower it from 40 to 30 for more trades (turns closer to the middle count too); raise it to 50 for fewer, deeper turns. Change one thing at a time and compare drawdown, not only net result.
The trade lifecycle in plain verbs. It looks at the last 10 finished candles, finds the middle of their high-low range, measures how far the close sits from that middle, smooths that distance and the range twice, scales it to -100..+100, waits for the SMI to cross its signal line beyond 40, checks the EMA 200 agrees, opens the first level, spaces the next ones by ATR, and banks groups of orders once their joint result clears the target.
Plain risk up front. This IS a grid. It adds to losing positions and uses no stop loss by default. Defaults: 0.01 first lot, additive steps of 0.01, ATR spacing with a 50 point floor, hedge cycle off, margin-level safety off. Limits stop new levels; they never force-close the book.
----------
WHAT THE SMI MEASURES, IN CANDLE WORDS
Look at the last 10 candles on your chart. Mark the highest high and the lowest low, and draw a line exactly halfway between them. Now ask: is the last close above or below that middle line, and by how much compared with half the box height? A close right at the top of the box reads about +100, right at the bottom about -100, in the middle 0. The SMI is that reading, smoothed so that one odd candle cannot swing it.
- distance = close minus the middle of the 10-candle high-low range,
- range = highest high minus lowest low of those 10 candles,
- both are smoothed by an EMA of 3, then again by an EMA of 3,
- SMI = 100 x smoothed distance / (smoothed range / 2), roughly -100 to +100,
- signal line = EMA 10 of the SMI.
A worked turn: in an up-trend the SMI falls to -52 while its signal line is at -47; on the next finished bar it reads -44 against a signal of -46, so it crossed up through the signal while still below -40, and a BUY is armed if the close is above the EMA 200. Everything is computed inside the EA from finished bars: no indicator file, no DLL, no web request.
Five facts before you start
- Entry: the finished bar where the SMI crosses its signal line beyond the level (up while at or below -40 for BUY, down while at or above +40 for SELL). Accepted signals do not repaint.
- Side: in the default follow mode the EA trades with the turn; a second mode fades it.
- The default trend filter only lets a turn through when the close sits on the matching side of the EMA 200.
- A Range Guard skips quiet boxes where 20 bars span less than 5 ATR, so in tight flat ranges expect fewer trades.
- New this build: a Gap Guard that can ask for a clear gap between the SMI and its signal line on the signal bar, so a cross that only grazes the line cannot arm a grid. Its live value is on the panel. It ships OFF and was not backtested ON.
----------
Start here (5 minutes)
1. Put it on EURUSD H1 and leave every input at its default.
2. Switch RunMode to Scan only for the first session. The panel shows each plan and sends nothing.
3. Watch the arrows and grey dots: they show which past turns the guards took or refused.
4. When the plans make sense to you, press ARMED on the panel.
5. Repeat the tester run below on your own broker's data before real money; spread, swap and commission differ between brokers. Running more than one chart? Give each copy its own EAMagicNumber and HedgeMagicNumber.
Minimum deposit: on EURUSD H1 the worst equity drawdown was 248.61 USD on 10,000 at default lots, so start with at least $2,000 at default lots and size up only with the balance. Larger lots need proportionally more, and a longer trend than our test period can dig deeper.
----------
Reproduce our numbers
Strategy Tester, default inputs, 1 minute OHLC, leverage 1:100, 2025.01.01 to 2026.09.30, one broker's netting demo data. Same settings and period, and you should land close to these:
- EURUSD H1, $10,000: net +286.34, gross profit 412.22, gross loss -125.88, profit factor 3.27, maximal equity drawdown 248.61 (2.44%), maximal balance drawdown 19.43 (0.19%), 140 trades (82 short, 69.51% won; 58 long, 72.41% won). No stop-out, no margin refusal.
- EURUSD H1, $1,000,000: net +286.34, maximal equity drawdown 248.61 (0.02%), 140 trades. No stop-out, no margin refusal.
- XAUUSD D1, $10,000: net +7.04, maximal equity drawdown 13.28 (0.13%), 2 trades, both won. No stop-out, no margin refusal.
- XAUUSD D1, $1,000,000: net +7.04, maximal equity drawdown 13.28 (0.00%), 2 trades. No stop-out, no margin refusal.
2 gold trades on D1 is a tiny sample: the SMI rarely turns beyond 40 in the trend direction on daily gold, so treat XAUUSD D1 as untested in practice.
Treat this as one past stretch, not a forecast. The equity drawdown is far larger than the balance drawdown because the grid holds losing levels open until a closure pays them off. The money drawdown is the same at both deposits because lots do not grow with the balance. Other symbols, timeframes and deposits under $10,000 were not tested. Defaults were chosen once by judgement, not optimised. These runs used a netting demo account; hedging accounts were not tested.
----------
Why the SMI
A grid suffers most when its first level opens at the end of a move, just before it reverses. The SMI waits for the close to stretch far from the middle of its recent range and then for the smoothed reading to turn back, so the first level opens after a pullback has started to end, and the EMA 200 keeps that turn in line with the longer trend. The honest costs: a turn beyond 40 does not come every day, so trades are few; a turn can fail and the pullback can continue, which the grid then has to work through; and in sideways weeks the trend filter can flip sides, which is what the Range Guard, the optional Gap Guard and the gap between signals are there to calm.
----------
One cycle, step by step
1. Box. The highest high and lowest low of the last 10 finished candles are found.
2. Distance. The close minus the middle of that box is measured.
3. Smoothing. Distance and box height are each smoothed by EMA 3, twice.
4. Scale. 100 x smoothed distance / half the smoothed box height is the SMI, about -100 to +100.
5. Signal line. An EMA 10 of the SMI.
6. Turn. The event is the bar where the SMI crosses up through the signal line at or below -40 (BUY) or down through it at or above +40 (SELL).
7. Mode. Mode 0 takes that side, mode 1 the opposite side.
8. Rise Guard. Optional: at least InpSMIRiseMin of the last 5 SMI steps must move toward the trade side (0, the default, switches it off).
9. Body Guard. Optional: the signal candle's body must be at least InpSMIBodyMin of its high-low range (0, the default, switches it off).
10. Gap Guard. Optional: the SMI must sit at least InpSMIGapMin points from its signal line on the signal bar (0, the default, switches it off).
11. Stretch Guard. Optional: the close must have moved at least InpSMIStretchMin ATR over the momentum bars (0 switches it off).
12. Range Guard. The last 20 bars must span at least 5 ATR, so tight boxes are skipped.
13. Trend filter. By default the close must be on the matching side of the EMA 200. It can also fade that side, or be switched off.
14. Timing. Accepted signals are kept apart by a gap of bars, and a signal may wait a few bars if the level cannot be placed straight away.
15. Ladder. Levels follow ATR or fixed points, with a floor, a ceiling and an optional freeze. BUY and SELL grids can run together or alone.
16. Banking. Groups of oldest and newest orders close when their joint result, after swap and commission, clears the target. If the oldest order is too heavy, a slice of it is closed instead.
17. Safety checks. A closure that would reopen a level at once is blocked, every leg is confirmed in deal history, failed legs are retried, and a plan is dropped if the book changed before sending.
18. Hedge cycle, optional. Off by default and not exercised in our tests. When on, it holds a balanced pair on a chosen symbol and retires it in equal slices, paid by a small surcharge on closures the grid already makes.
----------
The panel
The panel sits on the left, keeping the right side and the price scale free. It shows symbol, magic number, a status pill, grid mode, lot step, spacing, banked result, the book, each side's closing plan and the order table. Two rows belong to the signal, and every short code on them is spelled out here:
- SMI GATE: the length (10), the SMI of the last finished bar, sg = its signal line, HIGH at or above +40, LOW at or below -40 or MID between, UP or DN for rising or falling, and x 12b = 12 bars since the last qualifying turn.
- RISE GUARD: B or S for the side the SMI points to against its signal line, FOL (follow) or FADE for the mode, 3/5 = three of the last five SMI steps moved to that side, then G = Gap Guard distance from the signal line in SMI points, R = Range Guard width in ATR, B = Body Guard body share of the last candle (0.00 to 1.00), S = Stretch Guard move in ATR, each followed by OPEN (passes), HOLD (blocks) or off, and EMA UP or DN for the trend side.
On the live chart every turn of the last 150 bars is marked: a small arrow when accepted, a grey dot when a guard refused it. Buttons switch Armed / Scan only, Pause / Resume, chart marks and slicing. The Hedge Vault card docks under the main panel and stays hidden while the hedge is off. Nothing is drawn in a non-visual backtest.
----------
Limits you control
No setting closes the book for you; limits only stop new levels.
Every order passes a free margin check with a safety buffer before it is sent.
Caps on levels per grid, orders per side and lot per order keep the ladder finite. MinMarginLevelPercent and MaxAccountRiskPercent start at off; set them for your own account.
An optional margin-level timeframe safety moves the signal and spacing to a higher timeframe as margin falls. It is off by default and was not exercised in our tests.
Copies are kept apart by symbol and magic number.
Scan only shows every decision without sending a single order.
----------
Who this is for
Traders who like to buy dips in up-trends and sell rallies in down-trends, who want a grid that starts only after a measured turn, who accept few trades for a low drawdown, who want the core engine at an entry price, and who size lots to their balance.
Who this is NOT for
- Anyone who needs a stop loss on every order. This grid has none by design.
- Anyone expecting a fixed monthly return or several trades a day. The tested result above is one past period with 1 to 2 trades a week.
- Small accounts running large lots unattended. A long one-way trend can keep the book open for weeks; the tested equity drawdown reached about 2.4% of $10,000 and a harder market can go further.
- Traders who will not test first. If you skip the Strategy Tester on your own broker, this is not the right tool for you.
----------
Common questions
Does it repaint? Accepted signals, chart marks and both panel rows use finished bars only.
Is it the classic Stochastic Momentum Index? Yes: William Blau's SMI with a 10-candle range, double EMA 3 smoothing and an EMA 10 signal line, the usual -40 and +40 zones. The trend filter and the guards are added by this EA.
Why not the plain Stochastic? The plain Stochastic jumps with every new high or low; the SMI is centred on the middle of the range and smoothed twice, so its turns are calmer and fewer.
Why so few trades? A turn beyond 40 in the trend's direction needs a real pullback first. Quiet weeks with no new level are normal; the panel row shows where the SMI sits against its zones.
Follow mode or fade mode? Follow trades with the turn, fade against it. Fade was not backtested here.
Which markets were tested? EURUSD H1 and XAUUSD D1. Everything else is yours to test.
What should I change first? InpSMILevel (lower for more trades), then InpSMILen, then InpSMIRangeMinATR, then InpSMIGapMin. One change at a time, and read drawdown and trade count next to net result.
Netting accounts? Yes, all four test runs above were on a netting demo account; hedging accounts were not tested.
----------
All inputs
Grid levels
TradeMode - two grids, BUY and SELL, by default, or one direction only.
GridSpacePoints - level distance in fixed spacing mode (25).
GridSpaceMultiplier - above 1.0 widens deeper levels (1.0 = even).
MaxGridLevels - most levels in one grid (1000).
UpDirectionIsBuy - which side an up move arms.
EAMagicNumber - number on grid orders (9781670).
GridOrderComment - text on grid orders (BLTG).
OneOrderPerBar - at most one new level per bar.
Lots
InitialLotSize - volume of the first level (0.01).
LotSizingMode - additive by default, multiply as the alternative.
LotMultiplier - factor per level in multiply mode (1.25).
LotAddStep - step per level in additive mode (0.01; 0 uses the starting lot).
MaxOrderVolume - largest single order (1.0).
UseAutoLot - ties the starting lot to balance (off).
AutoLotBaseBalance - balance that matches the starting lot (1000).
AutoLotAllowDecrease - lets auto lot drop below the starting lot (off).
ATR spacing
GridSpacingMode - ATR by default, fixed points as the alternative.
ATRTimeframe - ATR timeframe (current chart).
ATRPeriod - ATR length (14).
ATRSpacingFactor - spacing as a multiple of ATR (1.0).
ATRBarShift - ATR bar; 1 is the last finished bar.
ATRMinSpacingPts - smallest spacing in points (50; 0 none).
ATRMaxSpacingPts - largest spacing in points (5000; 0 none).
ATRFreezeOnStart - keeps one spacing for the whole cycle (off).
Closure target
DesiredProfitPerClosure - base target in account currency (2.0).
ProfitMultiplier - final scale, 1.00 to 2.00.
ProfitTargetMode - scaled by default: bigger, deeper books aim higher.
ProfitVolumePower - how closing volume lifts the target (1.0; 0 off).
ProfitDepthBonus - extra target per additional open level (0.10).
ProfitMaxMultiple - scaled target ceiling in multiples of the base (50).
ProfitMaxReachFraction - keeps the target within this share of one grid step (0.50).
Fragment scanner
UseMultiLegScan - checks multi-order groups before the plain pair (on).
MaxOldestLegs - most old orders in one closure (3).
MaxNewestLegs - most new orders in one closure (6).
ScanPriority - ranking of qualifying groups; largest group first by default.
NeverBankLessThanPair - a group must also beat the pair target (on).
RequireCloseVolumeExceedsTarget - newest volume must exceed oldest volume (on).
MinCloseVolumeRatio - required ratio of those volumes (1.5).
Target slicing
EnableTargetSlicing - allows part-closing the oldest order (on).
FragProfitWeightPower - weight per closing lot (1.5).
FragMinSlicePercent - smallest slice, percent of the target order (20).
FragAllowMultiCloser - several new orders may fund one slice (on).
FragPreferFullClosure - a full closure wins when both are possible (on).
Reopen guard
ReopenGuard - blocks closures that would reopen a level at once (step based).
ReopenGuardCushion - safe distance as a share of one step (0.90).
Account protection
MinMarginLevelPercent - no new levels below this margin level (0 off).
MaxAccountRiskPercent - no new levels beyond this floating loss, percent of balance (0 off).
NetMaxMarginPercent - netting only: cap on net position margin, percent of equity (5.0).
MaxTotalOrders - absolute order cap per side (1000).
Execution and checks
RunMode - Armed or Scan only.
CloseSequence - order in which legs are sent; oldest first by default.
MaxSlippagePoints - allowed slippage (30).
MaxSpreadPoints - no trading above this spread (7500).
MinSecondsBetweenClosures - pause between closures per side (5).
CloseAttemptsPerLeg - attempts before the retry queue (3).
VerifyTimeoutSeconds - how long a stuck leg is followed (90).
DeferWhenMarketClosed - waits for the session instead of halting (on).
MarketClosedRetrySeconds - retry spacing while orders are refused (30).
AutoResumeAfterSeconds - a halt clears itself after this many seconds (300; 0 waits for you).
NoPartialRetryMinutes - partial closes tried again this many minutes after a broker refusal (15; 0 never).
AbortIfBookChanged - drops a plan if a leg changed (on).
UseFullCommission - counts commission on both sides (on).
CommissionPerLot - fallback figure (0 reads history).
CloseOrderComment - text on closing deals.
Hedge cycle
EnableHedgeCycle - main switch (off).
HedgeSymbols - comma list; repeat a symbol for more turns (XAGUSD).
HedgeSymbolRotation - how the next symbol is picked (per cycle).
HedgeMaxSymbolsInTester - rotation cap in the tester only (2; 0 none).
HedgeCycleLots - lots on each side of the pair (0.01).
HedgeSliceLots - lots retired per side each slice (0.01).
HedgeFragmentBonus - bonus over the slice cost (100).
HedgeBonusIsPercent - bonus is a percent; false means money (on).
HedgeMaxSurcharge - money cap per closure (0 none).
HedgeMaxSurchargePercent - largest rise of any closure target, percent (50).
HedgeMagicNumber - number on hedge legs, must differ from the grid (9781671).
HedgeReopenOnFinish - opens a new cycle when one ends (on).
HedgeStartRequiresTrade - first cycle waits for a grid order (on).
HedgeIntegritySeconds - leg balance check interval (5).
HedgeAutoRepair - repairs a lone leg automatically (on).
HedgeNakedAction - what to do with a lone leg; re-hedge by default.
HedgeMaxSpreadPoints - hedge spread limit (0 off).
HedgeSlippagePoints - hedge slippage allowance (30).
HedgeAttemptsPerLeg - attempts per hedge leg (3).
HedgeVerifyTimeout - follow time for a stuck hedge leg (90).
HedgeCommissionPerLot - fallback hedge commission (0 reads history).
HedgeOrderComment - text on hedge deals.
Weekly cash day
WeeklyCashDay - pauses new cycles and slices around withdrawals (off).
CashDayOfWeek - 0 Sunday, 1 Monday and so on (1).
CashCutoffHour - server hour after which no new slice fires (21).
Panel and chart
ShowPanel - panel on or off.
PanelX and PanelY - distance from the chart edge (12, 15).
PanelFontSize - base text size (9).
ShowArabic - second language line (on).
ShowChartMarks - plans and levels drawn on the chart (on).
MaxTableRows - order rows per grid (13).
PanelCorner - corner the panel is anchored to.
Entry trigger
EntryTriggerMode - the SMI strategy by default.
SignalBarShift - 1 is the last finished bar.
SignalBarsDelay - bars between accepted signals (30; 0 every).
SignalValidBars - bars a signal stays usable (3).
SignalAllowBuy and SignalAllowSell - switch each side.
SignalReverse - turns the direction around (off).
Blau Stochastic Momentum Index
InpSMILen - candles in the high-low range (10).
InpSMISmooth1 - first EMA smoothing of distance and range (3).
InpSMISmooth2 - second EMA smoothing of distance and range (3).
InpSMISignal - signal line EMA length (10).
InpSMILevel - zone level; a cross up counts at or below -level, a cross down at or above +level (40).
InpSMIMode - 0 follow, trade with the turn; 1 fade, trade against it (0).
InpSMIGapMin - Gap Guard: least SMI-to-signal distance on the signal bar, in SMI points (0 = off, the default; OPEN/HOLD on the panel).
InpSMIMomBars - bars over which the close move for the Stretch Guard is read (10).
InpSMIStretchMin - Stretch Guard: least move in ATR over the momentum bars (0 = off; OPEN/HOLD on the panel).
InpSMIRiseMin - Rise Guard: least of the last 5 SMI steps moving to the trade side (0 = off, the default; up to 5; OPEN/HOLD on the panel).
InpSMIBodyMin - Body Guard: least body share of the signal candle, 0 to 1 (0 = off, the default; OPEN/HOLD on the panel).
InpSMIRangeMinATR - Range Guard: least window width in ATR (5; 0 off).
InpSMIRangeBars - Range Guard: window length in bars (20).
InpSMIATRPeriod - ATR length for the Range Guard and the Stretch Guard (14).
InpSMITrendFilter - 1 with the EMA side, 2 against it, 0 off (1).
InpSMITrendMAPeriod - trend EMA length (200).
InpShowSignalArrows - arrow where a cycle armed (on).
InpShowSMIOnChart - past turns on the live chart, arrow or grey dot (on).
Debug
DebugMode - extra journal detail (off).
Margin timeframe safety
UseMarginTFSafety - main switch (off).
Level1MarginPct and Level1TF - at 6000 percent the work moves to M15.
Level2MarginPct and Level2TF - at 5000 percent the work moves to H1.
MarginTFHysteresisPct - recovery needed before stepping back (500).
----------
Risk, plainly
Grid trading is risky. It adds to losing positions, uses no stop loss, and a long trend can keep the book open for a long time or, with lots too large for the balance, end in a stop-out and a heavy loss. The SMI is built from past candles and cannot see the next one. Nothing is promised. Choose lots that survive a bad run, test on your own broker, and only risk money you can afford to lose. No DLLs or extra files are needed.
If you have run it, an honest review of how it behaved for you, good or bad, helps the next trader decide.
