Algo-trader Saleh tests whether GPT 6.2 Astra can research and backtest a BTC/ETH pairs trading strategy on Binance futures, reporting 127% vs 42% buy-and-hold.
Key Takeaways
- GPT 6.2 Astra can carry out a multi-step quantitative research workflow, including strategy design, large-scale variation search, and out-of-sample reporting.
- Pairs trading on BTC/ETH can show attractive backtest returns, but results depend heavily on search breadth and risk of overfitting.
- Without Monte Carlo validation, cross-validation and a holdout period are the main safeguards, and the results should be treated with caution.
- Transaction costs and slippage materially affect the viability of high-frequency-style pairs strategies, so conservative fee assumptions matter.
What the video covers
- The video tests whether the new GPT 6.2 Astra model can perform real-world trading research: writing, backtesting, and validating a pairs trading (statistical arbitrage) strategy.
- Pairs trading is introduced as betting on the convergence of the spread between two historically correlated assets, such as BTC and ETH, rather than on market direction.
- The presenter draws on Ed Thorp's history (blackjack card counting, Princeton Newport Partners hedge fund) to motivate statistical arbitrage as a serious approach.
- The AI was given a detailed prompt requiring a portfolio Sharpe ratio of at least 1.5 in-sample and out-of-sample, a 2022-2025 data window, a 3-month untouched holdout, and at least 1,000 strategy variations.
- Because the backtesting framework did not support Monte Carlo simulations for pair strategies, the presenter relied on train/validation/test cross-validation as the overfitting defense.
- A 0.02% fee per fill is assumed to cover slippage, even though the exchange used (Lighter) is commission-free.
- The model ran roughly 20,000 variations per timeframe, plus additional runs, and initially found a Sharpe above 1 only in narrow configurations, with other results negative.
- The reported best strategy achieved 127% total return versus 42% for buy-and-hold, with a win rate of about 50% and a profit-to-loss ratio around 1.22.
- The strategy trades in both directions, with entries from spread signals, exits when profit fades or after a maximum holding period, and no fixed profit target.
- The presenter notes the result is educational, not financial advice, and that the strategy's code is shared in a repository linked in the description.
Chapters
- 00:00Introduction: Testing GPT 6.2 Astra for Trading Research
- 00:56Ed Thorp and the Origins of Statistical Arbitrage
- 02:00How Pairs Trading Works: The Spread and Convergence
- 03:00Setup: Verifying MCP Access and Infrastructure
- 04:08The Research Prompt and Constraints
- 05:08Methodology: Cross-Validation, Fees, and Slippage
- 07:00Scaling the Search: Thousands of Variations
- 08:10Results: Equity Curve and Performance Metrics
- 11:30Trade Analysis and Closing Remarks
Full Transcript — Download SRT & Markdown
Speaker A
Open AAI just released GPT 6.2 Astra and as always the benchmarks look amazing at least according to them. But benchmarks don't tell me what I actually care about. I don't need it to solve puzzles.
Speaker A
I need to know one thing. Can it actually do real world trading research for us because that's our use case writing strategies practicing them and finding out if there is real edge. So that's exactly what we're going to test
Speaker A
today. So I decided to give it a real challenge. Not another simple trend following strategy but something harder.
Speaker A
This time I wanted to build a pair trading strategy, also known as statistical arbitrage. And honestly, I've been fascinated by this one for a long time, and that's because of one man, Ed Thorp. In the 60s, he was a math
Speaker A
professor who figured out how to beat blackjack. He basically invented card counting and wrote a best-selling book about it. The casinos hated him so much that he had to wear disguises to keep playing. He even built a variable
Speaker A
computer with claw Shannon to beat roulette. Then he took the same thinking to Wall Street. His hedge fund Princeton Newport Partners ran for about 19 years.
Speaker A
It made around 19% a year before fees. And here's the crazy part. Out of about 230 months, only three were losing months. And every one of those losses were under 1%. And one of the tools he used to do that was statistical
Speaker A
arbitrage. So let's see if an AI can build one for us. I got to mention I am not a financial adviser and this video is for education only. But before I move on with Codex, let's actually talk about
Speaker A
Paris trading itself for those of you who are new to this. The idea is actually simple. Some assets tend to move together. Think Coca-Cola and Pepsi or Bitcoin and Ethereum. Most of the time the gap between their prices stays
Speaker A
in a normal range. We call that gap the spread. But sometimes one of them runs too far ahead of the other. the spread stretches way behind normal. That's the trade. You sell the one that went up too much and buy the one that fell behind.
Speaker A
Then you wait for the gap to close. When the two come back together, you close both sides and take the profit. And here's why it's so attractive. You're not betting on the market going up or down. You're only betting that the
Speaker A
relationship comes back. So, if the whole market crashes, both sides fall together and you're mostly protected because you have a hedged position. The risk is that the relationship breaks.
Speaker A
Sometimes the gap just keeps getting wider and never comes back. So a good pair trading strategy needs to know when to get out. So that's basically the basic of what we're asking the AI to build for us. So here's my codex and
Speaker A
first I just ask it as always, hi do you have access to JMCP? Because I need to ensure that it indeed has access to the correct MCP. Now in my machine I'm using one hub which is my main MacBook and two
Speaker A
runners which is a Mac Mini and a MacBook Air. I'm doing this setup because I need as many as CPU cores that I can access to finish these researches as fast as possible. You guys don't need it, but in case you did, you can just go
Speaker A
to the documentation of Jesse under MCP and research runners to set up something similar in case you're interested in that. Again, we don't need that. Let's just keep it simple for now. So, it did have access. Then I gave it the prompt
Speaker A
which by the way I will include in the repository which I will be sharing with you guys at the end of the video and the link will be down in the description. So don't worry about the prompt just yet
Speaker A
but I'm going to read it for you cuz it is interesting. Here it goes. Research and back test a BTC ETH Paris trading strategy on Binance futures using BTC USDT and ETH USDT. Develop entry and exit rules based on the relationship
Speaker A
between the two assets. I want a portfolio level sharp ratio of at least 1.5 in sample and one out of sample. Use four years of data from January 1, 2022 through December 31, 2025.
Speaker A
You can use dates before or after that period for out of sample testing. Use the hourly or 4 hours time frame. Use features mode and charge 0.02% on every fill, including entries and exits on both legs. Research the final 3
Speaker A
months as an untouched hold out. Test the selected strategy there once after selection and report its shop ratio separately. Do not revise the strategy based on the hold out. Escape optimization and Monte Carlo simulations. Try at least 1,000
Speaker A
different variations before stopping. If you reach the result earlier, continue until you have completed all 1,000. Then report the best candidates. So here's the thing, guys. A couple of things need explanation here. First of all, we use 4
Speaker A
hours for doing research, which is a bit longer than what I usually do in my videos. Now, the reason for that is because since this is a pair rating strategy at the moment, the J framework, which I'll be using for this research,
Speaker A
it doesn't support such a strategies in the optimization and multicolor simulations. But for back testing, it is perfectly fine. So, what that means is that in order to ensure the strategy isn't overfit, I usually run a Monte Carlo simulations if you have watched my
Speaker A
previous videos. But in this one, I cannot do that. So that's why I'm being more aggressive with the back test data.
Speaker A
So I need the strategy to go back further and also we're doing cross validation as a defense against overfitting. So what that means is that we using one period for training, one for validation and another for testing.
Speaker A
And by the way, we usually do this two in in the normal strategies that I back test. But since we have Monteol simulations, I feel much more confident with the results and it also allows me to use a shorter back test period for
Speaker A
the training. But anyways, moving on. The other thing is that the fee here is really important. So I'm using 0.02%.
Speaker A
Now you might be thinking, okay, so this is actually less than what we pay, let's say, on Binance, and that will be true.
Speaker A
So, what I'm considering here is that I would be using an exchange such as lighter, which is commission free. And the reason I chose 0.02% still is because yes, the trading fees are zero here, but still we're going to have to
Speaker A
pay for the slippage price. So, I wanted to be prepared for that. And of course, if you are choosing BTC and ETH, the slippage is actually going to be very low. So, let me actually show it to you.
Speaker A
So, you see for BTC, this is the current spread. So it is very liquid and for ETH this is desperate. So what I chose 0.02% is actually me being very cautious. Now by the way if you wanted to trade on the
Speaker A
lighter exchange we have a link for you down in the description which will give you 15% or 10% I don't remember to be honest of trading fee discounts. And that is assuming if you wanted to upgrade to their premium accounts
Speaker A
instead of the free one which is commission free. But anyways if you just wanted to use it use the link. It might help us it may not. It's a free way to support us. Anyways, moving on. So, that
Speaker A
was the first thing. And next, initially, I asked the model to try at least 1,000 different variations. But this isn't actually what I ended up doing. Now, in reality, it wasn't able to find a good result like that. I mean,
Speaker A
it did. It came back and said, "Hey, I found it like very quickly." But this was after like 30 try outs or something like that. I don't remember, but it was very fast. And obviously I wanted to continue doing research because I wanted
Speaker A
to know how crazy it could get all the result that it found it had a sharp above one but it was negative everywhere else. So anyways so I continued that and let it just continue doing research overnight but I ended up asking it to
Speaker A
try 20,000 per each time frame instead of the 1,000 that I initially did. Now while that's going I want to quickly remind you guys about our Telegram. It's the fastest way to get notified about my future work, whether it's a new tutorial
Speaker A
or a tool that I create. Also, don't forget to check out our free Discord where more than 5,000 members like you and I are hanging out there and helping out each other with algo trading so we can all succeed together. The links for
Speaker A
both are down in the description. And at the end, it came up with these results this morning. So, it worked all night and came up with this. Now, it says three candidates actually cleared your sharp targets, but the strategy selected
Speaker A
before the expanded hold out failed out of sample. I tested 20,000 variations on each time frame. Then another 8,164 per time frame. All runs use binance futures. All right, so here's the result. And this is the in sample
Speaker A
column. This is the out of sample and this is the testing period. And this is additional out of sample. Basically, you know, previous to the date that we gave it to. Now, which one should we choose?
Speaker A
Some people say that if we choose the one that is positive like everywhere, we're basically making our out of sample again in sample and we shouldn't do that. So we should just pick something blindly here without looking at these
Speaker A
and then we should just look at these results to know what sort of result we can expect from it. Some would actually choose the one that looks best on all of them. I'm going to leave that to you.
Speaker A
But I am going to choose this one because it had the best result in sample which is a sharp ratio of 2.20. In the out of sample it actually was negative but the least amount which is 0.28 and in the testing period which is in
Speaker A
2026 it was a sharp ratio of 1 and in the additional still it was positive.
Speaker A
All right. So let's take a look at how the strategy source code looks like. It trades Bitcoin against Ethereum on the hourly candles. Every trade has two sides. It buys one coin and sells the other at the same time. The spread here
Speaker A
is Bitcoin's price divided by Ethereums. But it doesn't use the raw number. It measures how far that ratio is from its own average of the last 24 candles. Now, here's a twist. This isn't the classic bit the gap closes trade. It's a trend
Speaker A
pullback. First, it checks which way the spread is heading. It compares its average of the last eight candles with its average of the last 48. Fast above a slow means Bitcoin has been beating Ethereum. Fast below a slow means
Speaker A
Ethereum has been winning. Then it waits for a pullback. Say Bitcoin is winning, but the spread suddenly drops below its eight candle average by more than a normal one candle move. That's the entry. It buys Bitcoin and sells
Speaker A
Ethereum. Betting Bitcoin takes the lead again. When Ethereum is winning, it's the mirror. It buys Ethereum and sells Bitcoin. And it only takes a fresh signal on the first candle, it shows up.
Speaker A
Now, let's talk about the filters. Two filters skip the bad entries. First, both coins have to move the same way over the last 24 candles, both up or both down. If they're drifting apart, the relationship might be breaking.
Speaker A
Second, the market has to be up over the last 12 candles. The two coins moves added together. It pulls 90% of the available margin into the trade, but it doesn't split it 50/50. It measures how much Bitcoin moves for every move of
Speaker A
Ethereum over the last 48 hours. Ethereum usually swings harder, so each side gets less money. That way, the two sides balance out and a move of the whole market mostly cancels. Then three things can close the trade. First, a
Speaker A
stop. If the spread moves 6% against it, it's out. Second, a time limit. After 96 candles, that's 4 days by the way, it closes no matter what. And third, a break even rule. Once the trade is up more than one and a half normal moves of
Speaker A
the spread, it won't let it turn into a loser. If the profit falls back to almost nothing, it closes. And notice there's no profit target. A winner keeps running until it gives its gains back or the four days are up. So, let's take a
Speaker A
look at the result. There we go. So, here's the result. But you know what?
Speaker A
Let's actually do one thing. I want to also see the benchmark which makes it easier for us to compare. So let's select this and run it one more time.
Speaker A
There we go. So here's the result if we were to compare the equity curve and all the other assets. So let's click here.
Speaker A
And this purple line here is the strategies equity curve. The white line here is the buy and hold. So assuming that we were just to buy the two assets and hold them, that's it. And the orange line is the BTC and the red line is the
Speaker A
ETH. So we can see clearly the equity curve of the strategy or our portfolio is beating all of them in basically pretty much all the periods. We can also see that the buy and hold would have made 42% while the portfolio made 127.
Speaker A
The max ordon was minus 68% in buy and hold but the portfolio was minus almost 9%. The max underwater period was 246 versus 785 days. The annual return was 31% versus 12%. And the sharp was 2.19 versus 0.49. But again guys, this is the
Speaker A
in sample result. So in reality, we're not going to get as good results as this. So just remember that the total closed trade was 588 but since this is a pair trading basically the numbers that we're getting here are are double the
Speaker A
reality right because for each trade we're going to trade both ET and BTC so this number should be basically divided by two if you want to consider like how many opportunities we try to catch here the minute was 50% which makes sense
Speaker A
because most of the times in a pairing strategy one of them is going to win and the other is going to lose most of the times that's going to be the case So this is pretty expected. The average win
Speaker A
to loss is 1.22 which is really good and this is actually why we're making money here because the win rate is 50%. So the age is basically that 0.22 here. Okay. Now moving on the average holding time is 57% which is typical for
Speaker A
a strategy that is trading the hourly time frame. But one thing to remember is that usually when we trade futures, at least perpetual futures in crypto markets, we're going to have to pay the funding fees, right? And depending on
Speaker A
your strategy, that could be in your favor or against you. But in a pair trading strategy, because these markets tend to move together, while one of them is going to pay the funding fees, the other one is most likely to gain you
Speaker A
some funding fees. And what I expect to happen here is for them to basically overlap and just make the final fees that I have to pay for funding zero. So that's why I'm not really worried about the holding time of this strategy at
Speaker A
all. And the average trades per month was 16, which is a good number. Now moving on, here's the chart for the five worst draw down periods. We can see this one was the worst one, which is basically during a bare market of 2022.
Speaker A
I mean the ending of the beginning it was actually making money which is good.
Speaker A
Moving on here is the monthly returns chart. So we can see that it made money in most months but in many of them it wasn't and it was losing money. And the annual return here it was like 20%, it
Speaker A
was 18 and here almost 60% in profit which is amazing. Here we can see which hours the strategy was more likely to take trades. And here we can see the monthly return distribution in this chart and also the mean and the median
Speaker A
for it. We can also check out the trades that it took on an actual chart. But one limitation that the J framework has so far is that we cannot check out two charts at the same time. I mean I could
Speaker A
switch this between BTC and ETH. But it would be hard for me to track like which trade was for which one because yes this one was for example a winning sorry a losing short trade. But I cannot see
Speaker A
very easily like what was the trade that the ETH took. I mean I could switch this. So actually let's check it out for the first one. Okay. So the first one was a win. So here it was a short trade
Speaker A
and it made money while on BTC it was a long trade and it lost money. Actually let's see how much it lost versus made.
Speaker A
So 257 versus 106. So if we subtract these, we can see that the first one was a losing one because while one of them won, the other lost more money. So in total it was a losing trade. Anyways, so
Speaker A
you could do this. We can also ask the AI to use these data to generate some sort of chart which would be clearer for us to see the two of them together. Now let's open check out the other out of
Speaker A
sample periods. So here's the one that actually lost money. So let's go and enable the benchmark for this one too.
Speaker A
Now here's another one that it made money in 2026. And here's another one which it made like 1%. And like there's no real pattern here. Actually, let's enable the benchmark here cuz I'm curious to know why it made money or lost money. So
Speaker A
again, this is the one that it lost money in in 2025 basically. And this was the equity curve. So it didn't do anything crazy. And the market itself, it went down and came up. So no particular pattern here and here again.
Speaker A
So I don't see any clear pattern here. All right. So overall, I think the strategy did really well in the in training, but not so great in auto sample. There's definitely potential for it, but I wouldn't trade this today
Speaker A
myself. I think it needs more work. Now, by the way, I usually submit these strategies that I show you guys on our strategies index on our website, which you can check out for other strategies that I've made. You can see for example
Speaker A
the in which periods it did what or whether they held up or not for example which is pretty fun. And you can also download the source code for most of them for free by just a free account. So
Speaker A
feel free to do so. But for this one I cannot submit it here because the strategy is using two assets at the same time which the J framework supports but our website actually doesn't. So, I cannot share it here, but I will upload
Speaker A
it on GitHub and make sure to share the link down in the description for you guys to check it out yourself. If you wanted to play around with it or build upon it to make it like really awesome,
Speaker A
maybe you would want to trade it. But if you did, just remember that with this type of strategy, be very careful and definitely either paper trade it first or trade it with very small amount of capital. So that basically if you lost
Speaker A
money, you wouldn't really care, but you would be able to see how the strategy actually behaves. Now, I hope you guys enjoyed the video. If you did, please give it a like and post a comment. Guys, I really do care about what you think.
Speaker A
And recently, I get that the market is actually depressed, so it makes sense. But the number of comments has decreased drastically. So, please, if you're watching this, let me know what you think in the comment section. It really
Speaker A
makes my day. Thank you so much for watching the video. I'll see you guys in the next one.
Topics:pairs tradingstatistical arbitrageBTC ETHbacktestingalgorithmic tradingBinance futuresGPTSharpe ratiooverfittingquantitative research











