Complete input reference

BBFP EA Settings Guide: Every Input Explained

This page explains all 52 BBFP Breakout Grid EA inputs, using the real XAUUSD M15 defaults from the LOW_DD and HIGH_RISK set files. Each entry includes the effect on the EA and a practical example.

Gold price example: XAUUSDm has three decimals in the supplied MT5 dataset. One point is 0.001 and one gold pip is 0.10. A 100-pip stop is therefore $10.00 per ounce-price unit before lot-size conversion.

General

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpMagicNumber2026110620261105Unique order identifier. It keeps BBFP positions separate from manual trades and other EAs.Use a different magic number for every EA on the same account.
InpBoxTF15 Minutes15 MinutesThe timeframe used to build session boxes and confirm breakouts. BBFP is designed around M15.A value of 15 means a signal is evaluated only after an M15 candle closes.
InpHistoryDays4560How many days of M15 history the EA loads to build boxes and statistics.45 days is enough for the default box lookback; 60 gives more context if your terminal has the data.
InpManualGMTOffsetHours0.00.0Manual broker-server offset from GMT. Zero enables automatic detection.Keep 0 unless your broker server clock is unusual; the EA rounds the detected offset to 15 minutes.
InpAllowLongtruetrueEnables BUY breakout setups.Set false to run a sell-only research test.
InpAllowShorttruetrueEnables SELL breakout setups.Set false to run a buy-only research test.

Session boxes (GMT)

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpUseS1truetrueEnables the first session box.S1 is the default 23:00–06:00 GMT range.
InpS1StartHour2323S1 start hour in GMT.23 means box collection begins at 23:00 GMT.
InpS1EndHour66S1 end hour in GMT; the window wraps midnight.The S1 box ends at 06:00 GMT and can be traded after that.
InpUseS2falsetrueEnables the second session box.LOW_DD disables S2 because the tested M15 sample showed weaker S2 follow-through.
InpS2StartHour66S2 start hour in GMT.The S2 box starts at 06:00 GMT.
InpS2EndHour1313S2 end hour in GMT.The S2 box ends at 13:00 GMT.

Breakout rules

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpBreakoutBufferPips2.01.5Extra distance the candle must close beyond the box edge.If box high is 3,950.00 and buffer is 2.0 pips, a buy needs a close above 3,950.20 because 1 gold pip = 0.10.
InpMaxBarsAfterSession816Maximum M15 bars after the session ends in which the first breakout can trigger.8 bars = two hours; 16 bars = four hours of opportunity.
InpMinBoxRangePips10.08.0Ignores boxes that are too narrow to offer a real range.10 pips = $1.00 on gold; tiny boxes are skipped.
InpMaxBoxRangeATR5.08.0Rejects boxes that are too wide compared with ATR.ATR 2.00 × 5.0 = $10 maximum box width in LOW_DD.
InpATRPeriod1414ATR period used by the box-range and volatility filters.14 M15 bars is the standard short-term volatility lookback.
InpSlBufferPips3.02.0Extra stop distance beyond the box edge.A $0.30 buffer on gold is added below the box low for a buy.
InpMinStopPips10.08.0Minimum stop distance from entry.The EA widens the stop to at least $1.00 when the box edge is too close.
InpMaxStopPips250.0350.0Maximum stop distance in pips.Prevents a technically valid box from creating an oversized risk unit.
InpMaxStopATR3.05.0Hard stop cap as a multiple of ATR.ATR 2.00 × 3.0 = $6.00 maximum LOW_DD stop distance.

Pivot and target rules

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpUsePivotBiastruetrueRequires a buy above the previous D1 pivot and a sell below it.A buy breakout above the box high is skipped if price is still below the previous D1 pivot.
InpUsePivotTargetstruetruePrefers a valid pivot level for TP before falling back to the box target.The EA scans R1, intraday levels and daily targets for a valid RR.
InpR1Mult1.01.0Multiplier for resistance 1 from the pivot formula.R1 = P + 1.0 × (P − previous-day low).
InpS1Mult1.01.0Multiplier for support 1 from the pivot formula.S1 = P − 1.0 × (previous-day high − P).
InpIntraLongMult0.2360.236Fibonacci multiplier for the intraday long level.P + 0.236 × previous-day range.
InpIntraShortMult0.2360.236Fibonacci multiplier for the intraday short level.P − 0.236 × previous-day range.
InpLongTarget1Mult0.6180.618Multiplier for the first daily long target.P + 0.618 × previous-day range.
InpShortTarget1Mult0.6180.618Multiplier for the first daily short target.P − 0.618 × previous-day range.
InpLongTarget2Mult1.01.0Multiplier for the second daily long target.P + 1.0 × previous-day range.
InpShortTarget2Mult1.01.0Multiplier for the second daily short target.P − 1.0 × previous-day range.
InpBoxTargetFib0.81.2Fallback target as a multiple of the box range.A $10 box gives an $8 target in LOW_DD or a $12 target in HIGH_RISK.
InpMinRR3.02.0Minimum reward-to-risk accepted.If the best pivot target is below 3R in LOW_DD, the EA moves TP to 3R.
InpMaxRR5.08.0Maximum reward-to-risk accepted.Extreme targets are clamped so one setup does not rely on an unrealistic move.

