Project Redline Building a Trading System From Scratch
What Is Project Redline?
Project Redline is my full algorithmic trading suite, built entirely from scratch, covering every step from idea to live execution.
Most traders who go the algorithmic route either rely on off-the-shelf platforms that lock you in, or they hack together a bunch of disconnected scripts that barely talk to each other. I wanted neither. I wanted something I fully understood, fully owned, and could change at any time without asking anyone’s permission.
That obsession turned into Project Redline. A professional trading framework for futures markets, written by one person, for one person.
IMPORTANTThis isn’t a “trading bot” in the YouTube sense. There’s no magic AI predicting the market. It’s a system that tests ideas honestly, executes them precisely, and doesn’t lie to you about the results.
How a Strategy Goes From Idea to Live Market
The easiest way to explain it is to just walk through how a strategy actually gets built.
Step 1 Research and Backtesting (HardEdge)
Before real money is involved, a strategy needs to be tested on historical data. That’s what HardEdge does.
You describe a strategy in a config file, what indicators to use, when to enter, how to manage risk, and HardEdge replays years of market data bar by bar to see how it would have performed. It handles all the messy stuff: slippage, commissions, partial fills, session boundaries, multi-timeframe logic.
The results are honest. It doesn’t curve-fit, it doesn’t hide losing trades, and it doesn’t let you fool yourself.
IMPORTANTImportant is that i do not use the whole dataset to train the model, i only use a small portion of the data set to train the model and then i use the rest of the dataset to test the model and will never tweak and test the model again on the same data set, because the more you tweak and test the model the more it will overfit and the more it will not show any real edge.
NOTEHardEdge also runs parameter optimisation sweeps, testing thousands of combinations in parallel and rendering the results as a 3D surface. The goal isn’t finding the single “best” setting. It’s finding settings that work across a wide range, not just at one lucky point. but usually because of overfitting i do step 2 and only after that will I optimise the parameters
Step 2 Does It Actually Have an Edge? (MCPT)
Backtests can lie. A strategy that looks profitable might just have gotten lucky on that specific sequence of bars. MCPT (Monte Carlo Permutation Testing) is how I catch that.
The idea is simple: run the same strategy on thousands of randomly shuffled versions of the price data. If it performs about the same on shuffled data as on real data, there’s no edge. If the real result is clearly better than almost every random run, there’s a genuine signal.
IMPORTANTMonte Carlo Permutation Test is a statistical test that is very complex for beginners and this explanition above is an overly simplified version of it, so i will not go into the details of the test, but now you understand the idea of Monte Carlo Permutation Testing.
I run 1000 statistical tests before I even consider a strategy worth developing further (that means i go back to optimise the parameters and run this test again). Most ideas fail here. That’s the point.
IMPORTANTPassing MCPT doesn’t mean a strategy will make money going forward. It just means the historical result is unlikely to be noise. That’s a necessary condition, not a guarantee.
Step 3 Pattern Discovery (DataMining)
Sometimes the question isn’t whether a strategy works, it’s whether there are any patterns worth building a strategy around in the first place.
DataMining uses a genetic algorithm to evolve candlestick pattern hypotheses directly from price data. It starts with random guesses, tests them, keeps the better ones, mutates and combines them, and repeats for hundreds of generations. Same idea as biological evolution, just applied to finding market structure.
The best patterns get validated on data the algorithm never saw during evolution. If they survive that, they’re worth looking at.
Step 4 Live Execution (Sentinel)
Once a strategy is validated, Sentinel takes it live. This is the piece that actually places orders in the real market.
Sentinel is written in Rust, chosen specifically because speed and reliability matter here more than anywhere else. It connects to either NinjaTrader 8 (over a c# bridge) or Interactive Brokers (with their api) depending on what you’re running. The exact same config file used in backtesting gets loaded by the live engine, so what you tested is what gets traded. No translation, no drift.
IMPORTANTImportant is that I need to code the indicators in both Python and Rust, and the Strategy loader too, only the config file is the same json file in both components, and I don’t want to use some bride for that, This is the best solution to keep them seperate but still use the same config file.
NOTESentinel runs a background health monitor, logs UTC timestamps on every trade signal, and handles order state with thread-safe logic. Live trading is where bugs become expensive, so there’s no room for sloppy code here.
Step 5 Everything Else (RedlineEngine)
All the monitoring and review lives in RedlineEngine, a native Swift app for macOS and iOS. It has three tabs.
The first tab is performance analytics: equity curve, drawdown, win rate, expectancy. Everything I need to see whether a strategy is running clean or starting to fall apart. Both HardEdge and Sentinel will send the data to this tab.
The second tab is a visual strategy editor. Instead of writing JSON config files by hand, you build strategies through a UI. It generates the same file format HardEdge and Sentinel use, so there’s no disconnect between what you designed and what actually runs.
The third tab is trade review. For those who are familiar with Funded Firms, this tab would be familiar to you, with the calendar view, the summary stats, and the actual individual trades.
IMPORTANTThe reason it all lives in one native app instead of a bunch of browser tabs is the same reason I built everything else myself, I want one place that does exactly what I need, nothing more, nothing less.
How It All Connects
Every component feeding into a separate tool is a problem I’ve seen kill other people’s setups. Results live in one place, the live engine is somewhere else, the review dashboard is a third thing that doesn’t know about either. You end up copying numbers by hand and wondering why things don’t add up.
I solved that with a central Supabase API. When HardEdge finishes a backtest, it uploads the results. When Sentinel executes a trade in live markets, it uploads that too with 3 diffrent type of logs (network, system, execution). RedlineEngine then reads from the same API on both macOS and iOS , so every tab is pulling live or backtest, real data from a single source of truth, not local files, not exports, not manual syncing.
NOTEThis means I can finish a backtest on my laptop, pick up my phone, and see the full results immediately. Or check how Sentinel is running from anywhere without being at my desk. That’s the kind of workflow that actually matters when you’re trading.
The Stack
Backtesting Python, Polars, NumPyLive Engine Rust (Sentinel), C# (NinjaTrader bridge)Pattern Mining Python, Genetic AlgorithmsStatistics Monte Carlo Permutation TestingAPI Layer Supabase (self-hosted, shared between all components)Native App Swift (RedlineEngine , macOS and iOS)Code Quality Pre-commit hooks, CodeRabbit, CI/CD, SonarQubeHow the Code Actually Gets Shipped
I treat this codebase like production software, not a personal project I can leave in a broken state.
Every commit runs through pre-commit hooks first , formatting, linting, type checking, security scanning, all of it. Nothing gets committed if the hooks don’t pass. No exceptions, no --no-verify shortcuts.
After that, CodeRabbit reviews the diff automatically. It catches logic issues, spots things I missed, and flags anything that looks off before it ever touches the main branch.
Then CI/CD kicks in with four jobs running in parallel: lint, Rust build, docs build, and the full test suite. If any one of those fails, the branch doesn’t merge.
Finally, SonarQube runs a static analysis pass , code quality, duplication, potential bugs, security hotspots. It gives a second opinion on things that are technically valid code but still wrong.
NOTEMost personal projects skip all of this. I don’t, because the moment a bug makes it into Sentinel and the live engine is running, it’s not a debugging exercise anymore , it’s a real problem with real consequences.
Why Build It Instead of Buy It?
Because the tools that exist either don’t do what I need, or they’re a black box I can’t trust.
When I trade with a system, I need to understand every decision it makes. If Sentinel skips an entry, I need to know why. If HardEdge shows a drawdown, I need to know exactly which trades caused it and under what conditions.
Off-the-shelf platforms don’t give you that. You get a result and you’re expected to trust it. That’s not how I work.
IMPORTANTBuilding your own tools also forces you to understand the domain at a level no course can give you. You can’t write a position manager without understanding exactly how stops, targets, and partial exits interact. You can’t write a regime filter without really thinking about what “market state” means in data terms.
The act of building is the education.
Current Status
The full pipeline is running , backtesting, statistical validation, live execution on both NinjaTrader and Interactive Brokers. The codebase has over 1,000 automated tests covering the core engine, the statistical modules, and the pattern discovery system.
Right now I’m focused on the Futures transition, dialling in execution and validating strategies under live conditions. The infrastructure is solid. Now it’s about finding edges worth deploying.
TIPIf you’re building your own trading system: separate your backtesting from your live execution cleanly from the start. The moment those two things share code in a messy way, your test results stop meaning anything. And please don’t forget to add tests, MCPT, CI/CD, SonarQube, Pre-commit hooks these are the most important things to have in your system