r/algorithmictrading • • 9d ago

Backtest Algorithmic trading using Claude

Post image

How many are using Claude to find the strategy and telling "make no mistake"?

It is giving me stratagy which is producing 70%+ CAGR with -45% DD.

I wonder if claude can product such strategy and if the worl of trading would change forever?

Strategy:

Systematic strategy combining an overnight core with intraday Nasdaq futures trades, including shorts.

From February 2010 to August 2026, the backtest produced 78.2% CAGR and 36.7% maximum closing drawdown. Over the same period, TQQQ buy-and-hold returned 43.0% CAGR with 81.7% drawdown.

In 2022, the strategy returned 78%, with intraday shorts contributing most of the gains while the core lost money.

I tested 119 configurations and included modeled spreads and commissions. One extra futures point of slippage per side pushed estimated intraday drawdown to 40%.

What tests would you run to check for overfitting and unrealistic execution?

Update 25 Nov

The walk-forward passes. I picked every (14400) setting using only 2000–2011, froze them, and ran 2012–2026. The result is 81.5% CAGR with a 31.7% worst drawdown, at 1 point of cost per contract. The live version makes 91.6% over the same years, so about 10 points of its number come from hindsight.

Strategy / Benchmark (2012–2026, 1 pt/contract)CAGRWorst Drawdown
Settings picked in 2011, frozen81.5%−31.7%
C4H as you run it91.6%−34.8%
QQQ buy-and-hold20.2%−35.1%
Nasdaq futures held at the same drawdown15.6%−27.9%

So even after I froze settings in 2011, 15 years later still returning 81.5%.

It is not a complete seperation because stratagy was already built with full data. Numerical Parameters are computed using only upto 2011 data.

If I truely want to do it correctly I have to research new stratagy from scratch with only past data and reserve few years for the forward pass. I am trying this the next.

66 Upvotes

46 comments sorted by

7

u/Formally-Fresh 8d ago

All yall paper trading millionaires are the same

1

u/random-trader 8d ago

There are always haters. I am looking for people who are genuinely interested to know and are knowledgeable.

2

u/IgneousMaxime 6d ago

You are neither of those things to be honest

14

u/Shoddy_Peanut7320 9d ago

The result is extraordinary, and extraordinary results are more often a bug than an edge, so I'd test the code before trusting the strategy. Shift every signal by one bar to see if the result survives, and check that no signal uses data from after the order. With 119 configurations, the best one is flattered by selection, so I'd judge it only on data that wasn't used to pick the setting. For execution, test much larger slippage than one point, especially on the overnight and open fills. A random-entry baseline with the same exits and costs is a good last check.

2

u/Ok-Warning-6054 7d ago

it look very suspect , the 119 configurations make overfitting easy

4

u/Ok-Cookie-8370 8d ago

con ese drawdown si le metes pasta en real te cagas vivo y dejas de usarlo o intervienes.

1

u/ZweifachLang 6d ago

Are you sure you didn’t allow Claude to see the next days data for each day? Happily break down the strategy in more detail

1

u/random-trader 6d ago

That I can only take Claude words because I myself can't read and verify the strategy. I can only ask to be sure not looking at any future data and added randomness on at what point execution actually fills it.

I the only way to be really sure is to run on the real account and see what kind of fill do I get. I do have alert for fill point difference and did all optimizations, execution now happens within double digit ms.

So really now I will run the strategy on real account 100k.

1

u/ZweifachLang 4d ago

So you just hand over you 100k account to Claude and ask it to execute it?

1

u/random-trader 4d ago

I am in control every step. I have built frontend to monitor every active and every action. I have kill switch to pause or close all trades. I can watch every 30mins what happening. Also sends me email about expected vs real execution gap. So I think I can try to test it. Lower than 100k doesn't make sense because the granularity it buys/sell doesn't match anymore.

Does it make sense?

1

u/Evening_Control6034 5d ago

2011-26 has been a crazy bull market with only few minor bear markets. Covid was very short lived and 2022 wasnt terrible. Can you try over 2001 to 2012 window. It had two major crashes. Can claude avoid the huge downturns?

1

u/random-trader 5d ago edited 5d ago

It is mostly the formula that it has come up with by looking at all duration and creating an equation that fits the curve the best. So year my criteria for dd was < 40% . And it fits. It runs 2 equations, daily and interaday. Intraday reference everyday starts at daily. So one bigger wave and once Small waves within the bigger wave frequency.

But thats what the algorithmic trading anyway no? Find what worked in the past, hoping same would work in the future?

