Automation & Macros
Link Trademaid's macros to the M1 to M6 buttons, run them, read the Macro Log, then edit and make your own
Prefer to watch? This page has video lessons
Module 7: Macros · Training Hub · free with a GSB Pro account
- GSB installed, with a project and price data you've built on by hand (Modules 1 and 2)
- A walk-forward done by hand (Module 3), so you know what the macros are doing for you
- Advanced view on: View → Advanced (Alt+A). Trademaid says that if you can't see the macros, Advanced mode isn't on
- Your login for the Trademaid GSB forum, to download the macros
This page is the Module 7 (Macros) lessons 26 to 32 of the Training Hub, written down. Each section below is one lesson, in order.
1. What macros are, and every macro control
A macro is a list of GSB commands that runs in order, one after another, with no clicking from you. Each macro is saved as a file ending in .gsbmacro, and you link it to one of the buttons M1 to M6. Trademaid says macros can fully automate tasks like market validation. They can load settings, build systems, put the best ones into favourites, and work out statistics. Trademaid's own market guides mostly come down to: click M1, then play.
When to use macros
- Loading a whole set of settings without missing one (a setup macro, section 2)
- Trademaid's recommended build: M1 finds the best indicators, M2 builds systems with them (section 5)
- Measuring a whole batch of systems on the same dates every time (stats macros, section 6)
- Market validation: testing a market on data the build never saw (section 7)
- Running GSB Automation, which drives GSB through these same macros
In this first lesson you don't run anything. You find every macro control and learn which settings to leave on their defaults.
The macro bar at the bottom of the window
Look at the very bottom of the GSB window, under the big green Start button. Trademaid's help colours this row in four parts:
| Control | What it does | For now |
|---|---|---|
| M1 to M6 | Each holds one macro file. Clicking a button picks that macro. Hover over it to see which file is linked | Used from section 2 |
| Macro play and stop | The small green play button starts the macro on the button you picked. The small grey stop button ends a macro early. These are not the big green, yellow and red buttons above, which start, pause and stop building systems | Used from section 2 |
| New, Link, Edit, Unlink, Delete | Create a macro, and link or unlink it to a button | Leave alone until section 7 |
| Macro Group | Opens a list: Macro Group 1, 2 and 3. Each group has its own six buttons, so up to 18 macros can be linked | Leave on Macro Group 1 |

The macro bar (bottom) and the Macros section of the left panel. Here Macro Group 3 is picked and M1 holds m13_cl_GetSFprospects. Trademaid's Crude Oil setup guide
When a Trademaid guide says, for example, group three, M1, pick Macro Group 3 first, then click M1.
Hover over a button to see what's linked
Rest your mouse on a macro button and a small label appears. A linked button shows the macro's name. An empty button says Click to select the Macro file linked to M6 (or whichever button it is). Always hover first, so you know which macro you're about to run.

