NinjaTrader Integration Guide
Take a GSB system into NinjaTrader 8, check it matches GSB, test it in simulation, then go live
Prefer to watch? This page has video lessons
Module 6: Going Live · Training Hub · free with a GSB Pro account
- A system in GSB that you've walked forward and are happy with (see Step 0)
- Ideally, a system built on price data exported from NinjaTrader, the platform you'll trade on. How to export it: Uploading Data to GSB
- NinjaTrader 8 with a data connection, and the one-time setup done: GSB AddOn compiled, Central Time, Merge back adjusted, a Trading Hours template
- A note of your system's details from GSB: its ID, bar size, start and end dates, session, slippage and whether it uses MOC exits. You'll match each one in NinjaTrader
- Since GSB 77.46 (2 September 2026), NinjaTrader 8 is fully supported and out of beta. GSB's full indicator and filter library works for NinjaTrader 8, and Custom Indicator export writes NinjaTrader scripts too.
- 77.46 also corrected how GSB simulates NinjaTrader's order handling (entries, stops, targets, reversals and session-close exits) and fixed several NinjaTrader indicator calculations, so results now match TradeStation and MultiCharts. This applies to systems built or re-optimised in 77.46 or later; systems saved earlier keep the results they were built with, so re-optimise them.
- NinjaTrader strategies from 77.46 check that your computer's time zone matches your price data before they run, and stop with a message if it doesn't.
- On an older build? Update to 77.46 or later before exporting to NinjaTrader.
- Choose a walked-forward system in GSB (Step 0)
- One-time: import and compile the GSB AddOn, set Central Time, Merge back adjusted, Trading Hours
- GSB Scripts tab → NinjaTrader8 → copy the system ID
- NinjaTrader New → NinjaScript Editor → + → Next > → name it
GSB+ ID → Generate - Delete the template code, paste GSB's code (right-click → Copy to Clipboard in GSB) → Compile
- New → Chart → Data Series: match bar size, Custom range dates and Trading hours
- Strategies icon → add the strategy → Sim101, Enabled, Standard, slippage, Exit on session close → OK
- Right-click the chart → Strategy Performance → your strategy → Historical: does it match GSB?
- Simulate on Sim101 for at least two weeks, then go live small
- Check it every day, and keep reconciling with GSB
Step 0: Choose a system worth deploying
Be selective before you export anything. Trademaid's advice:
- First find the setup (session time, entry mode and secondary filter) with the best out-of-sample statistics.
- Then look at the top system of the first few families.
- Walk each candidate forward. The brown out-of-sample curve must hold up against the other curves. See Walk-Forward Optimization.
- Allow for slippage and commission. If you built without them, a flat-looking curve only gets flatter once you add them.
More on picking: Selecting Systems.
One-time setup in NinjaTrader
Do this once per computer, before your first system. The click-by-click steps are on Uploading Data to GSB (NinjaTrader 8, One-time setup), because you need the same setup to export data. Here's what each setting is for.
| Setting | Where | Set to | Why |
|---|---|---|---|
| GSB AddOn (LibGSB) | Control Center: Tools → Import → NinjaScript Add On, pick the newest file, then compile LibGSB in the NinjaScript Editor | Imported and compiled | It's the function library GSB systems need. Without it, GSB strategies won't compile |
| Time Zone | Tools → Options → General → Preferences → Time Zone | Central Time (US & Canada) | Keeps NinjaTrader on the same time zone as GSB and TradeStation. You don't need to change your PC's clock |
| Global merge policy | Tools → Options → Market Data → Historical → Global merge policy | Merge back adjusted | You can't autotrade a continuous futures contract live, so NinjaTrader joins older contracts onto the current one |
| Trading Hours template | Tools → Trading Hours → add | One per GSB session, for example 0830_1500: Monday to Friday, 08:30 AM to 03:00 PM, End of Day (EOD) ticked | NinjaTrader's version of a session template. It must match the session you built on in GSB |
| Global Simulation Mode | Control Center: Tools → Global Simulation Mode | On (ticked) while testing. Off only when you're ready to go live | A safety catch: while it's ticked, every order stays in simulation and nothing goes to your broker |
- Get the latest GSB and the NinjaScript AddOn through the Resource Manager first. When importing, sorting by Date modified helps you pick the newest file.
- If NinjaTrader asks to save the workspace when you restart after the import and you're unsure, Trademaid suggests Yes to all.
- The AddOn only works once it's compiled:
New → NinjaScript Editor, double-click AddOns, double-click LibGSB, click Compile.
In the Control Center, click Tools. A tick to the left of Global Simulation Mode means it's on. While it's on, every order stays in simulation, which is what you want while testing. Once you go live, it's easy to leave it on by mistake and keep trading in simulation without noticing. Check it every time before you enable strategies.
Step 1: In GSB, open the system's NinjaTrader script
- In GSB, click your system's row in the Unique Systems tab (or the Walk-Forward tab).
- Check its equity curve on the Graphs tab one last time.
- Click the Scripts tab.
- Open the drop-down at the top and choose the line ending in NinjaTrader8. If you've walked the system forward, choose the one ending in NinjaTrader8 / WF: Trademaid says the walk-forward settings should be better than the original optimisation settings.
- Read the comment lines at the top of the script. They record the system's ID (for example
20191129-193756-636342-P4hEE), its Price Data file and session, MaxBarsBack: 500, the trading dates and the slippage. Note them down. - Select the ID and copy it (Ctrl+C). It becomes the strategy's name in NinjaTrader.