Now AI is smart enough to give you a perfect complex equation that fits the past curve but that doesn't necessarily mean it will fit the future curve.

The only thing is where you stop so it doesn't overfit. Just like LLM training.

0

u/Evening_Control6034 5d ago

Ok. I was wondering if its short term swing trading. Daily is different and ya Claude may crack it. If you somehow throw in daily headlines it can parse that also and do better i guess.

3

u/Obviously_not_maayan 9d ago

Is this OOS?

6

u/PepMar000 9d ago

I bet it is not!

1

u/IgneousMaxime 6d ago

OP doesn't know what that is without their AI of choice telling them

3

u/Vegetable-Warthog81 8d ago

Why bother with all those tests? Just bet all your money on it. Life's a gamble.

3

u/Forward-Memory944 8d ago

You didn’t produce anything. Easiest thing in the world to find a strategy that works in sample.

1

u/Chaluliss 9d ago

This post is shitposting right?

0

u/random-trader 8d ago

No, Genuine question

2

u/Chaluliss 8d ago

No offense but opening your post with "How many are using Claude to find the strategy and telling "make no mistake"?" Just reads like a shitpost.

saying 'make no mistakes' is a joke, maybe you're unaware, it's not a legitimate method of improving the outcome of a prompt.

2

u/stocksgoup_0DTE 8d ago

But could you really stick with your strategy through a 37% drawdown? Also, the future will likely not be as kind as the past, so the drawdown could go even deeper. Unrelated to overfitting, but I would consider scaling down the risk

2

u/Anxious_Cabinet_9585 5d ago

As a quant PM, believe me all Claude can find is bullshit.

1

u/BitComprehensive7623 3d ago

Can you share an example please

0

u/DXM40334 4d ago

could you shed some light as a quant pm at what you are looking for?

1

u/Foreign_Cut111 3d ago

Because Claude is trained on data it’s already seen

1

u/Cautious_Wealth1732 3d ago

Thats bs. Claude isnt a time series modell. Also for an asset like NQ/qqq it doesnt matter really. For stocks that selection is more crucial but indicies tend to go up over time anyways. To test your theory you could just ask your AI how any particular day closed and it is only allowed to answer from memory.

1

u/Foreign_Cut111 2d ago

Nah bro - pre trained AI and LLMs are inherently biased

1

u/Cautious_Wealth1732 2d ago

Cannot confirm. Howd you enen measure that

0

u/DXM40334 3d ago

I get that part. If it didn't train on any useful edge, it won't magically come up with one. My question is more of a "please give us a hint on what to look for/at". Not expecting anyone to put the secret sauce out there on the internet but will take any information.

2

u/vilgo7 3d ago

119 configs? Run White's reality check

2

u/RawatAnshuman 9d ago

Man 70% returns shows there is some virus or something fishy please check. I don't know maybe survivorship bias or some issue with how you are doing the back testing

1

u/Key_Improvement9460 7d ago

If you got this purely from Claude brute force trial and error, it is very likely its overfit. There could also many additional problems depending on the amount of trades taken.

1

u/Homebody_quant 5d ago

Lots of these comments are right. Your results are basically a up and right line with no downturns. Its likely there is a error in the process and selection

1

u/Firm_Celebration_204 5d ago

OOS testing. You shouldn't be developing off data this recent. Set aside the last year or so, don't touch it when building your strategy. Then backtest on the untouched data afterwadrs.

1

u/HomelessVagrant843 5d ago

There is zero chance that asset prices aren't incorporating 100% of claude/chat gpt algorithmic traders.

1

u/Ok_Tooth_5719 4d ago

How complex it is? And parameters? If too many parameters likehood chance of overfit

1

u/SimpleDaddy_ 3d ago

Overfit do mc sims and then do is oos and true oos

1

u/rddBad 2d ago

Lol 😂😂😂 where out of sample? Where walk forward test? Where any proof test? Looooool

1

u/vriemeister 1d ago

Create fake candle data with an annual gain of +20% and add some gaussian noise. Run your algo on that data and see if you beat the fake market. That will tell you if its real gains or a bug. If you're only trading on QQQ, take that data and shuffle it in chunks with sizes of months or years. That's some more fake-ish data to test with.

Based on the name you are trying to recreate TTrades C4 strategy? Or did you tell Claude to make a strategy and that is the name it came up with?

1

u/SkyLordDark 6h ago

since the rules used the whole dataset already, that walk-forward is totally dirty anyway even fomo does this lmao. u gotta count all ur prior tries man, test on actual unseen data for once, and check like 2 to 3 points of slippage instead of just one.