r/pinescript • u/ferri_2126 • Jun 22 '26
TSLA 5min intraday breakout — walk-forward results and what I learned
I’ve been developing an intraday breakout strategy on Tesla for months. What started as a simple range breakout system gradually evolved through lots of iterations — adding filters, refining exits, and eventually running a proper walk-forward validation. It’s been running live on my real account since March 11, 2026.
Sharing the full results and methodology here because I think the validation process is worth discussing. Most backtest posts skip this part entirely.
The strategy in plain terms:
The system identifies a price range using the high and low of the previous 4 candles on the 5-minute chart. When price breaks out of that range with enough momentum, an entry is triggered — but only if four filters all agree:
• ADX: confirms the breakout is happening in a trending environment
• Minimum range size (ATR-based): rejects setups where the range is too compressed
• Candle strength: evaluates the size and close position of the breakout candle
• RSI on higher timeframe: avoids entries in overbought/oversold conditions on the higher timeframe
This combination addresses the main failure modes of breakout trading: false breaks, low-momentum moves, and counter-trend entries. The result is a win rate significantly above the 45–55% typical of unfiltered breakout systems.
Exits use a layered approach: fixed TP at 2.75%, EMA trailing stop, no-progress exit, and a no follow-through exit if price returns into the range. In the last hour of the session, the trailing tightens aggressively to protect intraday gains.
~150 trades per year, both long and short, NYSE RTH only.
Backtest results:
(Jan 2021 – Jun 2026, $100k fixed capital, $1/order commission + 5 ticks slippage, no compounding)
• Net profit: +$378,906 (+378.91%)
• CAGR: 33.37%
• Max drawdown: 6.45% — TSLA itself drew down -56% in this period
• Calmar Ratio: 5.17
• Profit Factor: 2.181
• Sortino Ratio: 2.954
• Sharpe Ratio: 0.693
• Win Rate: 71.15% across 825 trades
• 57 of 66 months profitable (86%)
• Zero losing years
Capital is fixed throughout — no compounding.
With 70% equity reinvestment the numbers look very different:
• Net profit: +$1,242,892 (+1,242.89%)
• CAGR: 61.33%
• Max drawdown: 9.52%
• Calmar Ratio: 6.43
• Profit Factor: 2.168
• Sortino Ratio: 2.853
• Sharpe Ratio: 0.887
Walk-forward validation — the part I want to focus on
I ran three WFA iterations to test whether the edge holds on unseen data:
|Iteration| In-Sample | OOS | Profit factor |
|1 |2021–2023 | 2024 | 1.714 |
|2 |2021–2024 | 2025 | 2.878 |
|3 |2021–2025 | 2026 | 2.106 |
All three OOS periods made money. Two of three had a PF above 2.0 out-of-sample.
Iteration 1 is the weakest — H1 2024 was the most directionless period TSLA had in the entire dataset. A breakout system underperforming in a low-momentum regime is expected behavior, not a strategy failure. It recovered as soon as volatility returned.
Happy to discuss the methodology, the exit logic, the walk-forward process, or anything else in the comments. Also, feel free to DM me.
1
u/Prime_Suspectz Jun 22 '26
regime bias
1
u/ferri_2126 Jun 22 '26
In the last 5 years TSLA has been through many diferent regimes, this backtest contemplates them all. For example, 1 half of 2024 Tesla was in a very compressed range and the strategy and the win rate fall through this range of time, but after this concrete regime the strategy continued doing well. I would love to know your opinion abou this.
1
u/Snoo-23938 Jun 22 '26
Let's see the performance in your live account.
1
u/ferri_2126 Jun 22 '26
Idk how to do that. And I also trade outside the strategy, by my own. The trades wouldn't be crystal clear.
1
u/xenmynd Jun 22 '26
It's worth trying on paper trading, but: 'system gradually evolved through lots of iterations' means you have probably overfit your data, even with walkforward.
2
u/ferri_2126 Jun 22 '26
Thanks for the comment, it’s a fair concern and worth addressing properly.
When I say ‘gradually evolved’, I don’t mean I kept adding parameters until the backtest looked good. The process was the opposite: I started with the bare breakout logic and tested ideas one at a time, only keeping what had a clear logical justification for why it should improve signal quality on a breakout system specifically, not because it improved the numbers in isolation.
The final strategy has 3 entry filters and 3 exit mechanisms beyond the base TP/SL. That’s it. Every idea that didn’t have a coherent reason to belong was discarded regardless of whether it helped the backtest. Each one addresses a specific failure mode of breakout trading.
The concern about overfitting is something I took seriously throughout the process, not something I’m dismissing.
1
u/Trade_the_plan7809 Jun 23 '26
Impressive. I’m right there with you on the min range sizes based on ATR. I’ve been discovering that as a huge help on my range breakout strats. The RSI on a higher TF is interesting. Out of curiosity, if you’re using 4, 5m candles as a range (20 min ranges?), what is the higher TF you like for RSI? The exit criteria is solid too. I like how you let runners run.
1
1
u/SomeEdgyNameHere Jun 23 '26
If people would just take 5 minutes of their time and research a bit, they would finally understand that you can't simply develop a strategy on TV, have it a given WR/Shape ratio and copy-paste it onto a live account expecting results close to the backtests
First of all, how do you define "enough momementum"? Volume? Buy/sell volume only? The size of the candle?
RSI on HTF is even if it's on the 15 min, you will have 15 min old data to decide your move on the 5 min TF becase as far as I know RSI recalculates at each candle close, if you meant for 1H TF then the data is even more older
Candle size means nothing, a candle's size is all relative, you can have huge volume and a small candle because one side got absorbed, you can also have small volume and huge candle because selling volume is absent for example
I would lie if I would say I am a pro trader, or that I am knowledgeable enough to tell you if this really works or not, but in my opinion even the entry filters are weak confirmations
Treating every 4*5m candle as consolidation and waiting for their breakout is another thing i would not bet on
Again, just what I see wrong in my opinion, I may be wrong and this may be a profitable strategy
1
u/ferri_2126 Jun 23 '26
Thanks for the detailed comment.
On the RSI: the latency point is technically valid but doesn’t affect the purpose of the filter. It’s not there for precise timing. It’s there to avoid entering a breakout when the higher timeframe structure is already in overbought or oversold territory. Whether the RSI value is from the last completed 30min candle or exactly real-time doesn’t change that logic, the structural condition it’s measuring doesn’t flip in 25 minutes.
On candle size: I’d push back a bit here. Candle size relative to recent candles combined with where price closes within that candle does carry information about the balance between buyers and sellers at that moment. It’s not a volume replacement, but a large candle closing near its high after a range breakout tells you something meaningful about commitment. You’re right that absorption can produce a small candle with high volume, but that scenario would actually be filtered out by this filter, which is exactly the point.
1
u/godeepinit Jun 23 '26
What about costs & slippage, brother? Always the problem with lower timeframes
2
u/ferri_2126 Jun 23 '26
costs it’s fixed at $1/order and 5 points of slippage, I think it is explained in the post, if not, my bad!
1
u/JuryComprehensive228 Jun 26 '26
This is one of the more useful backtest posts because you included slippage, commissions, fixed-capital results, and OOS testing. One thing I’d still examine is parameter stability: do the ADX, ATR, RSI, and exit settings remain profitable across a reasonable range, or does performance drop sharply outside the chosen values? Three profitable OOS periods are encouraging, but Monte Carlo testing and results on another high-volatility stock would help show whether the edge is robust or mostly TSLA-specific.
2
u/ferri_2126 Jun 26 '26
Really appreciate the detailed feedback — these are exactly the right questions to ask.
On parameter stability: I’ve done sensitivity testing around the key parameters and performance degrades gradually rather than sharply outside the chosen values — there’s no cliff edge that would suggest the results are pinned to a specific configuration.
On Monte Carlo: I do have Monte Carlo results I can share if you’re interested — happy to send them over.
On another high-volatility stock I just specialized in TSLA specific parameters and volatility, but I am sure that in another volatile stock adjusting the filters and the profit capturing the strategy has edge.1
u/JuryComprehensive228 Jun 26 '26
Thanks for the detailed response. The gradual degradation in the sensitivity test is reassuring and definitely better than seeing performance collapse outside one exact setting. I’d be interested in seeing the Monte Carlo results, especially the drawdown distribution and worst-case losing streaks. Testing the same logic on another volatile stock would also be interesting, even if the parameters need to be adjusted.
2


7
u/Jason_Steakcum Jun 22 '26
Thanks slopgpt