Grid Core Chande Forecast EA
- 专家
- 版本: 3.26
- 激活: 5
Built for grid traders who want price to break away from its own forecast before the first order. One promise: no grid starts on a hunch; it starts when the close jumps to the other side of a clean regression line with the trend behind it. Mechanism: a Chande Forecast Oscillator zero cross on a closed bar, checked by a Fit Guard, a Range Guard and an EMA 200, then an ATR-spaced grid that banks small closures.
Why the lower price: this core grid runs the same engine, the same safety fixes and the same panel as our full grid EAs, but with one focused signal and nothing stacked on top, so you only pay for the part you use.
Price gap, said plainly: our full grid EAs sit around $213 to $249; this one is $58. What is lighter is the signal side (one oscillator, 10 signal inputs, hedge cycle off by default), not the money handling, which is the same code.
Tested on: EURUSD H1, $10,000, default inputs, 2025.01.01 to 2026.09.30: net +1,193.87, maximal equity drawdown 115.01 (1.11%), 633 trades, no stop-out, no margin refusal. Deepest basket: 7 grid orders open together, 0.42 lots in total.
Try it free first: open Grid Core Chande Forecast EA in the MetaTrader 5 Strategy Tester, visual mode on, default inputs, EURUSD H1. Each crossing it accepts gets an arrow; on a live chart each crossing a guard turned down is shown as a grey dot.
The trade lifecycle in four verbs. It fits a straight line through the last 14 closes, measures how far the close sits above or below that line's forecast, waits for that gap to change sign on a well-fitted line with the trend agreeing, 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.
----------
WHERE THE FORECAST BREAKS
Tushar Chande's Forecast Oscillator compares each close with the value a least-squares line through the recent closes says it should be. The result is the gap in percent: 100 x (close - forecast) / close. Above zero, price is running ahead of its own straight-line path; below zero, it is falling behind it. When the oscillator crosses zero, price has moved from one side of its forecast to the other. The EA adds a 9 bar EMA of the oscillator as a signal line for an optional quicker mode.
Five facts before you start
- Entry: the oscillator crosses above zero (BUY) or below zero (SELL) on a finished bar. A signal-line mode is there for earlier, more frequent entries. Accepted signals do not repaint.
- Calculated inside the EA from closing prices. No indicator file, no DLL, no web request.
- The Fit Guard wants a regression line that actually describes the closes, a Range Guard skips quiet boxes, and an EMA 200 filter keeps entries on the main trend's side.
- The Fit Guard ships switched ON at 0.30, because in our test it roughly halved the worst drawdown on EURUSD, cut it by 43% on gold, and kept the basket three orders shallower. The full on/off numbers are below.
- No stop loss and no forced close-all. Limits stop new levels; the open book stays under management.
----------
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. Read the arrows and grey dots on the chart: they show which past crossings the guards would have taken or turned down.
4. Once the plans make sense to you, press ARMED on the panel.
5. Repeat the tester runs 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, from the deepest basket: on EURUSD H1 the deepest basket (0.42 lots) needed about $460 of margin at 1:100 next to a 115 drawdown, so start with at least $2,000 at default lots. On XAUUSD D1 the deepest basket was one 0.01 lot order, about $30 to $40 of margin at 1:100, so start with at least $500. Larger lots need proportionally more.
----------
Reproduce our numbers
Strategy Tester, default inputs, 1 minute OHLC, leverage 1:100, 2025.01.01 to 2026.09.30, one broker's demo data. Same settings and period, and you should land near these:
- EURUSD H1, $10,000: net +1,193.87, maximal equity drawdown 115.01 (1.11%), 633 trades, deepest basket 7 orders / 0.42 lots. No stop-out, no margin refusal.
- EURUSD H1, $1,000,000: net +1,193.87, maximal equity drawdown 115.01 (0.01%), 633 trades, deepest basket 7 orders / 0.42 lots. No stop-out, no margin refusal.
- XAUUSD D1, $10,000: net +28.71, maximal equity drawdown 13.28 (0.13%), 11 trades, deepest basket 1 order / 0.01 lots. No stop-out, no margin refusal.
- XAUUSD D1, $1,000,000: net +28.71, maximal equity drawdown 13.28 (0.00%), 11 trades, deepest basket 1 order / 0.01 lots. No stop-out, no margin refusal.
Treat these as one past stretch, not a forecast. The deepest basket comes from the tester's deal list (largest number of grid orders open at once, and their lots). The money drawdown is identical at both deposits because lots do not grow with the balance, so it weighs far more on a small account; deposits under $10,000 were not tested. Defaults were chosen once by judgement on this same period, which flatters them. Eleven gold trades in 21 months is much too few to judge gold. Netting accounts were not verified.
----------
The Fit Guard: on or off, in numbers
The idea: a forecast is only worth crossing if the line behind it fits the closes. R squared measures that fit from 0 (pure noise) to 1 (a perfect straight path). The Fit Guard asks for at least InpCFOFitMin on the crossing bar. Same period, same settings, guard at 0.30 against guard off:
- EURUSD H1, $10,000: on, net +1,193.87, drawdown 115.01 (1.11%), 633 trades, deepest 7 orders / 0.42 lots. Off, net +1,609.97, drawdown 244.92 (2.25%), 802 trades, deepest 10 orders / 0.55 lots.
- XAUUSD D1, $10,000: on, net +28.71, drawdown 13.28, 11 trades, deepest 1 / 0.01. Off, net +55.93, drawdown 23.33, 20 trades, deepest 1 / 0.01.
With the guard on, the worst drawdown fell by 53% on EURUSD and 43% on gold, and the deepest basket was three orders and 0.13 lots lighter. Profit per unit of drawdown also improved, from about 6.2 to about 9.5 across both symbols. The cost: about 26% less net profit on EURUSD and about half on gold. It ships on because it was the safer setting on both symbols. If you want the larger profit and accept roughly double the drawdown, set InpCFOFitMin to 0.
----------
Why the Chande Forecast Oscillator
A grid needs one clear starting signal, then it needs the engine to do the work. The forecast oscillator is a good starting signal for three reasons. It is anchored to price's own straight-line path, so it reacts to the move breaking away from that path, not to an arbitrary average. It is in percent, so its zero line means the same on any symbol without retuning. And the zero cross is a single, unmistakable event on a finished bar. The honest costs: a regression line lags a turn like any lookback; in a sideways market the close keeps flipping around the line; and a 14 bar line can fit a short swing well and still be wrong about the next one. The Fit Guard, the range check, the trend filter and the signal gap exist for exactly those cases.
----------
One cycle, step by step
1. Fit. Each new bar fits a least-squares line through the last 14 closes of every finished bar and takes its value on that bar as the forecast.
2. Measure. The oscillator is the gap between close and forecast in percent; a 9 bar EMA of it forms the signal line.
3. Cross. In the default mode the oscillator must cross zero, upward for a BUY, downward for a SELL. In signal mode it must cross its signal line.
4. Fit Guard. The line's R squared on the crossing bar must be at least 0.30 (0 switches it off).
5. Range Guard. The last 20 bars must span at least 5 ATR, so tight boxes are skipped.
6. 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.
7. 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.
8. 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.
9. 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.
10. 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.
11. 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. The CFO PULSE row shows the regression length and signal length, the oscillator and signal values of the last finished bar in percent, whether the oscillator is rising (UP) or falling (DN), and the bars since the last crossing. The FIT GUARD row shows the side the oscillator favours, the mode, the bar's R squared with OPEN, HOLD or off, the Range Guard width in ATR with its state, and the EMA side. On the live chart every crossing of the last 150 bars is marked: a small arrow when accepted, a grey dot when a guard turned it down. 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 want a grid that starts when price leaves its own forecast on a clean trend, not on noise; who like many small closures; who prefer a quiet EA that trades with the main trend; 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 a quick doubling. The tested result above is modest, and it is the honest one.
- Small accounts running large lots unattended. A long one-way trend can keep the book open for weeks.
- Traders who want a trade on every candle. The filters keep it quiet on purpose, and on daily gold it can sit idle for months.
- Traders chasing the largest profit at any drawdown. The default favours a smaller drawdown; switching the Fit Guard off trades more and swings harder.
- Traders who want a ready-made gold system. Gold was tested only on D1 with eleven trades, which proves nothing either way.
- Traders who expect a regression line to call tops and bottoms. It confirms a break away from the path; it does not predict the turn.
- 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 Chande Forecast Oscillator? Yes: 100 x (close - linear regression forecast) / close over 14 closes. The 9 bar EMA signal line and the R squared Fit Guard are added by this EA.
Zero or signal-line mode? Zero mode waits for price to change sides of its forecast and trades less. Signal-line mode reacts to the oscillator turning and trades more often; it was not backtested here.
Which markets were tested? EURUSD H1 and XAUUSD D1. Everything else is yours to test.
How deep did the grid go in the test? At most 7 orders open together on EURUSD, 0.42 lots in total, with the default guard. With the guard off it reached 10 orders and 0.55 lots.
What should I change first? InpCFOFitMin, then InpCFORangeMinATR, then InpCFOPeriod. One change at a time, and read drawdown and basket depth next to net result.
Netting accounts? A separate margin cap exists for them, but netting behaviour is unverified.
----------
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 (9769520).
GridOrderComment - text on grid orders (GCFO).
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).
Profit 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 - profit 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 (9769521).
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 Chande Forecast 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).
Chande Forecast Oscillator
InpCFOPeriod - closes in the least-squares forecast line (14).
InpCFOSignal - EMA length of the signal line (9).
InpCFOMode - 0 the oscillator crosses zero, 1 it crosses its signal line (0).
InpCFOFitMin - Fit Guard: minimum R squared of the forecast line on the crossing bar (0.30; 0 off; see the test above).
InpCFORangeMinATR - Range Guard: least window width in ATR (5; 0 off).
InpCFORangeBars - Range Guard: window length in bars (20).
InpCFOATRPeriod - ATR length for the Range Guard (14).
InpCFOTrendFilter - 1 with the EMA side, 2 against it, 0 off (1).
InpCFOTrendMAPeriod - trend EMA length (200).
InpShowSignalArrows - arrow where a cycle armed (on).
InpShowCFOOnChart - past crossings 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 forecast oscillator is built from past closes and cannot see the next bar. No profit 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 used it, an honest review of how it behaved for you, good or bad, helps the next trader decide.
