DEV Community

govinterset-dotcom
govinterset-dotcom

Posted on

My Approach to Algorithmic Trading: From Statistical Research to Live Execution

I've started publishing my algorithms on GitHub and writing about them on trading forums. The repository is primarily intended for like-minded people — those who are trying to build trading algorithms instead of sitting in front of a screen for days on end, with their hands shaking every time the market moves.

After many years in trading, I've come to believe there are really only two serious paths:

  1. Building an investment portfolio.

You analyze companies, select securities, and allocate capital across different assets. Your returns come from dividends, bond coupons, and capital gains from buying and selling stocks and bonds.

The main edge here comes from two things: the quality of your analysis and time. Both are essential. Neither works particularly well on its own.

Even the best investment thesis is worth very little without giving it enough time to play out. You cannot force a good idea to deliver returns exactly when you want it to. If all the relevant factors have been properly assessed and the analysis is sound, the idea will play out in its own time.

As for relying on time alone — the ETF approach and similar strategies — I think you know what I mean. This approach has worked particularly well in the US, but there is no guarantee it will continue to do so indefinitely.

  1. Algorithmic trading.

In my view, manual trading approaches, even profitable ones, ultimately have disadvantages compared to algorithms: speed, consistency, and the ability to operate without interruptions caused by everyday human life and unexpected circumstances.

For the past few years, I've been fully focused on the second path. Let me explain my approach in more detail.

The Two Pillars of Algorithmic Trading

Algorithmic trading also rests on two pillars: a robust strategy and high-quality algorithm implementation.

For an idea to become a solid trading strategy, it needs to pass several important stages.

Stage 1. Broad statistical analysis of market behavior.

The first step is to analyze price patterns and market behavior under specific conditions, looking for stability, recurring patterns, and statistical significance.

For example, virtually any technical analysis method can be tested statistically. You can measure the win rate associated with a particular indicator or market condition.

You need large datasets for backtesting and statistical validation.

Here's a simple example of a hypothesis:

After a strong price impulse on a 5- or 15-minute timeframe — say, a move greater than 1 ATR over the last several candles — is the probability of continuation higher, or does a reversal become more likely?

In other words, after a significant impulse, does the market more often reverse or continue in the same direction?

We test this against historical data, measure how frequently each outcome occurs, calculate the probability, and, most importantly, determine whether the result differs significantly from a random distribution.

Is the dataset large and reliable enough for us to trust that probability?

Let's assume we find that after a strong impulse of around 2 ATR, the probability of a pullback is 58%, rather than the 50/50 we'd expect from a random outcome.

That's a reason to investigate further.

Stage 2. Backtesting the strategy.

Now we run a backtest of the actual trading idea.

For example, we enter a position when a reversal signal appears. What win rate do we get? Does the average profit cover commissions, slippage, and other trading costs?

If the strategy has positive expected value after accounting for these costs, we move on.

Stage 3. Building the algorithm.

Now it's time to turn the signal into working code.

Fortunately, AI coding agents make this process much easier. We build the execution engine and prepare it for the next stage.

Stage 4. Paper trading on a server using live market data.

The algorithm runs on a server and receives real-time quotes, but does not actually submit orders. It simply records signals and simulated trades.

You'll keep coming back to this stage throughout development to fix bugs and verify the system's behavior — both in paper mode and later in live trading.

If the results remain consistent after weeks or months of paper trading, the algorithm can move to live execution.

Stage 5. Live execution and debugging.

This is where implementation issues start to surface.

You debug the code and optimize the details of the execution mechanics, particularly order placement and execution.

A strategy that looks good on paper can behave very differently when real orders hit the market.

Stage 6. Extended live testing with real money.

Once the algorithm is running properly, you let it trade with real money for weeks or months.

This is where you find out whether the strategy actually survives real market conditions and execution costs.

Stage 7. Signal optimization.

Finally, you optimize and filter the signals, provided there is room for improvement based on the results from Stage 6.

The goal is to improve the final financial performance without simply overfitting the strategy to historical data.

How Many Ideas Actually Survive?

Based on my experience, around 90% of ideas make it through statistical analysis and reach paper trading.

Of those, only about 10% make it further.

And when it comes to real money and actual live execution, perhaps only 1% of the original ideas survive.

Even those algorithms gradually lose their edge over time due to competition, new fees, changing market conditions, and other factors.

That's just how this business works. Such is life.

My Algorithms, Research and Datasets

Here are examples of my algorithm implementations. They cover different approaches and markets:

https://github.com/govinterset-dotcom/polymarket-algos

There are quite a few interesting ideas in the repository that can be developed further and adapted to other strategies.

The most recent robust algorithms that have been tested in live trading are available here:

https://github.com/govinterset-dotcom/polymarket-algos/tree/main/best-live-algos

I've also published datasets that you can use to test your own hypotheses. There's a decent amount of data available:

https://github.com/govinterset-dotcom/polymarket-algos/tree/main/datasets

Why I Trade on Polymarket

I mainly trade on Polymarket because its Python integration is very convenient for building and deploying algorithms.

One more important thing: latency matters enormously in algorithmic trading.

This includes signal latency, order submission latency, execution latency, and data-feed latency.

Before deploying a script, you should measure the latency between your server and the exchange's infrastructure.

Many exchanges offer direct connectivity or dedicated gateways for an additional fee, allowing algorithms to operate with minimal delays. In some cases, latency can be below 5 ms.

But that's already a more advanced level of infrastructure.

Good luck, and happy researching!

Top comments (0)