- Step 1: Configure NinjaTrader + import GSB AddOn
- Step 2: Export price data from NinjaTrader to GSB
- Step 3: Build GSB systems using exported data
- Step 4: Import GSB systems back into NinjaTrader
Why Price Data Matters:
Price data varies between platforms (TradeStation vs NinjaTrader). Even for the same market, timeframe, and chart type, OHLC values differ. Build GSB systems on data from the platform you'll trade on for accurate results.
Part A: Initial Configuration
Configure NinjaTrader 8 and import the GSB AddOn before working with price data or strategies.
1. Import the GSB AddOn
The GSBLib AddOn is the function library that enables GSB-built systems to work in NinjaTrader for live autotrading or simulation testing.
Prerequisites: Download the most current version of GSB and the NinjaScript AddOn from the Resource Manager.
Import Steps:
- Control Center → Tools → Import → NinjaScript Add On
- Navigate to GSB folders and select the most recent file (sort by Date modified)
- Click Open
- Click "Yes" if installation warning appears
- Click "OK" if asked to restart NinjaTrader
- Close NinjaTrader (save workspace if prompted)
- Restart NinjaTrader
Compile the AddOn:
- Open NinjaScript Editor: New → NinjaScript Editor
- Double-click the AddOns folder (top right)
- Double-click the LibGSB AddOn
- Click Compile icon (top center)
- Wait for compile animation to finish (audio confirmation plays)
- Close editor
Success: The AddOn is now imported and ready for use with GSB systems.
2. Configure Options
Time Zone Configuration
For maximum compatibility between GSB, TradeStation, and NinjaTrader, set all platforms to US Central Time. No need to change your PC's local time—configure within NinjaTrader.
- Control Center → Tools → Options
- Categories → General
- Properties → Preferences → Time Zone
- Select: Central Time (US & Canada)
Market Data Configuration
Important for futures trading: While you can backtest on continuous contracts, you can't autotrade live on them. Best practice: merge historical data from prior contracts with the current contract.
- Options → Categories → Market Data
- Properties → Historical → Global merge policy
- Select: Merge back adjusted
- Click OK
3. Trading Hours (Session Templates)
Trading Hours are NinjaTrader's equivalent of TradeStation session templates. Create templates that match those used in TradeStation for compatibility.
Example: Create 0830-1500 Template
- Control Center → Tools → Trading Hours
- Click "add" (bottom left)
- Properties → General → Name: Enter 0830_1500
- Sessions section → Click "add"
- Configure Monday session:
- Start day: Monday
- End day: Monday
- Start time: 08:30 AM
- End time: 03:00 PM
- Check "End of Day (EOD)" checkbox
- Click OK
- Right-click below Monday session → Select "Add Monday Through Friday"
- Click Apply, then OK
4. Global Simulation Mode (Safety)
Global Simulation Mode acts as a safety catch—ensures every trade is placed in simulation mode without sending live orders. Helpful for testing, but must be disabled for live autotrading.
Develop a habit of checking Global Simulation Mode status before enabling strategies. It's frustrating to accidentally stay in sim mode during profitable trading periods.
Check status: Control Center → Tools → Global Simulation Mode
Checkmark indicates it's ACTIVE (simulation mode on)
Part B: Exporting Price Data from NinjaTrader to GSB
Export historical data from NinjaTrader to use in GSB Pro for strategy development.
Step 1: Set Up Chart
- Open new chart: Control Center → New → Chart
- Configure Data Series:
- Click Data Series icon on chart menu
- Set Type (e.g., Minute) and Value (e.g., 30)
- Time frame: Custom Range
- Set Start Date (e.g., 01/01/2000)
- Set End Date (e.g., 29/11/2019)
- Set Trading Hours (session template: e.g., 0830_1500)
- Click OK and wait for chart to load
- Show Date Range:
- Click Properties icon
- General → Font → Check "Show date range"
- Date range appears in top left corner
- Scroll chart to verify start and end dates
Step 2: Export Price Data
- Add Indicator:
- Click Indicators icon on chart menu
- Scroll Available list to find "GSB Price Data Exporter"
- Click "add" (bottom of Configured window)
- Do not change any settings
- Click OK
- Save Data File:
- Save As dialog opens automatically
- Navigate to:
C:\GSB\Data\Price Data\ - File naming convention:
[Contract].[Timeframe].[BarType].[AdditionalData].txt - Example:
ES.30.Minute.0830-1500CentralTime_1May2006-29Nov2019.txt - Click Save
- Clean Up: Remove indicator from chart. Repeat process for different contracts/dates/hours.
Part C: Importing GSB Strategies into NinjaTrader
Deploy your validated GSB systems on NinjaTrader for backtesting and live autotrading.
Unlike TradeStation and MultiCharts which use EasyLanguage/PowerLanguage, NinjaTrader uses C# for strategy development. GSB Pro automatically generates C# code compatible with NinjaTrader 8.
Big thank you to Jason T for his work on these docs and GSB NinjaTrader integration.
Before You Begin: Select Your System in GSB Pro
Before exporting to NinjaTrader, review your system's performance and ensure it meets your criteria:
1. Review System Performance
Examine the equity curve and key statistics to validate the system:

