Automation guide
Wiring a .rts to Interactive Brokers.
Every strategy in this catalog is a plain-text RealTest .rts file. To trade it live, you license RealTest, install the bundled OrderClerk bridge, point it at an Interactive Brokers account (TWS or Gateway), and run the daily order chain after the US close. The walkthrough below documents the setup, the daily loop, and the gotchas that surface first.
Three programs, one daily handshake.
RealTest generates tomorrow's orders. OrderClerk turns that file into broker API calls. Interactive Brokers fills them. The handoff happens once a day, after the US close.
Reads end-of-day data, runs your .rts strategy, emits an orders CSV for the next session.
A purpose-built replacement for IB Basket Trader. Loads the CSV, talks to TWS/Gateway over the IBKR API, transmits orders, and tracks every fill back into a round-trip trade list.
Receives the API calls, fills market-on-open orders, posts confirmations and updated positions.
OrderClerk tags every order with its Strategy name and preserves that label through to fills. It maintains a round-trip trade list (OrderClerkTrades.csv) that RealTest reads on the next morning's run so each strategy sizes its new orders against its own actual positions - not the merged blob. That's how multi-strategy portfolios stay coherent in live trading. Buy two strategies here, run them both through the same OC instance, no extra plumbing.
The stack adds nothing you don't already pay for.
If you already own RealTest, OrderClerk is bundled - no extra license. IBKR has no platform fee. The only added line item is brokerage commissions, which the strategies on this site already bake into their backtested returns.
Sources: RealTest pricing - mhptrading.com/purchase.html. OrderClerk download + official docs - mhptrading.com docs; latest build link in the RealTest Forum.
Setup, step by step.
Steps 1 through 4 happen on initial setup. Steps 5 through 7 are the daily loop you run (or automate) every trading day. First-time setup duration depends on how much of the stack is already in place: an existing RealTest license plus a funded IBKR account with API enabled is the fastest path; a fresh stack (licensing, install, Norgate subscription, IBKR application/funding, TWS API config, paper test) takes substantially longer.
The steps below are a condensed buyer-friendly walkthrough. MHP's official OrderClerk docs and the OrderClerk User Guide PDF in your install folder are the authoritative references - consult them whenever this page and the docs disagree.
OrderClerk ships with RealTest. Install it to its default location at C:\OrderClerk\ - the OC template at C:\RealTest\OrderClerkTemplate.csv is the starting point for your basket format.
- Confirm install: open OrderClerk.exe. You should see the main window with Load Order Lists, Place Orders, and Cancel All buttons.
- OrderClerk monitors every subfolder of C:\OrderClerk\ for live order files. Never put reference docs there - OC will eat them on cleanup.
One subfolder under C:\OrderClerk\ per live strategy. This is where the .rts file runs and where the daily orders CSV is written.
- Example: C:\OrderClerk\nas100_mr\ for the Nasdaq-100 mean-reversion strategy.
- Copy the purchased .rts into this folder (keep your research copy elsewhere - this one is for live execution only).
Tell RealTest to emit orders in OrderClerk's basket format, into the same folder the script lives in.
OrderSettings:
OrdersMode: OrderClerk
OrderClerkFolder: ?scriptpath?
OrdersNetLiq: C:\OrderClerk\netliq.csv
HolidayList: us_auto- ?scriptpath? resolves to the folder of the current .rts (NOT the inifile ScriptPath). That's the pattern that makes per-strategy folders self-contained.
- OrdersNetLiq points at a shared netliq.csv that OrderClerk updates daily so RealTest can size positions against current equity.
Enable the IBKR API and point OrderClerk at the right port. Paper trade first, then flip to live by changing one number.
- Port 7497 = paper account, 7496 = live. Start on 7497 until you've watched a full week of fills behave the way the backtest predicts.
- In TWS: File -> Global Configuration -> API -> Settings. Check 'Enable ActiveX and Socket Clients', set socket port, add 127.0.0.1 to Trusted IPs.
After the US close, run RealTest in -orders mode. It writes a CSV named <scriptname>_<YYYYMMDD>_orders.csv into the live folder.
realtest.exe -orders C:\OrderClerk\nas100_mr\nas100_mr.rts- No orders for the next session = no file is written. That's normal RT behavior, not an error.
- The CSV has 27 columns - everything OC needs to reconstruct the order (Side, Quantity, OrderType, LmtPrice, TimeInForce, Exchange, ...).
Open OrderClerk, click Load Order Lists (it scans the monitored folders for new CSVs), review what's queued, then click Place Orders.
| Side | Symbol | Qty | Type | TIF |
|---|---|---|---|---|
| BUY | AMD | 142 | MOO | DAY |
| BUY | NVDA | 38 | MOO | DAY |
| SELL | MSFT | 71 | MOO | DAY |
| BUY | MU | 220 | MOO | DAY |
- Pre-market staging is the standard workflow: load before the open, review, place when you're ready, let market-on-open execute the fills.
- OrderClerk writes confirmations to OrderClerkMessages.csv and updates positions in OrderClerkPositions.csv - both authoritative.
- It also maintains a round-trip trade list in OrderClerkTrades.csv with each fill tagged by Strategy name. RealTest reads that back on the next run so per-strategy position sizing stays correct in multi-strategy setups.
Wrap steps 5 and 6 in a single PowerShell script and schedule it via Windows Task Scheduler. From there, the only daily attention required is glancing at the summary line.
- Typical chain: refresh Norgate data -> RT -orders -> OC -connect -> OC -placeorders -> parse OrderClerkMessages.csv for the authoritative verdict -> post a summary line to Discord / email.
- Verify by parsing OC's messages CSV, not the PowerShell exit code. ExitCode lies in edge cases; OrderClerkMessages.csv is ground truth.
What a trading day actually looks like.
For a typical market-on-open strategy. Times in US Eastern.
- 4:00 PM ETUS market close
Norgate ingests EOD prices.
- 5:00 PM ETRT -orders runs
RealTest writes tomorrow's orders CSV into the live folder.
- 8:30 AM ETOC -connect
OrderClerk wakes, connects to TWS, refreshes positions and NLV.
- 8:30 AM ETOC -placeorders
OC transmits the staged orders to IBKR. Verified against OrderClerkMessages.csv.
- 9:30 AM ETIBKR fills
Market-on-open orders execute. Confirmations stream back.
- 9:35 AM ETDaily summary
Automation parses OC messages and posts a one-line summary (Discord, email, etc).
The five things that bite first-time setups.
OC treats every subfolder as a live monitored directory and runs housekeeping on it. Keep reference docs, sample baskets, and your research .rts files anywhere else.
When a strategy has no setups for the next session, RealTest writes nothing. That's correct, not a failure. Your automation should treat 'no file' as a successful no-trade day.
Paper account = 7497, live account = 7496. The cutover from paper to live is literally changing that one number in your OC and TWS config. Watch fills on paper for at least a week first.
Don't trust the PowerShell exit code from OC -placeorders to tell you if orders went through. Parse OrderClerkMessages.csv for the TRANSMITTING line - that's the ground truth.
Some strategies on this site enter at the open and may exit on a short holding period that could trigger PDT counting. If you trigger 4+ day-trades in 5 business days in a U.S. margin account under $25k USD equity, the FINRA Pattern Day Trader rule will restrict further day-trading. Per-strategy holding periods are documented in the .rts file.
For NDX strategies, point-in-time constituent history needs Norgate's US Stocks Platinum subscription ($346.50 USD / 6 months or $630.00 USD / 12 months; no monthly plan). Without it, you can't reproduce the backtest universe and your live trades will drift from the script.
Common first-week questions.
Yes. The morning chain runs pre-market on the same Windows box that has RealTest, OrderClerk, and TWS/Gateway installed. A small always-on PC or a Windows VM is the usual setup.
RealTest and OrderClerk are Windows-only. A Windows VM works, or a cheap dedicated mini-PC. IBKR Gateway runs cross-platform but RT/OC don't.
The strategy will skip that day's signals. No catch-up trades, no make-good fills - just one missed session. That's it. Robust strategies tolerate missed days; fragile ones don't.
Yes - one subfolder under C:\OrderClerk\ per strategy, each with its own .rts and orders CSV. OC monitors them all and stages a unified order list. RealTest also supports running multi-strategy scripts as a single .rts if you prefer.
Flip the IBKR API socket port from 7497 to 7496 in TWS, and update the same port in your OrderClerk connection settings. That's the cutover. Always paper-trade for at least a week first.
OC will fail to connect and the orders won't transmit. You'll see the error in OrderClerkMessages.csv. Outages are rare but real - the strategies on this site survive missing a day without breaking the curve.
Ready to wire one up?
Every strategy in the The Algo Catalog catalog is automation-ready. Pick one, drop the .rts in a live folder, and you're on the daily loop.
Attribution. OrderClerk and RealTest are products of Systematic Solutions, LLC / MHP Trading. The Algo Catalog is not affiliated with, endorsed by, or sponsored by MHP Trading. We sell .rts strategy files designed to run inside their tools. For anything authoritative about installing, configuring, or troubleshooting OrderClerk or RealTest, defer to the official docs and the RealTest Forum.