Ever since I began my trading journey, I’ve been a discretionary trader.
This year, however, I’ve become increasingly interested in mechanical trading, especially because of the possibilities AI has opened up.
I don’t come from a software development background, so coding had always been a major barrier for me.
Recently, I’ve become obsessed with research, backtesting, and coding my own trading system.
I believe I can outperform the machine as a discretionary trader in the short term.
But what about ten years from now? What happens when I have children? What about the days when I can’t be in front of my computer?
What about when I’m sick, or physically and mentally exhausted?
Over the long run, I believe it will be impossible to compete with the consistency of a machine.
So today I’m going to show you how I go from an idea, to research, to backtesting, and finally to implementing it.
At the time of writing, I’m not sponsored by anything I’ll mention below (tools, websites, etc.). Everything I show here is part of my actual process.
What tools I use for research
So it all starts with researching an idea. These ideas usually come from these places:
Academic writings, which I usually find on: https://www.ssrn.com/ssrn/ or researchgate
Substack or X
QuantConnect, Google
TradingView charts
For example, I read about a particular trader’s strategy, then I take his or her strategy and turn it into a mechanical strategy to see how it has performed over the last few years.
The process is pretty simple.
What tools do I use for backtesting?
To backtest all my ideas, I use:
An AI coding agent (my favorite right now is Cursor AI)
RealTest Software (the software that backtests my ideas)
Norgate (my data provider)
Out of all of this, the most important thing is YOUR DATA PROVIDER.
You need clean data that you can rely on.
Don’t look for the cheapest solution, as they will have corrupt data, data you can’t trust.
The research + backtesting process
Okay, let’s assume I have an idea I want to test.
Let’s start with a simple idea:
Buy when QQQ is above its 200-day moving average.
Sell when it drops below its 10-day moving average.
Continue buying every time QQQ crosses back above the 10-day moving average.
Use a 5% stop loss.
Now, all I have to do is take these rules and tell the AI:
“Build me a RealTest code to backtest my strategy using these rules.”
This is the code the AI gave me.
Import:
DataSource: Norgate
IncludeList: QQQ
StartDate: Earliest
EndDate: Latest
SaveAs: QQQ.rtd
Adjustment: TotalReturn
Settings:
DataFile: QQQ.rtd
StartDate: Earliest
EndDate: Latest
AccountSize: 100000
BarSize: Daily
Data:
MA10: MA(C, 10)
MA200: MA(C, 200)
CrossAbove10: C > MA10 and C[1] <= MA10[1]
Strategy: QQQ_MA
Side: Long
Allocation: S.Equity
QtyType: Percent
Quantity: 100
MaxPositions: 1
EntrySetup: C > MA200 and CrossAbove10
EntryTime: NextOpen
ExitRule: C < MA10
ExitTime: NextOpen
ExitStop: FillPrice * 0.95
ExitStopTime: IntradayThen I copy this code and simply paste it into RealTest Software.
Then I click “Import and Test” in RealTest.
And this is the result of the study:
As you can see, the strategy is profitable, with a maximum drawdown of 30% over a sample of 429 trades and a profit factor of 1.27.
Join 2,000+ traders
For less than $0.80/day, unlock a proven swing trading strategy, real-time trade alerts, and access to a private Discord community.
Of course, if you compare it with a “buy and hold QQQ” strategy, you’ll notice that it severely underperforms.
If you look at the image above, QQQ buy and hold had an 80% drawdown during the 2002–2003 bear market.
Meanwhile, the strategy kept you in cash, and you had a maximum drawdown of 30%.
Not all strategies are about beating QQQ buy and hold. Some are simply about reducing your drawdown.
For this test, I want to find out whether a simple trend filter can reduce QQQ’s drawdowns, how much return I give up in exchange, and how much time the strategy spends out of the market.
A little secret: if you can find alpha in a bull market and alpha in a bear market with another strategy, all you have to do is combine them and use market regime filters.
One will outperform in a bull market, while the other will reduce drawdown in a bear market, making the strategy much more profitable in the long run.
Before I look at the returns, I check whether the code actually trades the rules I intended. I inspect individual trades, compare the entries and exits with the chart, and look for differences between my original idea and the AI’s implementation.
What I find really cool is that you can see every trade your system took, complete with charts.
You can see how it performed year by year, how much exposure you had, and how many setups you had per month or per year.
The program is very versatile.
You can even give the program the parameters of your strategy, and it can optimize the strategy for different objectives, such as lowering drawdown or maximizing net profits.
Be careful about overfitting your strategy here! If your strategy is way too complex and has too many parameters, you have most likely overfitted it.
How I check whether a strategy holds up beyond the backtest
Once I have a working backtest, the next question is: how much of this performance comes from a repeatable edge, and how much comes from fitting the strategy to historical data?
This is where validation becomes important.
One approach is to divide the historical data into two separate periods:
In-sample: the data I use to develop the strategy, choose its rules, and explore different parameters.
Out-of-sample: data I keep separate and use to evaluate the strategy after its rules have been finalized.
For example, I could develop a strategy using the first portion of the available history, then test the exact same rules on the remaining period.
The important part is that I leave those rules unchanged. I want to see how the strategy performs on data that did not influence its development.
The trap: repeatedly checking the out-of-sample results
Let’s say the strategy performs poorly during the out-of-sample period.
I add a filter, change the moving average, adjust the stop, and run it again. The results improve.
That may feel like progress, but I have now used that period to make development decisions. It no longer provides the same independent check.
If I keep repeating this process, I can end up fitting the strategy to both periods while still calling one of them “out-of-sample.”
Simple strategies can be overfit too
A complicated strategy with dozens of parameters deserves scrutiny. But simplicity alone does not protect me from overfitting.
Imagine testing hundreds of combinations of moving averages, stops, entry rules, and market filters, then selecting the one with the best historical performance.
The final strategy might have only three rules. Those rules were still selected from a large number of alternatives.
That is why I need to consider the entire research process, including how many variations I tested before finding the version I want to trade.
A strong backtest gives me a reason to investigate further. Before putting money behind it, I want to see whether the strategy can hold up on data that played no role in its development.
Even then, a successful out-of-sample test provides additional evidence, not certainty about future returns.
What about automation?
A possible next step is automation, although I haven’t reached that stage yet. I’m still researching and testing.
From what I’ve read, RealTest can generate the orders a strategy needs for the next trading session.
A separate execution tool, such as OrderClerk, can then send those orders to Interactive Brokers.
RealTest itself does not place orders directly with a broker.
Another option is Python. Through a broker’s API, which allows software to communicate with your trading account, a Python program can check your strategy’s conditions and place, monitor, or cancel orders. Interactive Brokers supports this through its Python API.
This is something I’d like to explore in the future. If I get there, it could become a separate article showing exactly how I set it up and what I learn along the way.
Going from an idea to a fully tested trading system is no longer something reserved for professional quants or experienced programmers.
With AI, clean data, and tools like RealTest, you can research an idea, turn it into clear rules, backtest it, and study the results in a fraction of the time it used to take.
For me, this is the beginning of a longer journey. I’m still learning, testing, and refining my process. But I’m convinced that combining discretionary skill with mechanical systems can make me a more consistent trader over the long run.
If you want to follow along as I research, backtest, and eventually automate more strategies, make sure you’re subscribed. In future articles, I’ll share more systems, the results, the mistakes, and everything I learn along the way.
Stay disciplined, stay curious, and keep building your edge.
And if you’ve been thinking about joining our community, now is the moment.
Right now, the yearly plan is 49% off.
See you inside.
Trade Setups of The Week
If you think this newsletter could help your friends, share it with them so it can reach as many traders as possible.
And here’s the fun part: when you share it, you can unlock special rewards + you will look smart in front of your friends :)
“One trade closer to freedom.”
Vladislav







The underrated benefit of going mechanical: it lets you measure whether you had skill at all. Until the rules are fixed, every good stretch looks like judgment. Curious what pushed you to switch.