Hovering over M1 shows the linked macro, here greenMax10
The Macros section of the left panel
In the left panel, scroll down to the section called Macros and click its arrow to open it. It sits under Script, above the Performance Filter sections. It has eight rows:
| Row | What to do | What it is |
|---|---|---|
| User Macros | Leave | Shows the commands of the macro that's loaded, starting with a comment. You read it in section 4 |
| On Opt. Completed | Leave on False | GSB's help box: run macros once optimisation completed. False in most of Trademaid's screenshots. Set it to True only when a Trademaid guide tells you to (section 3) |
| M1 Macros file | Don't type here | The file linked to M1 in the current macro group. Empty until you link a file. It fills in by itself when you do (section 2) |
| M2 to M6 Macros file | Don't type here | The same, for buttons M2 to M6 |
The Macro Log tab
At the top right of GSB, next to Performance, Graphs and Settings, there's a tab called Macro Log. Trademaid says it shows the macro's status and progress, with time stamps. Each line is one command, and the green line is the command running now. Section 3 shows how to read it.
Menus and shortcuts
- Tools → Macro Run (Ctrl+M) runs a macro
- Tools → Macro Cancel (Ctrl+Shift+M) stops one early
- Right-click a systems grid: Run Macro and Cancel Macro, near the bottom of the menu
2. Download and run your first macro
Why start with a setup macro? Trademaid's help puts it simply: GSB has a number of settings, and it's easy to make an error or miss something when you set it up by hand. So Trademaid recommends using a macro to load the settings. The one you'll use fills in everything except the Data section.
Step 1: Forum → Search → repository
Log in to the GSB forum. Click Search in the menu bar near the top of the page. In the Search for box, type repository, then click the Search button near the bottom of the page.
Step 2: Click "file repository"
In the results, click the thread called file repository. This is where Trademaid posts macro files and settings files. Trademaid's other guides link to it whenever they mention the latest macros, so bookmark it.
Step 3: Download and extract
- Scroll to the top of the thread.
- Download the zip. Trademaid's beginners' guide names
m1-250_skipwf_stats_till20191231_is2018.zip. The name may have changed since, so pick the one Trademaid's latest post points to. - Extract it into GSB's default macro folder,
C:\GSB\Data\Settings\Macros(or wherever you keep your macros).
That zip holds five .gsbmacro files. Their names start with m1, m2, m5 and m6: the button each is meant for. There are two m1 files: one does statistics up to 2019-12-31, the other up to 2020-04-07. Start with m6, the setup macro. Trademaid notes the names may differ slightly between versions.
Step 4: Macro Group → Macro Group 1
At the bottom right, click the Macro Group button and choose Macro Group 1. Check that it now says Macro Group 1.
Step 5: Right-click M6 to clear it
Move your mouse over M6 and right-click. This clears any macro already linked to M6. In the Macros section of the left panel, the M6 Macros file row should now be blank. If it was blank already, that's fine.
Step 6: Left-click M6
Now left-click M6 once. Because nothing is linked, GSB opens a Windows Open window listing the files in your macro folder.
Step 7: Pick the m6 setup macro → Open
Click m6-CL-INIDCATORtest_20180228.gsbmacro (Trademaid's spelling), check it appears in the File name box, then click Open. Your folder may hold more files, so check the name carefully. The M6 Macros file row should now show the file name. If it's still blank, go back to Step 5.
Step 8: Click M6, then the small green play
Left-click M6 once more, so it's selected (it turns light blue in Trademaid's screenshots). Then click the small green play button just to the right of M6. Don't click the big green Start button above: that starts building systems.

Click the M button, then the small green macro play button (bottom right), not the big green Start button (top left)
Step 9: Check the Macro Log
The Macro Log tab shows that the macro ran. In Trademaid's example there are two lines, each with a time stamp: line one is SettingsFull, which loads the settings, and line two is a Comment describing the macro. Your left panel is now filled in with Trademaid's settings.
Step 10: File → Save Optimization Settings As
Click File → Save Optimization Settings As, type a name you'll recognise, and click Save. Next time you can open the same settings with File → Load Optimization Settings, without running the macro again.
Load the other macros the same way
For each button: right-click to clear it, left-click it, pick the file, click Open.
- M1: the m1 file that does stats till 2020-04-07
- M2: the m2 file
- M5: the m5 file
You'll use them in section 6.
m3-Final would be included in a GSB release); whether the setup macro needs your price data loaded first; and whether the Macro Log opens by itself. Trademaid's older Macros help also says left-clicking a button un-links it, while the newer step-by-step pages (followed here) say right-click clears and left-click opens the file window.3. Running, stopping and the Macro Log
Four ways to start a macro
| Way | How | When |
|---|---|---|
| 1 | Click the M button, then the small green play | The way you'll use most: Trademaid's "click M1, then macro play". Hover first to check the name |
| 2 | Right-click a systems grid → Run Macro | To run a stats macro on a particular grid. Trademaid runs one from Favorites B, and in another guide from the Walk-Forward tab. Click the tab the guide names first |
| 3 | Tools → Macro Run (Ctrl+M) | Trademaid: if you manually stop GSB and want to run the macro, for example after stopping a build early |
| 4 | On Opt. Completed = True | The macro runs by itself when the build finishes. Keep it False while you're learning, and turn it on only when a Trademaid guide says so |