Select the system and check its curve on the Graphs tab (GSB 1.0.56)

Scripts tab: choose the NinjaTrader8 line in the drop-down. Walked-forward systems also list a NinjaTrader8 / WF line
Step 2: Create a new strategy in the NinjaScript Editor
- In the NinjaTrader Control Center, click
New → NinjaScript Editor.

Control Center: New → NinjaScript Editor
- Click the + sign at the bottom left of the editor to add a new strategy.

The + sign is at the bottom left. LibGSB under AddOns shows the GSB AddOn is installed
- The New Strategy window opens. Click Next >.

New Strategy: click Next >
- In Name, paste the system ID. NinjaTrader removes the spaces and dashes.
- The name must start with a letter, so type
GSBin front. For example,GSB20191129193756636342P4hEE. - Click Generate.

Paste the ID, put GSB in front, then click Generate
Step 3: Replace the template with GSB's code
NinjaTrader generates a strategy template. You don't need any of it.
- Click on the background of the code, press Ctrl+A to select everything, then press Delete. The editor is now empty.
- Go back to GSB's Scripts tab (still on the NinjaTrader8 line).
- Right-click the script background and choose Copy to Clipboard.
- Go back to the NinjaScript Editor. Right-click and paste, or press Ctrl+V.

The generated template: select all of it and delete it

In GSB: right-click the script → Copy to Clipboard
Step 4: Compile
- Click the Compile icon in the editor's top toolbar.
- An animation plays in the lower left corner. When it stops, a sound plays. That means it has compiled.
- Your strategy now appears under Strategies in the NinjaScript Explorer on the right. Close the editor.

GSB's code pasted in. Click Compile in the top toolbar

The compile animation plays at the bottom left, then a sound plays
Compile errors? See Troubleshooting below.
Step 5: Open a chart that matches your GSB data
If any of these differ from GSB, the results won't reconcile.
- In the Control Center, click
New → Chart. - Click the Data Series icon in the chart's toolbar.
- Fill in the settings in the table below, then click OK and wait for the chart to load.

Control Center: New → Chart

The Data Series icon in the chart toolbar
| Data Series setting | Set to | In Trademaid's example |
|---|---|---|
| Instrument | The market you built on, for example ES | ES 12-19 |
| Type and Value | Your GSB bar size, for example Minute and 30 | Minute, 30 |
| Load data based on (under Time frame) | Custom range | Custom range |
| Start date and End date | The same dates as your GSB data | 01/01/2000 to 29/11/2019 |
| Trading hours | The template that matches your GSB session | 0830_1500 |
| Plot executions (under Trades) | Text and marker or Markers only, if you want to see the trades | Text and marker |

Type, Value, Custom range, dates and Trading hours

Optional: Trades → Plot executions
Step 6: Add the strategy and set its properties
- Click the Strategies icon in the chart's toolbar.
- In the Available list (top left), click your strategy.
- Click add at the bottom of the Configured list. The strategy moves into Configured and its properties appear on the right.
- Don't click OK yet. Set the properties in the table below first.
- Click OK. If an Order Confirmation message appears, click OK.

The Strategies icon in the chart toolbar