2. Select the System to Export
In the Unique Systems list, identify and select the system you want to deploy on NinjaTrader:

3. Prepare the Strategy Code
Switch to the Scripts tab and prepare to copy the NinjaTrader code:

Pro Tip: Document the system ID, performance metrics, and data parameters before switching to NinjaTrader. You'll need these for verification after import.
Critical Configuration: MaximumBarsLookBack Setting
The Problem: NinjaTrader's MaximumBarsLookBack defaults to TwoHundredFiftySix (256 bars). Unlike TradeStation/MultiCharts which allow custom values like 500, NinjaTrader only offers two options:
- TwoHundredFiftySix (256 bars) - Default, optimized for performance
- Infinite - Unlimited historical data access
How to Set MaximumBarsLookBack to Infinite:
Method 1: In Code (Best Practice):
Add this line in your strategy's OnStateChange() method under State.SetDefaults:
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
// Other default settings...
Description = @"GSB Pro Trading System";
Name = "GSB_YourSystem";
}
}Note: GSB Pro's exported NinjaTrader code may already include this setting. Verify in the generated C# code.
Method 2: UI Settings (After Adding Strategy):
- Right-click chart → Indicators or Strategies
- Select your GSB strategy
- Find Maximum bars look back dropdown
- Change from TwoHundredFiftySix to Infinite
- Click Apply and OK
When to Use Infinite:
- GSB systems with lookback periods > 256 bars
- Strategies using long-period moving averages (100+, 200+ period)
- Systems with ATR, standard deviation, or volatility calculations over extended periods
- Any indicator requiring historical data beyond 256 bars
Alternative: BarsRequiredToTrade
If you need exactly 500 bars (not infinite) for memory efficiency, keep MaximumBarsLookBack = TwoHundredFiftySix and add:
if (State == State.SetDefaults)
{
BarsRequiredToTrade = 500; // Wait for 500 bars before trading
}Then add this check in OnBarUpdate():
if (CurrentBar < 500)
return; // Skip until we have 500 barsPerformance Note: Infinite uses significantly more RAM and CPU than TwoHundredFiftySix. Only use Infinite when your calculations genuinely need data beyond 256 bars.
Step 1: Copy System ID from GSB Pro
Now that you've selected your system, copy the system ID that you'll use in NinjaTrader:
- Click on the Scripts tab
- Select NinjaTrader 8 from the platform dropdown
- Copy the system ID displayed - you'll use this as the NinjaTrader strategy name
Step 2: Open NinjaScript Editor
- In the Control Center, left click New → NinjaScript Editor

Step 3: Create New Strategy
- Click the '+' sign at the bottom of the editor to add a New Strategy
- The New Strategy dialog box will appear - click Next (the button with the > arrow)

Name Your Strategy:
- In the Name field, paste the system ID you copied from GSB
- NinjaTrader will automatically remove spaces, dashes, etc.
- The name must start with a letter, so prefix it with something like "GSB"
- Click Generate

Step 4: Replace Template Code with GSB Code
The NinjaScript editor will generate a strategy template. Now replace it with GSB code:

- Remove pre-generated code:
- Click on the background of the editor
- Select all text using CTRL-A
- Delete all text using Delete or Backspace

- Copy GSB code:
- Return to GSB Pro Scripts tab
- Right click on the script background
- Select Copy to Clipboard
- Paste into NinjaScript Editor:
- Return to the NinjaScript editor
- Right click and paste the code, or use CTRL-V

Step 5: Compile the Strategy
- In the top menu bar, left click the Compile icon

- In the lower left corner, the compile animation will play
- Wait for the animation to cease - an audio confirmation will play when complete

Success: Your GSB strategy is now compiled and ready to use in NinjaTrader.
Step 6: Open a Chart
- From the Control Center, select New → Chart

Step 7: Configure Data Series
Configure the chart to match the data you used when building systems in GSB:
- On the chart toolbar, click the Data Series icon

