Export to MultiCharts
Take a GSB system into MultiCharts, 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 MultiCharts, the platform you'll trade on. See Uploading Data to GSB
- MultiCharts, with its PowerLanguage Editor, and a data feed for your market
- A note of your system's details from GSB: ID, data file, bar size, dates, session, commission and slippage. You'll match each one in MultiCharts
GSB's Supplementary Scripts (TS & MC) folder covers both TradeStation and MultiCharts, but MultiCharts needs its own .pla function file and its own MultiCharts script (Steps 1 and 2). If you use TradeStation, see Export to TradeStation.
- Choose a walked-forward system in GSB (Step 0)
- GSB File → Supplementary Scripts (TS & MC) → import the latest file into the PowerLanguage Editor
- GSB Scripts tab → choose the MultiCharts line (or MultiCharts / WF) → right-click → Copy to Clipboard
- PowerLanguage Editor: new signal → paste → compile
- Chart: same symbol, bar size, dates and session as GSB, on local time
- Insert the signal: bars back exactly 500, same commission and slippage as GSB
- Reconcile: net profit, drawdown and trades close to GSB over the same dates
- Simulate for at least two weeks, then go live small, and keep checking
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.
Step 1: Load GSB's functions into MultiCharts
GSB systems use special GSB functions. They must be in MultiCharts before any GSB script will compile. Always load the latest file.
- In GSB, click File → Supplementary Scripts (TS & MC). GSB opens its supplementary scripts folder.
- Find the latest script file. The files are named by date, for example
GSB_ALL_FUNCTIONS_YYYY_MM_DD(older builds:GSB_SCRIPTS_2018_01_01). - Double-click it, or in the MultiCharts PowerLanguage Editor use File → Import, choose the file and click Open.
Full walkthrough with screenshots: Loading GSB Functions. There's also an older video at the bottom of this page.
MultiCharts needs the .pla file. Since build 70.58, import the latest .pla, not the .ELD. The TradeStation functions now use object-oriented EasyLanguage (for example BarDateTime.Format), which won't compile in MultiCharts. Older guides show a single ELD for both platforms.
Step 2: In GSB, copy the system's MultiCharts script
- In GSB, click your system's row in the Unique Systems tab (or the Walk-Forward tab).
- Click the Scripts tab.
- Open the drop-down at the top and choose the line ending in MultiCharts. If you've walked the system forward, choose MultiCharts / WF: Trademaid says the walk-forward settings should be better than the original optimisation settings.
- Read the comment lines at the top. They record the system's ID, its Price Data file and session, MaxBarsBack: 500, the trading dates, commission and slippage. Note them down.
- Right-click the script and choose Copy to Clipboard.
- Choose MultiCharts before you copy. The time code differs between platforms (TradeStation uses
BarDateTime, MultiCharts usesTime_S), so TradeStation code won't work in MultiCharts, or the reverse. - Copy for match check is for reconciling (Step 6). On the same chart its trades should match GSB's at least 99%.
- Copy for live trading is the code you trade. Its trades won't exactly equal GSB's report, because the live code can add trades the backtest doesn't take.
- After a GSB walk-forward, Peter Zwag (GSB's developer) always trades the
/ WFentry, with Use WF Current Params.
Step 3: Create the signal in the PowerLanguage Editor and compile
In MultiCharts, a trading strategy's code lives in a signal.
- Open the PowerLanguage Editor and create a new signal.
- Name it after the system ID so you can match it to GSB later. Starting with a letter, such as
GSB, is a safe habit. - Delete any template text, then paste GSB's code (Ctrl+V).
- Compile the signal. Fix any errors before going on (see Troubleshooting).
Step 4: Open a chart that matches your GSB data
If any of these differ from GSB, the results won't reconcile.
| Chart setting | Set to | Where it comes from |
|---|---|---|
| Symbol | The market you built on in GSB | The script header's Price Data line names the file and contract |
| Bar interval | Your GSB bar size, for example 30 minutes | File name and Mult. in the Price Data line, e.g. Mult.: 30 on 1-minute data |
| Dates | The same start and end dates as GSB, plus more than 500 bars before the first trade you compare | The Trading Dates line, and your data file. Nothing is calculated until 500 bars have loaded |
| Session times | The same session as your GSB data | Trademaid's example ends at 3:00pm Central USA time, not 3:15pm |
| Time zone | Local time (your computer's time) | Trademaid: TradeStation and MultiCharts charts should be on local time, so every data series uses the same time zone |
| Volume | Tick count, if the system uses volume indicators | Trademaid: using tick settings for volume is critical, or indicators such as accumulation/distribution won't match |
| Secondary data (Data2) | Insert it the same way, if the system uses it | The Price Data line lists Data1 and Data2 |
Why local time: exported data is in your computer's local time, and GSB session times (such as the market-on-close time) are in that same time. See the time-zone notes on Uploading Data to GSB.
- QuoteManager sessions in exchange time, charts in local time. Worked example: your PC is on US Eastern time and ES trades 8:30 to 15:15 Central. The session template stays in Central (exchange) time, while the chart and the GSB data show 9:30 to 16:15. GSB's market-on-close time then goes a little before 16:15, for example 16:10.
- Volume history differs by feed. IQFeed and most MultiCharts feeds store only total volume in history, while TradeStation's tick setting splits up and down volume. A system built on TradeStation tick volume can backtest differently in MultiCharts. Peter Zwag's own set-up uses TradeStation data inside MultiCharts.
Step 5: Insert the signal and set its properties
- Insert your GSB signal on the chart.
- Open its properties and set the values in the table below.
- Click OK and let MultiCharts calculate the backtest.
| Property | Set to | Why |
|---|---|---|
| Bars back | Exactly 500 | It must equal MaxBarsBack: 500 in the script header. GSB's code stops with an error if it's any other number, even 501 |
| Commission | The same as in GSB | Otherwise net profit won't match |
| Slippage | The same as in GSB | Otherwise net profit and average trade won't match |
| Quantity | The same as GSB's Quantity line (1 in Trademaid's examples) | Keeps profit figures comparable |
1. The signal's bars back: exactly 500. It must equal MaxBarsBack: 500 in the script header. GSB's code checks it on the first bar and stops with "MaxBarsBack ... must be set to 500 (from Properties for All button, General tab)" if it's anything else. That message names TradeStation's menu; in MultiCharts it's Maximum number of bars study will reference on the Properties tab of Strategy Properties (Trademaid's MultiCharts screenshot; MultiCharts' wiki reaches it by right-clicking the chart → Format Signals). A forum user on MultiCharts 14 cleared the error by setting it to 500.
2. The chart's data: more than 500 bars. Nothing is calculated until 500 bars have loaded. To reconcile, load the GSB dates plus a few months extra. On live charts, keep enough history that the trades still match GSB.
Error messages and fixes: Troubleshooting Centre.
Step 6: Reconcile with GSB
- Open MultiCharts' strategy performance report for the chart.
- Over exactly the same dates, compare net profit, drawdown and number of trades with GSB's Performance tab.
- For a closer look, compare the trade list with GSB's Trades tab.
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.
- Bars back set to 500
- Same price data: prices differ between platforms, even for the same market and bar size. Build on MultiCharts data if you'll trade MultiCharts
- Same bar interval, dates, session times (3:00pm, not 3:15pm, in Trademaid's example) and local time zone
- Same commission, slippage and quantity
- Tick count for volume, if the system uses volume indicators
- The latest GSB functions loaded
Still out after all that? In a long 2020 thread on Trademaid's private forum for buyers, MultiCharts users tracked down mismatches to these less obvious causes:
- Mixed time bases. Every data stream in the workspace must use the same time basis. One user had Data1 on local time and Data2 on exchange time.
- Old contract month. After a rollover, check every stream is on the current contract.
- Entries on the last bar. A trade opened on the session's last bar can show up as an overnight trade and break the match. Stop new entries a little before the close (for example 14:00 for a session ending 14:30), either in GSB when you build or in the code afterwards. MultiCharts' portfolio backtest and chart backtest can also treat these trades differently.
- First bar as well as last. Check the first bar of each day lines up, not just the close.
- Last resort. Delete the symbol, its data, the session template and the symbol cache, then recreate them. If that fails, reinstall MultiCharts: one user's mismatch disappeared on a fresh install.
Step 7: Trade it in simulation first
- Only when the backtest reconciles. Run the signal in real time on a simulated (paper) account.
- 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 8: Go live, small
- Only when the backtest reconciles and the simulation behaves as expected.
- Switch the chart's automated trading to your live broker account, following MultiCharts' documentation, and double-check it's the right account.
- 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 (automation switched off, the wrong account, a lost data connection).
Daily check
- Is the signal still running on the right chart, symbol and account?
- Is the data connection live?
- Did today's trades match what you expected?
Every so often
- Re-run the performance report on the latest dates and compare with GSB, trade by trade.
- 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. Check Trademaid's current help for the latest way to do this. See Portfolio Analyst Pro.
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.
MultiCharts live-trading gotchas
Things MultiCharts users have run into when trading GSB systems live:
- Two stop orders at once. If the system uses extra stop types, GSB code can place two stops together. Use market-if-touched orders, or keep to one stop type.
- Local stop and target emulation uses the broker's prices, so it can fire outside your session. Avoid it, or exit on the next bar rather than leaving a resting target.
- Several systems on one symbol at Interactive Brokers: opposing orders can be rejected as "crossing". Stagger the exits, or use sub-accounts.
- More than one contract: by default MultiCharts applies stops to the whole position, not per contract. Check the stop is sized for that.
- Check session-close exits. A known MultiCharts issue made
SessionEndTimereturn wrong times with the TradeStation data feed. Watch the first few end-of-day exits. - One system per chart, and don't leave "allow up to 10 contracts regardless of entry" switched on.
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 |
| GSB functions loaded | GSB File → Supplementary Scripts (TS & MC) | The latest file imported into the PowerLanguage Editor |
| Signal compiles | PowerLanguage Editor | No errors |
| Chart matches GSB | MultiCharts chart settings | Same symbol, bar interval, dates, session and local time zone |
| Bars back | Signal / strategy properties | Exactly 500, and the chart loads more than 500 bars |
| Costs match GSB | Strategy properties | Same commission, slippage and quantity |
| Backtest reconciles | MultiCharts' strategy performance report | Net profit, drawdown and number of trades close to GSB over the same dates |
| Simulation done | MultiCharts simulation / paper trading | At least two weeks, trades behaving as expected |
| Ready for live | MultiCharts automation settings and broker | Correct account, small size |
| Monitoring routine | MultiCharts and GSB | Daily check written down, review rules decided in advance |
- MultiCharts' backtest reconciles with GSB over the same dates (net profit, drawdown, number of trades)
- Bars back is 500, and commission and slippage match GSB
- The signal has run in simulation for at least two weeks
- 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
- Re-import the latest GSB function scripts (GSB File → Supplementary Scripts (TS & MC))
- Make sure you copied the whole script from GSB and deleted any template text
- Read the error messages for the line numbers
Results very different from GSB
Work through Results don't match? Check these first.
Older video walkthroughs
This video was recorded with an older version of GSB. The steps on this page come first if they differ.
How to import the GSB scripts into MultiCharts so you can use GSB-generated trading systems there.
Next steps
Trading on NinjaTrader instead, or as well? The NinjaTrader page walks through the same deployment with the GSB AddOn.
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.