Click your strategy in Available, then add
| Property | Use this | In Trademaid's screenshot |
|---|---|---|
| Account | Sim101 for testing. A live account (already added to NinjaTrader) only when you go live | Sim101 |
| Enabled | Ticked | Ticked |
| Order fill resolution | Standard (leave it). GSB entries aren't intra-bar, so high-resolution fills aren't needed | Standard (Fastest) |
| Slippage | The same slippage you used in GSB. 0 if you built without slippage | 0 |
| Exit on session close | Tick it if you built the system with Exits → MOC (Market on Close): True | Ticked |
| Exit on session close seconds | Default 30: NinjaTrader closes trades 30 seconds before the session ends. Change it only if you need to | 30 |
| Calculate, Start behavior, Entries per direction, Maximum bars look back, Bars required to trade | Trademaid's guide doesn't ask you to change these. Leave them as they appear | On bar close, Wait until flat, 1, 256, 500 |

Properties set for testing: Sim101, Enabled, Standard (Fastest), slippage 0, Exit on session close, 30 seconds

If this message appears, click OK
Step 7: Check the strategy is running
- When the strategy is active, its name shows at the top left of the chart.
- If the name has (D) in front, it's disabled and won't trade. Click the Strategies icon, tick Enabled and click OK again.
- Use the scroll bar at the bottom of the chart to slide through history and see the entries and exits.

Running: the name shows at the top left

(D) in front means disabled

Trades plotted on the chart: entries, and Exit on session close
Step 8: Reconcile with GSB
Before any simulation, check that NinjaTrader's backtest reproduces GSB's.
- Right-click the chart (or the strategy in the Control Center's Strategies tab).
- Choose
Strategy Performance → your strategy → Historical. - The report opens on Summary. Over exactly the same dates, compare net profit, drawdown and number of trades with GSB.
- To compare trade by trade, use the views in the table below.

Right-click → Strategy Performance → your strategy → Historical
| In NinjaTrader's report | Same as in GSB |
|---|---|
| Summary | Performance tab |
| Analysis → Period → Trades | Graphs → Trade Number |
| Analysis → Periods → Daily | Graphs → Trade Date |

Summary: compare net profit, max. drawdown and total # of trades with GSB. Note commission is $0 in this example. Hypothetical results only
Results don't match? Check these first
Small differences are normal. Big ones mean something in the setup is different. Don't go further until you've found it.
- Data Series: same Type, Value, start date, end date and Trading hours template
- Time zone
Central Time (US & Canada)and Global merge policyMerge back adjusted - Same slippage and commission. Exit on session close ticked if you built with MOC exits
- The latest GSB AddOn, imported and compiled
- Same price data: prices differ between platforms, even for the same market and bar size. Build on NinjaTrader data if you'll trade NinjaTrader
- Volume-based indicators (such as accumulation/distribution): the common NinjaTrader data feeds don't carry historical up and down volume, so systems that lean on volume (many Nasdaq systems, for example) lose a little in NinjaTrader. Build on the data feed you'll trade
Step 9: Trade it in simulation first
- Leave the strategy on the Sim101 account, with Global Simulation Mode on, and let it run in real time.
- Simulate for at least two weeks (our guideline, lesson 23). Longer is fine.
- Check each simulated trade matches what GSB would have done, and note the fills you get.
Step 10: Go live, small
- Only when the backtest reconciles and the simulation behaves as expected.
- Open the strategy's properties again (Strategies icon on the chart, or edit it from the Control Center's Strategies tab) and set Account to your live account. It must already be added to NinjaTrader.
- Make sure Enabled is ticked, and click OK.
- Click Tools in the Control Center and make sure Global Simulation Mode is off (no tick next to it). While it's ticked, the strategy can't place live trades.
- Start small. Peter Zwag's observation is that traders who over-leverage do not survive. Watch the first live trades closely.
Monitoring once you're live
Expect the brown line, not the best line. Trademaid expects real-time trading to look more like the walk-forward out-of-sample (brown) curve than the original backtest. Judge live results against that.
What can go wrong: systems can and do fail out of sample, real slippage may be higher than you assumed, overnight gaps can push trades past stops and targets, and simple slips happen (a disabled strategy, the wrong account, a lost connection).
Daily check (two minutes)
- Open the Control Center's Strategies tab. Each row shows the instrument, data series, position, account, connection and whether it's enabled. It's a good place to watch several strategies without lots of charts open.
- Check every strategy is Enabled, on the right Account, and connected. On a chart, no (D) before the name.
- Check
Tools → Global Simulation Modeis off for live strategies. - Glance at the Log tab for errors or warnings.