Controlled grid

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpGridEnabledtruetrueEnables additional entries after the initial breakout position.Disable it for a single-entry research test.
InpMaxGridLevels24Total positions allowed in one basket, including the initial entry.2 = initial + one grid entry; 4 = initial + three additions in HIGH_RISK.
InpGridStepATR1.00.60Adverse move required for a grid add, as an ATR multiple.ATR 2.00 × 1.0 = $2.00 spacing in LOW_DD.
InpGridMinStepPips12.08.0Minimum grid spacing in pips.Prevents grid entries from clustering in a small range.
InpGridLotMultiplier1.01.0Caps each grid lot relative to the initial lot; 1.0 means no martingale sizing.Do not raise this just to recover losses.
InpMaxBasketRiskPercent0.753.0Total basket risk at the shared stop.On $10,000, LOW_DD caps the full grid at $75; HIGH_RISK at $300.
InpGridOnlyWithBiastruetrueBlocks grid additions if price has crossed to the wrong side of the D1 pivot.A buy grid stops adding if price falls below the pivot.
InpGridCooldownBars21Minimum M15 bars between grid additions.Prevents multiple adds from one fast spike.

Money management

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpRiskPercent0.251.0Initial risk per trade based on account equity.$10,000 × 0.25% = $25 LOW_DD risk; 1.0% = $100 HIGH_RISK risk.
InpMaxDailyLossPercent1.04.0Daily equity loss that stops new risk and can close positions.$10,000 × 1% = $100 LOW_DD daily loss limit.
InpCloseOnDailyLosstruetrueCloses all BBFP positions when the daily loss limit is hit.Set false only if you want to manage exits manually.
InpMaxSpreadPips2.53.5Maximum allowed spread at entry.LOW_DD blocks entries above $0.25 spread on gold.
InpSlippagePoints3050Allowed execution deviation in points.Gold with three decimals: 30 points = $0.03.
InpMaxDailyTrades13Maximum initial breakout entries per GMT day.Grid additions are separate and capped by the grid settings.

Execution and display

InputLOW_DDHIGH_RISKWhat it controlsReal-world example
InpCloseBeforeWeekendtruetrueCloses BBFP positions before the weekend.Avoids carrying a grid over the weekend gap.
InpFridayCloseHourGMT2020Friday close hour in GMT.Positions are closed from 20:00 GMT on Friday.
InpShowPaneltruetrueShows the on-chart status panel.Displays pivot, boxes, trade count, grid state and daily loss.
InpVerboseLogfalsefalsePrints detailed setup and execution messages.Enable during testing, disable for normal live use.

How the risk math works

Initial lot size is calculated from equity, InpRiskPercent, the stop distance and the symbol's tick value loss. LOW_DD risks 0.25% on the first entry; HIGH_RISK risks 1.0%. The grid has a separate ceiling: InpMaxBasketRiskPercent measures all basket positions at the shared stop.

Example: a $10,000 account with LOW_DD uses a $25 initial risk and a maximum $75 basket risk. That does not mean every trade loses those amounts; it means the position sizing is constrained by those limits at the stop. Slippage, gaps and broker execution can produce a different result.

The EA uses the broker's tick value loss when available and checks free margin before sending an order. If the requested lot would exceed the margin buffer, the lot is reduced or skipped.

Settings FAQ

Should I change the defaults?

Start with LOW_DD on demo. Change one group at a time. Increasing risk, grid levels or box range does not automatically improve the strategy.

Why is S2 disabled in LOW_DD?

The M15 data sample used for the presets showed S1 breakouts had better follow-through than S2. HIGH_RISK keeps both sessions for more trades.

Is the grid a martingale?

No. InpGridLotMultiplier defaults to 1.0 and total basket risk is capped. Do not raise the lot multiplier to recover losses.

🚀 Invite friends — Earn $5 You both get $5 credit on Go Ad · opencode.ai AI-Powered Coding Agent — Try Free Build apps, fix bugs & ship faster with opencode. Get $5 free credit when you join. × Ad · quo.com QuoPhone — $20 Visa Gift Card Free Sign up to Quo, subscribe 3 months, get a $20 Visa gift card. Atif's referral gift for you. ×