Run Macro and Cancel Macro near the bottom of the right-click menu
When does the build count as "completed"?
For way 4, the build is complete when it reaches Max. Uniq. Sys. In Trademaid's example it's set to 50, so with On Opt. Completed True the macro runs straight after the fiftieth system. In Trademaid's Crude Oil example, M1 holds the build plus walk-forward macro, and setting On Opt. Completed to True makes GSB pick the top 250 systems and walk them forward automatically.
Reading the Macro Log
| Column | What it shows |
|---|---|
| Index | The line number |
| Time | When that line ran. A blank time means it hasn't run yet |
| Macro | The command and its settings |
- The green line is the command running now. When every line has a time, the macro has finished.
- Trademaid notes the Macro Log won't appear until after you play a macro.
- Lines ending in three dots are just too long for the column.
- Since mid 2019, macros that run walk-forwards wait until all of them are complete. That can take hours: leave GSB alone while it works.
Stopping a macro early
- Click the small stop button, just right of macro play (while a macro runs, play is greyed out and stop is active)
- Or Tools → Macro Cancel (Ctrl+Shift+M)
- Or right-click → Cancel Macro
After you stop one, look at the Macro Log. Lines with a time have already run, so their changes (such as new dates) are already made. Trademaid also notes that cancelling user tasks doesn't cancel walk-forwards. Section 6 shows a real example: Trademaid stops a macro part way, then runs M2 to put the dates back.
A cancel takes effect only once the current step has finished, so a long step can keep running for a while. Peter's habit (2019) is to start his own macros with a 60-second wait (an Idle command), which gives him time to cancel a build he started by mistake before anything changes.
4. Macro building blocks
A macro is a numbered list of commands, starting at line zero. GSB runs them from top to bottom. The command's name comes first, like Stats or DatesMode, and its settings follow in brackets, for example re-backtest: True. You can see them under User Macros in the left panel, or line by line in the Macro Log. The goal here is to read a macro and know exactly what it does. You won't change anything yet.
The commands the lessons cover
| Command | Kind | What it does |
|---|---|---|
Comment | Housekeeping | A note shown in the log. GSB ignores it. Trademaid starts most macros with one that says what the macro does |
SettingsFull | Settings | Loads a whole set of settings in one line. The m6 setup macro in section 2 uses it |
SettingsPartial | Settings | Loads some settings in one line. Trademaid's methodology example sets # of Indicators 3, the built-in indicators, entry and normalisation modes, dates to 2015-06-30, Max. Uniq. Sys. 50,000 and the minimum Pearson and profit factor |
StartBuildingSystems | Build | Starts the build, just like the big green Start button |
IndicatorTesting | Build | Ranks the indicators and keeps the best ones. With Min=10 it keeps at least ten |
Idle | Housekeeping | Waits. In Trademaid's Nasdaq macro it waits ten seconds |
Favorites | Systems | Puts the systems that pass its filters into a favourites list (A to D), ranked by the Order you pick, keeping the Top number you set. See the row-by-row table below |
SwitchGrid | Housekeeping | Moves to a grid, for example Favorites D |
DatesMode | Dates | Sets which dates the systems are tested on. With re-backtest: False it only changes the setting (Trademaid: "don't re-calculate yet"). With True GSB recalculates every system on those dates |
GlobalDates | Dates | Sets the global start and end dates |
NthMode | Dates | Switches the Nth day mode, for example from no trade to trade |
StartAndEndDates | Dates | Put it as the top line and the start and end dates are changed before the rest of the macro runs |
OverrideOriginalSettings | Settings | Override Original Settings (OOS). Trademaid's help: to run it from a macro, set re-backtest to True |
UseWfCurParams | Walk-forward | Turns a system's current walk-forward parameters (WFP) on or off, so you can compare results with and without walk-forward |
Stats | Results | Saves the current results into a destination letter on the Statistics tab (A to F in Trademaid's examples) |
ParamsStats | Results | Indicator statistics: the best and worst indicators for the current systems |
WalkForward | Walk-forward | Walks forward the systems in a favourites grid |
Sound, Email | Housekeeping | Plays a sound or sends an email, so you know the macro has finished |
Trademaid's older Macros help also lists the macros that came with GSB: IndicatorStats (indicator stats), NthAll (changes Nth to all), wf_stats (stats before and after a walk-forward) and alldatesto20150630 (sets global dates and dates to 20150630).
Newer commands
Peter Zwag (GSB's developer) has added commands since the lessons were recorded. Look for them in the Add list of the Edit Macros window. The build number is the first GSB build that has the command (see the beta builds thread).
| From build | What it does |
|---|---|
| 68.08 | Reset one favourites list (for example Favorites A) instead of all four |
| 68.17 | Load systems from a folder |
| 68.87 | Save systems (last in the command list) |
| Not stated | Save all systems to a CSV file in C:\GSB\Data\Exports\Systems. Run the family command first, so duplicates are removed |
| 70.44 | Export all walk-forward results to a file |
| Not stated | TellAutomationThatGsbFinished: tells GSB Automation this GSB is done, so Automation can move on without waiting for slow stats steps at the end of the macro |
The Favorites command, row by row
Trademaid's example puts the top 1,000 systems, ranked by fitness, into Favorites A:
| Setting | Trademaid's example | What it means |
|---|---|---|
| Destination | A | The favourites list to fill: A, B, C or D |
| Type | GD | The rating the systems get. GD is how the favourites columns (FvA to FvD) show Yes, Good |
| Min. Avg. Trade | 0 | A system's average trade must be at least this |
| Min. Net Profit | 1 | Net profit must be at least this |
| Max. Drawdown | -1,000,000,000 | In practice, no limit |
| Min. Pearson | 0.98 | A very straight equity curve |
| Min. Profit Factor | 1.5 | |
| Min. Trades Count | 100 | |
| Max. Trades Count | 1,000,000 | In practice, no limit |
| Min. Net Profit / Drawdown | Left wide open | |
| Order | Fitness | How the passing systems are ranked. Since about version 53.00 (late June 2019), VSS and VS scores can also be used |
| Top | 1000 | How many of the ranked systems to put into the list |
So this command says: of the systems that pass, put the top 1,000 by fitness into Favorites A. The ratings are the same ones you set by hand with right-click → Favorite A to D:

Right-click → Favorite A to D: No, Yes Good, Yes Very Good or Yes Excellent
Re-backtest: change only, or recalculate
Many commands have a re-backtest setting. In Trademaid's stats macro, one line is DatesMode 1900-01-01 to 2018-02-28 with re-backtest False: change the setting, don't recalculate yet. That saves time when the next command recalculates anyway. A later line is 2018-03-01 to 2019-02-28, Dates Mode TRD (trade), re-backtest True: GSB recalculates every system on just those dates, the first out-of-sample year. It's the same choice GSB gives you when you change Dates Mode by hand:

By hand: Yes changes and re-backtests now, No changes only and re-backtests later, Cancel does nothing
Putting it together: a stats macro
Read a whole macro from Trademaid's Crude Oil stats guide, line by line. It's here to teach macro syntax. Don't copy the method: section 6 explains why.
Comment: what the macro doesFavorites: the top systems into Favorites DSwitchGrid: move to Favorites D- Lines 4 to 6: set the in-sample dates without recalculating, then
OverrideOriginalSettingsand recalculate Statsdestination A (in-sample)- Then each
DatesModeline with re-backtest True is followed by Stats B, C and E (out-of-sample periods)
GD means "Yes, Good"; how VSS / VS appear in the Favorites command; whether Stats destinations now go to H (Stats G and H were added in 52.18); exactly what OverrideOriginalSettings does in the stats macro; which walk-forward types WalkForward can use; and whether the 2019 command list is still complete.5. The two-macro system build
This is Trademaid's recommended way to build systems today, from its Ultra-quick guide for Natural Gas. Trademaid found much better results by testing the indicators first, then building systems with only the best of them. M1 builds systems just to rank the indicators and keeps the best 10. M2 then builds the real systems, and the best go into Favorites D. GSB Automation repeats this in batches (Module 5, lesson 1).
Before you start
- GSB standalone is simplest.
- Or a manager plus workers: every extra worker multiplies the speed. Allow about 10 GB RAM per worker plus about 4 GB for the manager.
Step 1: File → Load Optimization Settings
Click File → Load Optimization Settings. The window opens in C:\GSB\Data\Settings\Optimization\Manager. Click NG_20250717_SysBuild, then Open. Trademaid's guide lists similar files for Gold and Crude Oil.
Step 2: Click M1, then macro play
Hover over M1 to check the name, click it, then click the small macro play button. This builds 2,500 systems to find the best 10 indicators. Trademaid: 24 minutes on an i9 13900, GSB standalone. Trademaid says you can skip this step, but you'll get significantly weaker systems.
Watch the Macro Log. In the Nasdaq version of the same macro:
StartBuildingSystemsstarts the buildIndicatorTesting(Min=10) ranks the indicators and keeps at least tenIdlewaits ten seconds
The macro then saves a new settings file with _green on the end: NG_20250717_SysBuild_green. The Built-In Indicators row shows Main: 10. Trademaid notes the top 10 vary a lot each time you run it.
Step 3: Close GSB, open a new GSB, open the _green file
Close GSB and open another GSB. Open NG_20250717_SysBuild_green with File → Load Optimization Settings. Check the Opt. Settings row at the bottom of the left panel: its name should end in green.
Step 4: Click M2, then macro play
This builds another 2,500 systems using only the ten indicators from Step 2. The best go into Favorites D. Trademaid: 9 minutes with Step 2 done, slower without.
Step 5: M3 (m3-Final) tidies up
Trademaid's July 2025 update adds a third macro, m3-Final, on M3. Peter explained it in September 2025: for the NG, GC and CL settings, it runs the family command on Favorites D, which removes systems that differ only in their parameter values, and puts the result in Favorites A. So Favorites A is the list to sort afterwards. Peter also says 2,500 systems per pass is enough.
If your install doesn't have m3-Final, do the same job by hand: clear Favorites A, change Favorites D to Dates Mode All, and run the families command.
- Favorites A: Ctrl+A, right-click → Favorite A → No
- Favorites D: Ctrl+A, right-click → Dates Mode → All (about a minute; watch the right side of GSB)
- Right-click → Create/Update Family (optional but recommended)

Right-click → Create/Update Family. A family is a group of systems with the same indicators but different parameters
The same pattern on the Nasdaq
Trademaid's Nasdaq guide uses the same pattern with different settings: M1 holds greenMax10, M2 the nct3-300 build macro, and M3 the custom parameters macro. Max. Uniq. Sys. is 20,000 and Max. Run Time is 24:00, so the test stops after a day even if it hasn't made 20,000 systems.
Then you choose, by hand
The macros stop there. In Favorites A, click the NP/DD-F column to sort it. Look for a high net profit to drawdown ratio and a high Pearson's correlation to a straight line. Then walk forward the ones you like (Walk-Forward Optimization) and read them on Selecting Trading Systems. These are hypothetical backtest results, and past results don't guarantee future performance.
- If you skipped m3-Final and Favorites D holds only a few systems, look in Favorites C too.
- Choose using NP/DD, Pearson and the walk-forward curves.
- A selection macro can work as a filter across periods: add a criterion, change the dates or the Nth setting, and run it again.
- To run stats on just a few systems, put them in a favourites list first. Highlighting rows doesn't limit what the stats cover.

A favourites grid sorted by NP/DD-F (net profit / drawdown, full period)
NG_20250717_SysBuild, its _green file and m3-Final ship with your GSB install or trial (Trademaid notes its guide may differ from the trial version), and whether m3-Final does the same job for markets other than NG, GC and CL.6. Stats macros and the macro methodology
This is the older method. The stats macros below come from Trademaid's Crude Oil guides. Keep reading them to learn how stats macros work, but build with the two-macro method in section 5. Peter Zwag has changed his advice since:
- The old CL macros choose favourites inside the in-sample period, so Peter says they shouldn't be used (March 2023). Copy the current NQ or supplied macros instead.
- He now looks only at Stats A (in-sample) and F (the whole out-of-sample period) (December 2023).
- He advises against building 50,000 systems in one go (March 2024). Section 5 uses 2,500 per pass.
Trademaid's approach is to test thousands of systems and see what they do collectively. A stats macro runs the same steps on the same dates every time, so you get a fair benchmark for a market. Then change one thing at a time, run it again, and see if results improve. The dates below come from Trademaid's guides, so yours may differ.
The beginners' stats macro (the macros from section 2)
- After building 50,000 systems, click M1 (the m1-250_skipwf stats macro), then the small green play. Click the Macro Log tab to follow it.
- The
Favoritesline puts the top 250 into Favorites D. The Favorites tab label shows one count per list, A, B, C, D: here(0,0,0,250). - The Statistics tab fills in: A in-sample (1900 to 2018-02), B 2018-03 to 2019-02, C 2019-03 to 2019-12, E 2020. Hypothetical results only.
- Before families, click M2, then play. In this set M2 is
m2-alldatesto20180228. Trademaid says it's critical to create families using in-sample data. To check: Graphs, set the X axis to Trade Date, and the curve should end at February 2018.
The methodology macro set
Trademaid's Methodology page uses a bigger numbered set, all in Macro Group 1:
| Button | Macro | What it does |
|---|---|---|
| M1 | m1-build+wf250… | Builds, then walks forward the top 250 |
| M2 | m2-alldatesto20150630… | Puts all dates back to 2015-06-30 (in-sample) |
| M3 | m3-wf_stats | Stats with and without walk-forward into Stats A to F |
| M4 | m4_post2018_2021 | Stats from 2018 to 2021 |
| M5 | m5-Astab-C_top90_2FavD | Top 90 by Anchored Stability (Coarse) into Favorites D |
| M6 | m6-Vss_top91_2FavD | Top 91 by VSS into Favorites D |

The methodology set linked in Macro Group 1. Here M4 (the fast no-walk-forward version) is selected, then macro play. Trademaid's fast Crude Oil guide
Run order
- Run M1. It fills Favorites A to D and walks forward the top 250.
- Verify them on noisy data, as in Module 3.
- Click the Walk-Forward tab, Ctrl+A, right-click and add them to favourites.
- Run M3 from the Walk-Forward tab: in-sample and out-of-sample stats, with and without walk-forward, into Stats A to F.
- Run M5 (top 90 by Anchored Stability Coarse into Favorites D), then M3 again.
- Run M6 (top 91 by VSS into Favorites D), then M3 again.
- Record each set of stats in a spreadsheet. Run the macro of whichever group did best again, to put it back in Favorites D.
- Put the dates back with M2, then create families.
A shortcut: M4 skips the walk-forward
Walk-forwards take hours, so Trademaid's fast Crude Oil method clicks M4, then play, instead of M1. Its m4-250_nowf macro does the stats without the walk-forward, leaving 250 systems in Favorites D. M4 may be new to you: right-click M4 to clear any old macro, and link the new one first.
- Results poor? Trademaid says stop and recheck your settings.
- Results good? Run M2 to put all dates back to 2015 (Trademaid calls this critical after the shortcut), then Favorites D → Ctrl+A → walk forward all 250, then run M3 for the stats.
Macros in other groups
Some guides use the other groups. The Crude Oil setup guide says "run macro 13", which is M1 in group 3: click Macro Group, choose Macro Group 3, hover over M1 to check it's m13_cl_GetSFprospects, then click M1 and play. Always check the group before you click.

Macro Group 3, M3 selected: the M3 Macros file row shows the m15 macro
For how the older method then picks from Favorites D (M5 top 90 by Anchored Stability Coarse, M6 top 91 by VSS, families), and how Peter selects today, see Selecting Trading Systems.
7. Editing and making your own macros, safely
Ground rules
- Save your settings first: File → Save Optimization Settings As.
- Start from a copy of a Trademaid macro that already works, not a blank one.
- Change one thing at a time, and save under a new file name, so the original stays safe.
- Test it on a small build (Trademaid's own example uses Max. Uniq. Sys. 50) before trusting it with 50,000 systems.
New, Link, Edit, Unlink, Delete
Trademaid's help says a macro can be created, and linked or unlinked to a button. In the lesson: New starts a new macro, Link attaches a macro file to a button, Edit opens a macro so you can change it, and Unlink takes it off the button. Trademaid doesn't describe Delete, so leave it alone. You can always unlink instead.
The Edit Macros window
- The title shows the file name, for example
Edit Macros - test2.gsbmacro. - On the left: the list of commands, in run order. The up and down arrows move the selected command.
- On the right: the selected command's settings.
- Add puts in a new command, Remove deletes one. OK keeps your changes, Cancel throws them away.
Example: top 1,000 by fitness into Favorites A
- Click Add and choose the
Favoritescommand. - Click it in the list and set Destination
A, OrderFitness, Top1000. Leave the minimums as they are to start. - Click OK.
Save and load macro files
In the Macros section of the left panel, right-click the User Macros row, hover over Macros, and click Save. Give it a new name. Load in the same menu opens a macro file. Don't click Reset To Default there unless you mean to clear it.
Link it to a free button
- Pick a Macro Group with a free button, so you don't overwrite Trademaid's macros.
- Right-click the button to clear it.
- Left-click it, pick your file, click Open.
- Hover to check the name, then click the button and the small play button, and watch the Macro Log.
Tips
- Add a
StartAndEndDatescommand as line 0 and the start and end dates change before the rest of the macro runs. - To use
OverrideOriginalSettingsin a macro, set re-backtest toTrue.
Advanced 1: a market validation macro
From Trademaid's Macros help:
- Build systems from 1900 to 20150630 with Nth day 1, Nth Day Mode no trade and an Nth day period of 80 days: 80 days trading, then 80 days unseen, over and over.
- Max. Uniq. Sys. is 50 and On Opt. Completed is True, so the macro starts after 50 systems.
- It saves Stats A, changes Nth day mode from no trade to trade (to test the unseen days), and saves Stats B. In Trademaid's example that showed −57.3% market degradation.
- Then the dates are inverted to no trade, Nth all, giving results from 20150630 to 20180229, which go into Stats C.
Advanced 2: an eleven-line validation macro
- In-sample into Stats A
- Update the parameter stats (top and bottom third of indicators)
- Change to the 80 days unseen data: the first out-of-sample
- Put it into Stats B
- Second out-of-sample: change dates to 6/30/2015 to 2/28/2018, don't recalculate yet
- Nth mode to all, recalculate
- Put it into Stats C
- Indicator stats again for the second out-of-sample
- Extend the dates to 3/2019
- Dates Mode 1/2000 to 6/28/2018, no trade (so 6/28/2018 to 3/2019 is tested)
- Put it into Stats E
Advanced 3: with and without walk-forward
This log compares walk-forward with no walk-forward on Favorites D. UseWfCurParams False then Stats A gives the result without walk-forward; UseWfCurParams True then Stats B gives the walk-forward result on the same dates. It repeats for each period, filling Stats A to F: the same idea as the m3-wf_stats macro in section 6.

Macro Log of a with/without walk-forward stats macro (2019). Each line has an Index, a Time and the Macro command
Troubleshooting
| Problem | Try this |
|---|---|
| I can't see the macro buttons or the Macros section | Turn on View → Advanced (Alt+A) |
| Clicking play starts a build instead of the macro | You clicked the big green Start button. Use the small green play at the end of the macro bar |
| The wrong macro ran | Check the Macro Group first, then hover over the button to read the linked name |
| Left-clicking a button doesn't open the file window | Something is already linked. Right-click it to clear it, then left-click |
| The M Macros file row stays blank | Go back to Step 5 of section 2 and link again; check the file is in C:\GSB\Data\Settings\Macros |
| No Macro Log | It appears only after you play a macro |
| The macro seems stuck | Look for the green line in the Macro Log. Macros wait for walk-forwards to finish, which can take hours |
| I stopped a macro part way | Lines with a time already ran. Put dates back with the matching Trademaid macro (for example M2) before families |
| A file name in a guide doesn't match mine | Trademaid's names change between versions. Use the one its latest file repository post points to |
| The macro moves on after about 100 systems | GSB may be short of resources: reboot. Also check Max. Run Time and any limit on computations |
| Stats say "saving stats for 10000 systems" | Raise the stats limit to 100,000 |
| "Invalid GSB macro file" | The macro doesn't match your GSB build. Get fresh macros (the Resource Manager downloads updated ones) |
| I edited a macro but nothing changed | Click its M button again to reload it |
| The macro only walked forward 12 systems | Too few passed its filters. Edit the macro's criteria |
| GSB hung during a macro | Don't touch GSB while a macro runs |
The GSB Automation add-on drives GSB through these same macros, running the indicators-first build in batches. Its macros are copied into C:\GSB\Data\Settings\Macros, and any macro it uses must exist in GSB. See GSB Automation.
Next steps
- Building Trading Strategies: building by hand, and where the macro route fits
- Selecting Trading Systems: reading and choosing from Favorites D
- GSB Automation: running the macros in batches
- Trademaid's Macros help, Ultra-quick guide and Methodology
GSB's main tools are its genetic algorithm search, its walk-forward and robustness tests and its export to TradeStation, MultiCharts and NinjaTrader. New to it? See what Genetic System Builder does and how GSB compares with StrategyQuant and Build Alpha.