Control Center → Strategies tab: enable, disable, add and edit strategies here
Tip: NinjaTrader Workspaces let you switch between a minimal Control Center-only monitor and a screen of charts. See NinjaTrader's help for how.
Every so often
- Re-run
Strategy Performance → Historicalon the latest dates and compare with GSB, trade by trade (Analysis → Period → Trades against GSB's Graphs → Trade Number). - Keep a note of the slippage and commission you actually pay, and compare them with what you assumed in GSB. Investigate any mismatch straight away.
- To track several systems together, get them into Portfolio Analyst Pro: in GSB, right-click the system and save it, with Export To Portfolio Analyst set to True in the Save Systems window. Its Market Performance report shows each system's recent results. Check Trademaid's current help for the latest way to do this.
Guardrails
- Keep size modest. In one of Trademaid's portfolio examples, no system is allowed more than one contract, because systems can and do fail.
- Write your review rules down before you go live, so you're not making them up during a drawdown. Judge drawdowns against the walk-forward history.
- Trademaid normally wouldn't trade several systems from the same family live.
- Review every system, not just the winners, to avoid survival bias.
How often to re-optimise: rarely. Peter Zwag's view is that GSB systems don't need frequent re-optimisation, and that an anchored walk-forward suits them.
Deployment checklist
Go down the list. Every row must pass before real money is at risk.
| Check | Where | Pass when |
|---|---|---|
| System chosen | GSB | Walked forward, brown out-of-sample curve holds up, slippage and commission allowed for |
| One-time setup done | NinjaTrader Tools menu | AddOn compiled, Central Time, Merge back adjusted, Trading Hours template made |
| Strategy compiles | NinjaScript Editor | No errors, and the compile sound plays |
| Chart matches GSB | Data Series | Same instrument, Type, Value, Custom range dates and Trading hours |
| Properties match GSB | Strategies dialog | Sim101, Enabled, Standard fills, same slippage, Exit on session close if MOC |
| Strategy is running | Top left of the chart | Strategy name shows, with no (D) in front |
| Backtest reconciles | Strategy Performance → Historical | Net profit, drawdown and number of trades close to GSB over the same dates |
| Simulation done | Sim101 account | At least two weeks, trades behaving as expected |
| Ready for live | Strategies dialog and Tools menu | Live account selected, Global Simulation Mode off (no tick), small size |
| Monitoring routine | Control Center Strategies and Log tabs | Daily check written down, review rules decided in advance |
- NinjaTrader's historical backtest reconciles with GSB over the same dates (net profit, drawdown, number of trades)
- Slippage and commission match what you used in GSB
- The strategy has run on Sim101 for at least two weeks
- Global Simulation Mode is off (no tick) for live trading
- You're starting small and not over-leveraging
GSB results are hypothetical backtests. Past or hypothetical results don't guarantee future performance.
Troubleshooting
Compile errors
- Make sure the GSB AddOn (LibGSB) was imported and compiled before you add GSB strategies
- Use the most recent AddOn file from the Resource Manager download (sorting by Date modified helps)
- Make sure the strategy name starts with a letter (put
GSBin front of the ID) - Make sure you deleted all of the template code and pasted the whole GSB script
- Read the NinjaScript Editor's error messages for the line numbers
- GSB's NinjaScript names the library version it needs, in a line such as
int GSB_Scripts_Version = LibGSB.GSB_Scripts_2023_10_18;. An error like "type X does not exist in LibGSB" means your AddOn is older than the code. Import the matching or newerGSB_NinjaScript_yyyy_mm_ddAddOn fromC:\GSB\Supplementary Scripts (TS & MC)(older builds:C:\GSB\GSB (Managers)\NinjaTrader8 Code\), then compile LibGSB again
Strategy name starts with "(D)"
The strategy isn't enabled. Click the Strategies icon, tick Enabled and click OK again.
Results very different from GSB
Work through Results don't match? Check these first.
No live trades, but no errors
Check Global Simulation Mode, the Account (still Sim101?), Enabled, and the connection in the Strategies tab.
GSB Price Data Exporter gives an error
The data file is usually open in another program. Close it, and close the NinjaTrader chart running the exporter, then export again.
Next steps
Need to export data from NinjaTrader to build on? See Uploading Data to GSB. Still stuck? See the troubleshooting guide or contact support.
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.