- Set the correct Data Series (Type and Value) to match your GSB data
- Set the Time frame to match your GSB data
- Under Time frame, select Custom Range
- Match the Start Date, End Date, and Trading Hours (session template) to your GSB data series

Optional: Enable Trade Plotting
If you want to see trades plotted on the chart after applying the strategy:
- Under Trades, select Plot executions: Text and marker or Markers only

Left click OK and wait for the chart to load.
Step 8: Apply Strategy to Chart
- At the top of the chart, left click the Strategies icon
- Left click to select your strategy from the Available window (top left)
- At the bottom of the Configured window, left click add
- The strategy will appear in the Configured list

Configure Strategy Properties:
The Properties fields on the right-hand side will activate. Do not click OK yet.
Set up:
- Account: Select the account you want to trade the strategy on
- For back-testing, the Sim101 account is fine
- For live trading, select a live account you've already added to NinjaTrader
- Enabled: Ensure this checkbox is ticked
Historical fill processing:
- Leave Order fill resolution as Standard
- GSB entries are not intra-bar, so high-resolution fills are not required
- Slippage: If you added slippage in GSB settings when building systems, add that same value here
Order handling:
- Exit on session close: Tick this checkbox if you built systems using Exits → MOC (Market on Close): True
- Exit on session close seconds: Default is 30 seconds. NinjaTrader will close trades 30 seconds before the end of the session. Modify if needed.

Now left click OK.
Order Confirmation: If you get an order confirmation dialog box, click OK to proceed.
Step 9: Verify, Manage, and Analyze Strategy Performance
After applying the strategy, go to the Strategies tab on your Control Center to verify, manage, and analyze performance. From here you can:
- Enable and disable strategies
- Add, edit, and remove strategies
- Monitor multiple strategies without needing multiple charts consuming resources
- View comprehensive performance reports by right-clicking on a strategy and selecting Strategy Performance → Historical

Workspaces for Strategy Monitoring
You can set up different Workspaces to easily switch between:
- A minimal Control Center-only strategy monitor
- A screen full of charts with all your strategies on them
This is a standard NinjaTrader function. See NinjaTrader help for detailed instructions.
Performance Report Analysis:
The Strategy Performance report shows comprehensive statistics. Here's how it maps to GSB Pro:
- Summary: Equivalent to Performance in GSB
- Analysis: Shows similar information to Graphs and Trades in GSB
- Selecting Period → Trades is the same as Graphs → Trade Number in GSB
- Selecting Periods → Daily is the same as Graphs → Trade Date in GSB
Work through the performance report options and compare the data to the same metrics from GSB Pro. Verify that the backtest results match within acceptable variance before proceeding to live trading.
Going Live: Automated Trading
Critical pre-flight checklist:
- Backtest results verified and match GSB Pro within acceptable variance
- Commission and slippage modeled realistically
- Position sizing appropriate for account size
- Risk management rules properly configured
- Simulated trading tested for minimum 2 weeks
- Real-time data feed connected and verified
- Broker connection stable and authenticated
NinjaTrader-Specific Settings
Calculate Mode
Choose when strategy calculations occur:
- On bar close: Most reliable, processes complete bars only (recommended for most systems)
- On each tick: Real-time updates, useful for scalping but can generate false signals
- On price change: Updates on price changes, middle ground option
Order Handling
Configure how orders are managed:
- Entry handling: All entries, Unique entries only
- Exit handling: ImmediatelySubmit, ImmediatelySubmitSynchronizeAccount
- Entry execution: Market, Limit, Stop orders
Common Issues and Solutions
Compilation Errors
If strategy won't compile:
- Ensure GSB_Indicators add-on was imported first
- Check NinjaScript Editor for specific error messages
- Verify NinjaTrader version is 8.0 or later
- Try removing and re-importing both the indicators and strategy
Performance Discrepancies
If backtest doesn't match GSB Pro:
- Verify "Calculate" mode matches your system design
- Check that bar type and interval match exactly
- Ensure session template matches (24-hour vs regular trading hours)
- Review commission and slippage settings
- Compare data sources (different data can produce different results)
Real-Time Execution Issues
If live/sim trading behaves differently than backtest:
- Check "Calculate" mode - use "On bar close" for consistency
- Verify data feed is stable and not missing ticks
- Review order fill assumptions (market orders may slip)
- Monitor NinjaTrader's log tab for errors or warnings
Additional Resources
Next Steps
If you encounter issues with your exported strategies, check the troubleshooting guide:
