Generator Template
The Template page defines the search space of the Generator: what stays in every generated strategy, what may appear, which values may vary and which indicators each slot may draw from. A template is worth keeping, because it is a search space rather than a strategy — the same template works on every market and every account currency.
Valid changes are saved automatically and apply to the next run. While a Generator run is working, the status line says so: the run keeps searching with the frame it captured when it started, and an edit made mid-run is saved for the next run, never lost. Run settings and the acceptance criteria stay on the Generator page.
| Area | What it holds |
|---|---|
| Toolbar | Undo / Redo, the working template's name and status, Save, Save as..., Reset and the ... menu |
| Left column | The strategy features, then the entry and exit points with their rule slots |
| Right column | The settings of the selected item, or the indicator pool form, or Saved templates followed by the always-visible Built-in templates |
Strategy layout
The layout follows the Strategy Editor: beige strategy features, green entry points and preset indicators, and red exit points and preset indicators. Select an item to edit its settings alongside the layout; on a narrow screen the settings appear directly below the selected item.
The settings heading carries only Reset (which restores that item's defaults); the footer carries Cancel and Apply, and either closes the form and returns the right column to its default panel. Cancel (or Escape) puts the values back as they were when the form opened; Apply keeps them. Closing keeps incomplete values — the status and the issue list still report them, and Fix reopens the affected settings.
Strategy features are added manually: the bordered panel below the feature list reads Strategy features 3 of 24 features — the features in the frame out of the ones the catalog offers. Use the Add feature menu there to pick another strategy feature; choosing an entry adds it and opens its settings. Remove a feature with its remove button.
The default frame is a fixed 0.10-lot entry, an optional 50–150 pip stop loss and take profit (70 % probability each, trailing stop loss either on or off), and both points selected from their indicator pools.
Strategy features
Required features appear in every strategy. Optional features are included according to their probability; the probability input appears only for optional features. The inclusion buttons and probability share one line when space permits.
Entry amount is always required and cannot be removed. Its Entry unit and Volume policies are locked to Fixed; their values remain editable and default to Fixed lots and 0.10. The Generator preserves those values during generation, seed adoption and mutation. Older variable Entry amount policies are reset to their fixed defaults with a warning; existing fixed values are kept.
Parameter policies
Each parameter has toggle buttons for its supported modes:
| Kind | Modes |
|---|---|
| Numeric | Fixed or Range |
| List and option group | Fixed, Choice or Subset |
| Check box | On, Off or Either |
Max spread protection's Max spread (points) adds a third numeric mode, Symbol spread: the cap follows the market instead of one constant. Its × spread input multiplies the symbol's own spread, and Min is the floor the cap can never go under, so × 2 with min 20 gives EURUSD a 20-point cap and a 60-point-spread market a 120-point one — the same points the backtester compares against the data set's spread, never pips or price. A multiplier under 1 is refused: that cap would sit below the market's own spread and block every entry. The Template page shows the rule (symbol spread ×2, min 20 points) rather than a number, because the number belongs to the market the run loads.
A small caption under each parameter name shows its kind (Numeric, Check box, List, Multiple options or Time); a parameter the Generator may not vary shows a Fixed label instead of mode buttons. Fixed-only parameters show a Fixed label. A parameter without an explicit policy is Fixed at its default value. Range values have separate Min, Max and Step controls. List parameters keep their label, mode buttons and selected value on one line when space permits.
Some parameters appear only under one setting: Grid averaging down's Step increment belongs to the Increment progression and its Step multiplier to the Multiplier one, while Fixed and Fibonacci use neither and hide both inputs. A hidden parameter keeps its policy — switch the progression back and the value you set is there — and the page never reports a missing field for it. Only the inputs of the current setting are shown, and each one's limits apply whenever it is shown. A Choice progression is followed by a selector: it shows the inputs of every progression it may draw, because any of them can be generated, and each keeps its own policy.
A check-box parameter set to Either draws its value at random: its Probability input sets the chance of On in percent (default 70 % when the parameter is on by default, 30 % when it is off).
Where the feature has a trade preview (Stop Loss), a policy row also shows the generated range in the account currency and as a share of the initial account, using the same calculation as the Editor strategy table — for example Stop Loss 51.00 USD (0.51%) - 151.00 USD (1.51%). Stop Loss has a separate default range and step for each unit (pips, money and equity percent); changing the unit re-seeds a range that was still on the previous unit's default, while a customized range is kept.
Entry and exit points
Each point uses either a Preset indicator, whose parameters and logic you configure, or an Indicator pool, from which the Generator selects an indicator. Exactly one entry point and one exit point are used. The page shows them in four sections: Entry point, Entry rules, Exit point and Exit rules.
A pinned preset appears as a colored indicator slot with the same logic and parameter form as a rule preset. A point takes a single indicator, so the bordered pool panel disappears while the preset is set; its × remove button removes the preset and brings the panel back with Add preset and Set indicators. Pick an indicator from the Add preset menu to pin it and open its settings.
Point presets also support parameter and logic policies. The point indicator remains pinned, while the configured policy can vary its parameter values across generated strategies. Presets retain their own policies independently of the indicator pool policies.
Which exit point is drawn
Bar Open and Bar Close are both ticked in the Exit point pool by default, and the market decides which of the two is drawn.
- On a market that trades continuously through the day (forex, crypto and most commodity CFDs — 24/5 or 24/7) that is Bar Open: its price is a real tick at a known time, while a bar close is not a MetaTrader event, so a Bar Close exit has to fire a few seconds early and hopes the deal is filled before the bar actually completes.
- Where the market closes every session (stocks, session-bound indices) the close is the real event, so Bar Close is drawn.
The Generator measures this from the bar times — a recurring daily closure is visible as a gap in the data — and falls back to the symbol category when the data cannot answer (for example on D1 bars). Ticking only one of the two always gets you that one; the other silently stays out of the draw while both are ticked, and the Generator page's template outline then counts only the exit points a run can pick. Because the narrowing can leave a single drawable point, such a frame has no exit point left to vary: the run searches its rules, features and the other slots instead, and does not spend mutations on a point change that would redraw the same one.
Rule slots
Each rules section lists its preset indicators, followed by the same kind of bordered panel: the bold pool line, the Max rules per strategy as a select from 0 to 8 and the Add preset menu. The Max select sits on the right of the pool line. The maximum includes the presets; the indicator pool supplies the remaining generated rules, and the number actually drawn is at least the always-included presets and at most that maximum.
8 is the Generator's cap: a stored frame above it is reported as an error and the select keeps the stored value visible. An unfeasible maximum and incomplete inputs are reported in the section and in the issue list.
Every preset parameter uses the same policy controls as strategy features: numeric fields support Fixed/Range, list fields Fixed/Choice, check boxes On/Off/Either, and multiple-option fields Fixed/Subset. Logic supports Fixed/Choice. Range values obey the indicator's parameter limits and ordered-period constraints. Preset policies apply whether or not the indicator is in the pool; the Vary generated parameters switch affects only rules drawn from the pool.
The Reset button inside a preset's settings restores the indicator's default parameter and Logic values with Fixed policies. It preserves the preset's inclusion and probability. Cancel restores the settings from when the form was opened.
Exit rules
Exit rules exist only behind an exit point that allows them. Bar Open and Bar Close do; a price-level exit point (Moving Average, Bollinger Bands, Donchian Channel, Envelopes, Fractal) closes on a resting order the bar reaches, and No Indicator Exit never closes on an indicator signal at all, so a closing condition in front of either would be calculated and never read. Two consequences shape the page:
- A pinned exit point that allows no exit rules disables the Exit rules section. Its counts, Add preset menu and pool editor are shown but inert, and a note says why. Pinning such a point clears the exit-rule frame: the presets are removed and the counts drop to 0, so the page never stores rules the run would ignore. Pinning Bar Open or Bar Close again re-enables the section (raise the maximum to generate rules again).
- A frame that asks for exit rules draws only the exit points that allow them. A required preset is such a request: while it stands, the Generator picks the exit point from the allowing members of the pool, so the rule it asks for always appears. An optional preset is not a request — it may legitimately be absent, so a level point simply generates a chain without it. A frame whose whole exit-point pool allows no exit rules and still asks for rules is an error on the Exit rules section (
generator-template-exit-rules). A frame that only allows rules (a maximum above zero, no required presets) is not an error, but while no exit point in the pool allows them the section warns that none is generated. A pool that mixes both kinds is not an error either: the section warns that only the allowing members are drawn, because the others drop out of the search space.
A configuration stored by an older version (or imported from a template file) can still hold presets behind such a locked exit point. The section then lists them with the note; their editor is inert, and removing one clears the whole demand, which is the repair the page offers. Until then the frame reports generator-template-exit-rules and the run cannot start.
Because the backtest starts only once every indicator has enough history, dropping the rules can also let a run test an earlier bar than the same frame with them, so the two are not the same set of trades. The Generator page's template outline says so: the Exit rules row reads Muted and its line explains why, instead of promising a rule count the run would never generate.
Indicator pools
Every slot has an indicator pool: the indicators the Generator may draw when that slot is not pinned to a preset. Pools are the search space, not a strategy: a point or rule pinned to a preset ignores its pool while the preset is there, and Vary generated parameters applies only to pool-generated rules. Pools are saved with the template and exported with a template file.
Each slot's bordered Indicator pool panel carries the pool line, Add preset and Set indicators. There is no separate read-only Indicator pool card.
The pool line
The bold line reads how many generated rules one strategy draws out of the pool:
- A point always draws one: One of 6 indicators.
- A rule slot with no required preset draws up to its Max count: Up to 3 rules from 7 indicators, which follows the Max select at once.
- A rule slot whose presets must appear in every strategy says so: 2 required + up to 1 more · 7 indicators in the pool.
- With Max at 0 the slot generates nothing: No generated rules · 7 indicators in the pool.
The number of indicators is the number ticked in that pool — not the number the slot offers. The pool form reports both: its Count reads 7 of 54, the ticked indicators out of everything the slot allows, with · showing 9 of 54 while a filter narrows the list.
The pool form
Set indicators, the button at the bottom of a slot's bordered panel next to Add preset, opens the pool form for that slot. A point pinned to a preset hides its pool panel and that button; remove the preset to reach the pool again.
The form lists only the indicators the slot allows, one check box each:
| Control | What it does |
|---|---|
| Find an indicator | Narrows the list by name as you type; the Count line says how much of the list is shown |
| Category chips (behind the Filters: label) | Trend, Oscillators, Price action, Volume … keep only that category; the chips toggle, and each row's own category tag does the same |
| Everyday indicators | Ticks every indicator that does not read volume and unticks the ones that read it — the slot's everyday pool |
| Invert | Fills a sparse list and clears one that is mostly ticked: when fewer than half of the rows are ticked it ticks them all, otherwise it untick them all. With a filter active it applies the same rule to the rows on screen, and the rows the filter hides keep their ticks. Its tooltip says which of the two the next click will do |
| Selected | Reports how many of the slot's available indicators are ticked |
| Reset (in the heading) | Restores the same everyday pool as Everyday indicators and keeps the form open |
| Cancel (or Escape, or the heading's cross) | Restores the pool exactly as it was when the form opened |
| Apply | Closes only when the pool can fill the generated rules |
No Indicator Exit stays out of the everyday Exit point pool: it is a hand-picked exit point that never closes on a signal. Bar Open is an everyday exit point, next to Bar Close.
Ticking or unticking writes the configuration at once, like every other template edit. An empty entry-rule or exit-rule pool cannot fill the generated rules, so Apply reports the issue and leaves the form open. On a narrow screen the form appears directly below its slot panel instead of the right column.
What Vary generated parameters does
It is the switch that lets a rule drawn from the pool differ from its indicator's default values: every generated rule draws its own periods and levels.
- A generated period stays between the parameter's own minimum and the template's maximum period. The default maximum is 50; it has no control on the page and only an imported template file changes it.
- A level takes the half of its band that the drawn logic line reads: a "higher than" line draws above the middle, a "lower than" line below it, and a crossing line anywhere.
- A coupled set is always drawn in order — the Moving Average Crossover's fast period stays below its slow one, MACD the same, and the Alligator's three lines stay lips < teeth < jaws.
A stored indicator parameter policy (from an imported template file or an older configuration) still wins over the generated value, and Fixed keeps every generated rule on the model defaults. Presets are unaffected either way: they follow their own parameter policies.
The Generator page's outline says what the switch does for each slot: vary means a rule drawn from that pool takes its own periods and levels, fixed means it keeps the model values, and pinned means the slot holds a preset instead of a pool.
Built-in templates
The Built-in templates card is available without signing in and sits below Saved templates. It is always visible, has no count or Show/Hide control, and keeps a one-line comment under each name; hovering shows the full sentence. The built-ins are listed in order of risk.
| Template | What it holds |
|---|---|
| Default template | The standard everyday template, just like the toolbar's Reset button: a relaxed starting point with three strategy features (0.1-lot entry, optional Stop Loss and Take Profit) and the everyday indicator pools |
| Conservative | A fixed 0.1-lot entry, required Stop Loss, optional Take Profit, Friday close, spread protection fitted to the symbol's own spread (× 2, floor 20 points) and a one-hour pause after exit; its indicator pools hold MT5's own indicators and the market's Bar Open / Bar Close points only — no volume readers, no bands SBP composes from an average and an ATR (Keltner, STARC, Fixed Bands) or Donchian Channel, no differential lines, no indicator SBP derives from a proxy handle (Bulls Bears Power, Rate of Change, Moving average difference, Trix differential) and no price-action or previous-level readers |
| Grid Demo | A fixed 0.01-lot entry, required Take Profit, required grid averaging down (100%), required Max Open Positions with a range of 2–20, required Min Time Since Entry fixed to Hours with a range of 1–24, and No Indicator Exit |
Built-in templates are read-only: editing works on your browser's copy. Save or Save as... creates a personal named copy in your account, never overwriting a built-in or another saved template. Loading is undoable. Required features keep their remembered optional probability for later edits, but their inclusion is always required.
Grid Demo's Grid Take Profit unit is fixed to Account ccy, with the value ranging from 5 to 50 in steps of 5. The Grid feature also supports Pips when you edit the template. It includes no Stop Loss; Grid has no separate account-currency stop, so add the Stop Loss feature separately if needed. Grid strategies may be very risky: always test one in the MT5 Strategy Tester with "Every tick based on real ticks" before trading.
The page recognises the working template when it opens. If the template stored in this browser is byte-identical to a built-in's content, the page links that built-in; if it matches none but is byte-identical to one of your saved templates, it links that record. The toolbar then names it and the row is marked Loaded, instead of reporting a template nobody saved. The content decides, never the name, a built-in wins over a saved record holding the same bytes, and the newest matching record wins among records. The check runs once per visit: after a Reset or an edit the page stops guessing, and an unrecognised template reads Current template with Default (the standard template) or Not saved beneath it.
Saved templates
The middle of the toolbar always names the working template — Current template when it is not linked to a saved or built-in one — with its save status below: Saved, Unsaved changes, Default, Built-in, Built-in · modified, Not saved. Hover it to read the status sentence and the comment. Accepted edits are kept in this browser automatically; saving a named template to your account is a separate action.
The Saved templates card in the right column lists your account's templates, newest first, with age and size. Rows look like the Collection page's records: the linked row carries the accent bar and is marked Loaded; the toolbar status says when it has unsaved changes. The small Refresh link in the card header reloads the list from the server.
- Click a row to load that template into the left column. Loading is one undo step: the status line says so, and Undo brings back the template it replaced. An incompatible or damaged saved template is reported like an imported file and changes nothing.
- The row menu (⋮) offers Edit details, Duplicate, Export and Remove. Edit details changes the name and comment without changing the stored strategy settings or the working template. Duplicate copies that row, including its comment, without changing the working template or its link. Removing asks first and never touches the working content; removing the linked template unlinks it, and the page then recognises the content again — a template that is identical to a built-in (or to one of your other saved templates) comes back named and marked Loaded, while one that matches nothing reads Current template with Save available again (saving creates a new record under a name you choose).
- A removal can be undone. After you confirm, the card shows
Removed "Name".with Undo and a cross. Undo re-creates the template — same name, comment and content — as a new record, and links the working template to it again when the working template still holds exactly those bytes. The offer is one level: it stays until you remove another template, restore it, dismiss it, or leave the page. If another template has taken that name in the meantime, the restore is refused with a message and the offer closes. - The Save button on the right of the toolbar stores the working template in your account; it is painted as the primary (blue) button only while there is an unsaved change, and stays a quiet button when a click would write nothing new. Its form asks for a name and optional comment, prefilled when updating a linked saved record. A built-in is saved as a personal copy. It is disabled for the standard default template, unchanged saved content, incomplete values, template errors, locked storage, a signed-out session or an ongoing request. Use Edit details to change only a saved name or comment, even with no template changes.
Ctrl+Sopens the save form too. - Save as... is beside Save, before Reset, not hidden in a menu. It creates a separate named copy and links the working template to that copy. It also works immediately after loading or saving an unchanged non-default template. The original saved template remains unchanged. A full account blocks creating another template but still permits updating an existing one.
- Names are unique per account, compared case-insensitively, at most 60 characters. A name already taken is reported inside the dialog, which stays open with the name you typed; a full account (50 templates) says so before the request.
- Comments are optional, up to 500 characters, and appear under the template name in the saved list and in the tooltip of the toolbar's template name. Save as and Duplicate prefill the source comment. The character counter updates while typing; a failed request keeps both fields for retry. Exported template files carry the comment in their
meta.commentfield, and importing a file brings the comment back as the prefilled comment of the next Save. - Saved templates belong to the account, and the server is the single copy: a signed-out session sees the sign-in note, the list and Save controls are disabled, and the built-ins still load.
Undo and redo
The toolbar's Undo and Redo step through accepted template changes, and their tooltips name the step each would undo. Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y work anywhere on the page, and Ctrl+Alt+Z / Ctrl+Alt+Y do the same as the Editor; while a field has focus every one of them is left to the browser, so Ctrl+Z there is still the field undo.
Only what you accepted is a step: closing a settings form, accepting an indicator pool, adding or removing a feature, pinning or unpinning a preset (a point's preset included), the rule maximum and the Vary generated parameters switch, Reset, an import and loading a saved template. Typing inside an open form, ticking check boxes in the pool form before you close it, and a cancelled form are not steps: leaving the form is the single point that records them, so one undo is one intent.
Every page shortcut — Save included — is ignored while a field has focus or while the name or the remove dialog is open; Ctrl+S also waits while an accepted-but-incomplete value is still pending in a form. The history is per page visit and is not saved; it holds the last 50 states. The ... menu's Restore the previous template covers the reload: each accepted change stores the template it replaced, so the frame from before your last change is one click away even in a fresh visit. An undo closes any open form first and discards its preview, and it is refused while a saved template is still loading or saving, so the answer cannot overwrite the step. Undo restores the template, the working link and its comment. Changes normally settle within a second; saving, loading or importing settles the pending accepted edit immediately so Undo cannot skip the template that was just replaced.
Toolbar and template files
Undo and Redo sit beside the page title. The working template's name and status hold the middle of the toolbar, with Save, Save as... and Reset on the right, followed by the icon-only ... menu.
Reset restores the standard default template, the everyday indicator pools and the default maximum generated period, clears stored per-indicator parameter policies, closes settings and clears the working template's link. Run settings and acceptance criteria are kept; no saved record is overwritten. Undo restores the previous template and link. The standard default template cannot be overwritten by Save, but Save as... stores it under a name without any edit first.
The icon-only ... menu offers:
- Restore the previous template returns the frame the page held before the last accepted change, which is also the way back after a reload (the undo stack itself is not saved).
- Export template downloads a versioned
.sbp-template.jsonfile containing the template, indicator pools and parameter policies, plus the template's comment undermeta, but no run settings or acceptance criteria. Complete incomplete values and repair template errors before exporting. - Import template reads that file, validates it and replaces the template, indicator pools and parameter policies at once — there is no second confirmation; the import is one undo step, so Undo brings the previous template back. Existing run settings and acceptance criteria are preserved, and invalid files do not change the configuration.
Use Editor strategy, the Open Generator shortcut and full Generator reset are not part of this page.
Validation, saving and recovery
Legacy Grid policies for Max positions, Min time interval, account-currency Take Profit and account-currency Stop Loss are silently discarded when loading stored configurations, saved templates or template files. They are not converted into shared strategy features or new Grid Take Profit policies; other invalid fields and policies still report errors.
Errors and warnings appear only when there is a problem, one line per problem. The link after an issue opens the control it is about: an indicator-pool problem says Set indicators and opens that slot's pool form, while every other problem says Fix and reveals the affected settings (a rule-count error focuses the counts, a preset error opens the preset). The link is offered only when the page really has such a control.
The technical handles behind the issues stay available to assistant tools but are never printed on screen: ui_inspect state lists each issue as ERROR: <message> (<handle>) (and warnings as WARNING: ...), and the issue list carries the handle in its Fix button's data-field.
Errors and incomplete values block starting a run; warnings do not. Incomplete values remain visible while selecting other items, and the last valid settings remain saved until they are corrected. Storage failures and locked configurations are reported explicitly.
If the stored configuration is unreadable or unsupported, an exceptional Recover configuration... action appears in the error strip. It replaces the entire unusable Generator configuration with defaults, including pools, run settings and acceptance criteria, in one click and without a further dialog. This is separate from the toolbar's template and pools Reset; each market's last best is kept.
Common problems
| Symptom | Cause |
|---|---|
| Save is disabled | The working template differs in nothing that a save could write: it is the standard default template, unchanged saved content, incomplete or invalid, the session is signed out, the storage is locked, or a request is in flight. The button's tooltip names which |
| A saved template name cannot be saved again | Names are unique per account (case-insensitive, at most 60 characters). The dialog reports the clash and keeps what you typed |
| The Exit rules section is greyed out | The pinned exit point cannot carry rules (a price-level point or No Indicator Exit). Remove that preset, or pin Bar Open or Bar Close |
| The pool form will not close on Apply | An entry-rule or exit-rule pool is empty, so no generated rule could be built. Tick an indicator, or use Everyday indicators |
| The frame reports "Up to 8 rules" but you stored more | The page keeps a stored maximum above the Generator's cap of 8 and reports it as an error; the select shows the stored value. Lower it to 8 or less |
| The toolbar reads Current template after loading a built-in | You edited the frame afterwards, so it is no longer the built-in's bytes. Load the built-in again, or save your version |
| An edit made during a Generator run did not change the strategy | The run keeps the template it captured at Start. The edit is saved for the next run; stop the run or wait for it to finish |