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.

A note up front: The Algo Catalog does not make, sell, or support OrderClerk or RealTest. Both are third-party products from MHP Trading. This page is a supplemental walkthrough for buyers who've already (or are about to) license RealTest - it does not replace the official OrderClerk User Guide that ships with the install.
Concept

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.

RealTest-orders modestrategy.rtswrites CSVOrderClerkLoad + Placereads CSVcalls IBKR APIIBKRTWS / Gatewayport 7497 / 7496fills @ openorders.csvAPI callfills + statusnetliq.csvOne trading day - end of day to next open5:00 PM ET8:30-9:25 AM ET9:30 AM ET
The brain
RealTest

Reads end-of-day data, runs your .rts strategy, emits an orders CSV for the next session.

The bridge
OrderClerk

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.

The hands
Interactive Brokers

Receives the API calls, fills market-on-open orders, posts confirmations and updated positions.

Bonus: one bridge can run all your strategies at once.

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.

What it costs

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.

OrderClerk
$0.00 USD
Bundled with RealTest at no extra license cost
RealTest
$389.00 USD
One-time new-license fee. Perpetual use of current version + 12 months of updates. Optional $159.00 USD/yr extension after that.
IBKR account
$0.00 USD
No platform fee. Pattern Day Trader rule applies under $25k USD equity.
Per-share commission
$0.005 USD
IBKR Pro Fixed tier; modeled in every backtest

Sources: RealTest pricing - mhptrading.com/purchase.html. OrderClerk download + official docs - mhptrading.com docs; latest build link in the RealTest Forum.

Walkthrough

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.

1
Install OrderClerk

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.
2
Make a per-strategy live folder

One subfolder under C:\OrderClerk\ per live strategy. This is where the .rts file runs and where the daily orders CSV is written.

C:\OrderClerk\
netliq.csv // shared, updated by OC
nas100_mr\ // one folder per live strategy
nas100_mr.rts // live copy of purchased strategy
nas100_mr_20260526_orders.csv // written by RT -orders
OrderClerkTrades.csv // round-trip trade list, fed back to RT
OrderClerkMessages.csv // authoritative status log
spx_breakout\ // another live strategy
  • 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).
3
Add the OrderSettings block

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.
4
Wire IBKR (TWS or Gateway)

Enable the IBKR API and point OrderClerk at the right port. Paper trade first, then flip to live by changing one number.

TWS - Global Configuration - API - Settings
Enable ActiveX and Socket Clients
Read-Only API leave unchecked
Socket port:
paper/live
Trusted IPs:
127.0.0.1
  • 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.
5
Generate tomorrow's orders

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, ...).
6
Load + Place in OrderClerk

Open OrderClerk, click Load Order Lists (it scans the monitored folders for new CSVs), review what's queued, then click Place Orders.

OrderClerk
Staged orders - nas100_mr_20260526
SideSymbolQtyTypeTIF
BUYAMD142MOODAY
BUYNVDA38MOODAY
SELLMSFT71MOODAY
BUYMU220MOODAY
  • 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.
7
(Optional) Automate the morning chain

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.
Daily loop

What a trading day actually looks like.

For a typical market-on-open strategy. Times in US Eastern.

  1. 4:00 PM ETUS market close

    Norgate ingests EOD prices.

  2. 5:00 PM ETRT -orders runs

    RealTest writes tomorrow's orders CSV into the live folder.

  3. 8:30 AM ETOC -connect

    OrderClerk wakes, connects to TWS, refreshes positions and NLV.

  4. 8:30 AM ETOC -placeorders

    OC transmits the staged orders to IBKR. Verified against OrderClerkMessages.csv.

  5. 9:30 AM ETIBKR fills

    Market-on-open orders execute. Confirmations stream back.

  6. 9:35 AM ETDaily summary

    Automation parses OC messages and posts a one-line summary (Discord, email, etc).

Gotchas

The five things that bite first-time setups.

Never store reference files in C:\OrderClerk\

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.

No orders today = no file

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.

Port 7497 vs 7496

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.

OrderClerkMessages.csv is authoritative

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.

PDT rule may apply on short-holding-period strategies

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.

Norgate Data US Stocks Platinum required for full universe history

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.

FAQ

Common first-week questions.

Do I have to leave my computer on overnight?

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.

Can I run this on a Mac or Linux box?

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.

What if I miss a day?

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.

Can I run multiple strategies side by side?

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.

How do I switch from paper to live?

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.

What happens if IBKR is down at the open?

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.