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

    Create your free account to watch the videos →

    What you need
    • 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.

    The short version
    1. Choose a walked-forward system in GSB (Step 0)
    2. GSB File → Supplementary Scripts (TS & MC) → import the latest file into the PowerLanguage Editor
    3. GSB Scripts tab → choose the MultiCharts line (or MultiCharts / WF) → right-click → Copy to Clipboard
    4. PowerLanguage Editor: new signal → paste → compile
    5. Chart: same symbol, bar size, dates and session as GSB, on local time
    6. Insert the signal: bars back exactly 500, same commission and slippage as GSB
    7. Reconcile: net profit, drawdown and trades close to GSB over the same dates
    8. Simulate for at least two weeks, then go live small, and keep checking
    Risk. This is general education, not trading advice. Live trading carries real risk, and you can lose money. GSB and MultiCharts backtests are hypothetical: past results don't guarantee future performance. Never trade money you can't afford to lose.

    Step 0: Choose a system worth deploying

    Be selective before you export anything. Trademaid's advice:

    1. First find the setup (session time, entry mode and secondary filter) with the best out-of-sample statistics.
    2. Then look at the top system of the first few families.
    3. Walk each candidate forward. The brown out-of-sample curve must hold up against the other curves. See Walk-Forward Optimization.
    4. 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.

    1. In GSB, click File → Supplementary Scripts (TS & MC). GSB opens its supplementary scripts folder.
    2. 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).
    3. 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

    1. In GSB, click your system's row in the Unique Systems tab (or the Walk-Forward tab).
    2. Click the Scripts tab.
    3. 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.
    4. 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.
    5. Right-click the script and choose Copy to Clipboard.
    • Choose MultiCharts before you copy. The time code differs between platforms (TradeStation uses BarDateTime, MultiCharts uses Time_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 / WF entry, with Use WF Current Params.
    Older builds have a TradeStation Script tab with Optimization and Walk-Forward sub-tabs instead of the drop-down: use the Walk-Forward one if you've walked the system forward. Newer builds show Copy for match check, Copy for live trading and Copy Selected on the right-click menu instead of Copy to Clipboard. If your menus differ, check Trademaid's current help.

    Step 3: Create the signal in the PowerLanguage Editor and compile

    In MultiCharts, a trading strategy's code lives in a signal.

    1. Open the PowerLanguage Editor and create a new signal.
    2. 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.
    3. Delete any template text, then paste GSB's code (Ctrl+V).
    4. Compile the signal. Fix any errors before going on (see Troubleshooting).
    Trademaid's help doesn't list the PowerLanguage Editor's exact menu items for a new signal or for compiling, and they vary between MultiCharts versions. Follow MultiCharts' help for your version.

    Step 4: Open a chart that matches your GSB data

    If any of these differ from GSB, the results won't reconcile.

    Chart settingSet toWhere it comes from
    SymbolThe market you built on in GSBThe script header's Price Data line names the file and contract
    Bar intervalYour GSB bar size, for example 30 minutesFile name and Mult. in the Price Data line, e.g. Mult.: 30 on 1-minute data
    DatesThe same start and end dates as GSB, plus more than 500 bars before the first trade you compareThe Trading Dates line, and your data file. Nothing is calculated until 500 bars have loaded
    Session timesThe same session as your GSB dataTrademaid's example ends at 3:00pm Central USA time, not 3:15pm
    Time zoneLocal time (your computer's time)Trademaid: TradeStation and MultiCharts charts should be on local time, so every data series uses the same time zone
    VolumeTick count, if the system uses volume indicatorsTrademaid: 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 itThe 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

    1. Insert your GSB signal on the chart.
    2. Open its properties and set the values in the table below.
    3. Click OK and let MultiCharts calculate the backtest.
    PropertySet toWhy
    Bars backExactly 500It must equal MaxBarsBack: 500 in the script header. GSB's code stops with an error if it's any other number, even 501
    CommissionThe same as in GSBOtherwise net profit won't match
    SlippageThe same as in GSBOtherwise net profit and average trade won't match
    QuantityThe same as GSB's Quantity line (1 in Trademaid's examples)Keeps profit figures comparable
    Bars back: two settings, don't mix them up
    The most common reason a GSB signal won't run in MultiCharts, or doesn't match GSB.

    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.

    Not confirmed yet: the exact MultiCharts menu path for bars back, commission and slippage. They're in the strategy or signal properties, but the names move between versions. Check MultiCharts' help.

    Step 6: Reconcile with GSB

    1. Open MultiCharts' strategy performance report for the chart.
    2. Over exactly the same dates, compare net profit, drawdown and number of trades with GSB's Performance tab.
    3. 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.
    For MultiCharts' simulation, broker connection and automated trading settings, follow MultiCharts' own documentation. Trademaid's help doesn't cover them.

    Step 8: Go live, small

    1. Only when the backtest reconciles and the simulation behaves as expected.
    2. Switch the chart's automated trading to your live broker account, following MultiCharts' documentation, and double-check it's the right account.
    3. 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.

    Not confirmed yet: a specific rule from Trademaid for when to stop trading a system. Trademaid's help has an article on how often trading systems need re-optimising. Check Trademaid's current help.

    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 SessionEndTime return 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.

    CheckWherePass when
    System chosenGSBWalked forward, brown out-of-sample curve holds up, slippage and commission allowed for
    GSB functions loadedGSB File → Supplementary Scripts (TS & MC)The latest file imported into the PowerLanguage Editor
    Signal compilesPowerLanguage EditorNo errors
    Chart matches GSBMultiCharts chart settingsSame symbol, bar interval, dates, session and local time zone
    Bars backSignal / strategy propertiesExactly 500, and the chart loads more than 500 bars
    Costs match GSBStrategy propertiesSame commission, slippage and quantity
    Backtest reconcilesMultiCharts' strategy performance reportNet profit, drawdown and number of trades close to GSB over the same dates
    Simulation doneMultiCharts simulation / paper tradingAt least two weeks, trades behaving as expected
    Ready for liveMultiCharts automation settings and brokerCorrect account, small size
    Monitoring routineMultiCharts and GSBDaily check written down, review rules decided in advance
    Before you go live
    • 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.

    Importing GSB Scripts into MultiCharts
    Import the GSB function scripts into MultiCharts (Step 1)

    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.