A Small Milestone

 


Today is a good day. No, I did not become a millionaire. But I believe a small milestone has been reached.


The Goal I Had Since January

From the start of this year I had something in mind — my own algorithmic trading strategy that runs and places trades on my behalf. But one of the most difficult parts of building an algo trading bot is having enough data to even consider whether a strategy is worth converting.

From the start of this year I stuck to one single strategy — RMQTS. Over the months I managed to place around 65 live trades in real market conditions. That is a very small dataset. Some would not even call it a dataset. But to me it was enough small evidence to justify moving to the next step — not to prove the strategy works, but to start testing it more seriously.


Converting RMQTS to Pine Script

Over the past few days I have been working on converting the strategy into Pine Script. I want to mention my two coworkers who helped me at every step — ChatGPT and Claude. This might sound nerdy. I do not care. Moving on.

With the Pine Script ready I ran a backtest across 20 assets — including oil, silver, gold, some crypto pairs, and forex pairs.


The Backtest Results

The script placed 326 trades in total. Of those, 134 were winning trades — a 41% win rate with a planned R:R of 1.9.

41% might sound low. But because the planned R:R is 1.9, the expected value per trade is +0.189R. Over a large enough number of trades, assuming the underlying probabilities and market conditions remain reasonably consistent, the average result should move closer to that expected value. This connects to the concept of the law of large numbers — a topic I intend to cover in the next post. But even with positive expectancy, long losing periods are still possible.

One thing worth adding eventually — I need to document what time period these 326 trades were taken over, and whether all 20 assets were tested across the same period. Without that context the number of trades alone does not say much about robustness. I will add this to the backtest results section.


Removing the Weak Pairs — And Why This Is Complicated

Looking at the 326 trades I noticed the strategy performed worst on GBP and JPY pairs. I adjusted the variables and tested different settings — the results either stayed the same or got worse. So I removed them from the test and ran it again.

I want to be honest about why this is not straightforward. I saw that GBP and JPY performed badly after looking at the results, then removed them. That is a form of selection bias. If I use the second result as evidence that the strategy is better, I am potentially overfitting — building a result that looks good on historical data but may not hold in live trading.

I am not removing them because the backtest told me to. I am removing them because my live journal already showed poor results on those pairs, and I want to test whether the strategy is genuinely better suited to certain markets. But I also know that changing the assets after seeing the results can create overfitting. That is exactly why the demo test matters — it will show whether this holds out of sample.

After removing GBP and JPY the total trades came down to 260. Of those, 112 were winning trades — a 43% win rate with a planned R:R of 1.9.


The Bot Is Live — On Demo

I have set up the trading bot on cTrader and MT5. There are some limitations on the free tiers but I intend to make the most of it. I am testing with demo money only.

Here is what I am actually watching during the demo phase. Does the live win rate stay reasonably close to the backtest? Does the average R remain near expectations? Does the bot behave correctly during unusual market conditions? And does execution differ significantly from the backtest results?

If the demo results hold up over a meaningful number of trades — not as proof the strategy works, but as another piece of evidence worth building on — that would be a significant step forward. For now I wait.

A milestone has been reached. I will add the full backtest results to the backtest results section of the blog.

Bye for now, take care.

Post a Comment

0 Comments