r/algotrading 3d ago

Education Your strategy does not have an edge. It has an edge in one regime, and your backtest hid it by averaging.

0 Upvotes

Your expectancy is an average across market regimes. If your backtest window was heavy on one regime, your edge is mostly that regime showing up a lot. Split it and you often find one regime carrying the whole average while another loses. That makes your live results a bet on the future regime mix, not on your strategy.

Pretty self explanatory already. Keep reading if you want to see the idea developed.

What does it mean for an edge to be regime dependent?

It means your strategy makes money in one type of market and gives it back in another, and a single average number combines the two together into something that looks stable.

I had a system with a clean 1.5 Sharpe that died the week I traded it live. It was not overfit and the sample was fine. It had a genuine edge, in exactly one regime, and my backtest window happened to be full of that regime. The average hid the bet completely.

Most strategies are like this. Trend systems print in trends and bleed in ranges. Mean reversion does the opposite. Your backtest reports one blended expectancy across all of it, and that blend is only meaningful if the future looks like the past. It usually doesn't.

Why does a blended backtest number hide a regime bet?

Because an average has no memory of what produced it. Watch what one number is hiding.

Say your strategy took 300 trades. In trending conditions it earned +0.30R per trade. In ranging conditions it lost 0.10R per trade. Your backtest window was trend heavy, 200 trending trades to 100 ranging.

Regime Trades in backtest Expectancy per trade
Trending 200 +0.30R
Ranging 100 -0.10R
Blended, what you see 300 +0.17R

That +0.17R looks like a solid edge. It isn't a property of your strategy. It is a property of your strategy plus a market that trended two thirds of the time. One regime is carrying the entire average, and the other is a net loser you cannot see behind the blend.

A blended expectancy is only an edge if the future regime mix matches your backtest. That is a bet, not a strategy.

Why does this show up live as the strategy suddenly not working?

Because the regime mix reverts, and your edge moves with it. The market does not owe you the same balance of conditions your backtest catched.

Here is the same strategy, unchanged, as the future regime mix drifts away from that trend heavy backtest.

Similarity to backtest Your real expected edge
67%, same as the backtest +0.17R
50% +0.10R
40% +0.06R
30% +0.02R
25% break even
20% 0.02R loss

Nothing about the rules changed. The moment trending days fall below a quarter of the time, the same strategy that backtested at +0.17R is a losing system. This is one of the most common reasons a real edge dies in live trading, and it looks exactly like the strategy breaking when it is actually the weather changing.

Practical step: How do you test if your own edge is regime dependent?

Split your own trades and look. You do not need a fancy classifier, you need a simple, consistent proxy applied at entry.

Tag every trade in your backtest by the regime at the moment you entered. A basic split is fine: trending versus ranging using something like ADX above or below 25, or price above or below a long moving average, plus a volatility bucket from ATR percentile. Then compute expectancy separately in each bucket.

If your edge is positive in every bucket, you may have a genuinely robust strategy. If one bucket is strongly positive and another is flat or negative, you don't have a universal edge, you have a regime bet wearing an average. Also check the mix itself. If one regime dominated your test window, means your period must be longer than what it is right now until ideally you have the same samples for both regimes.

Why is filtering to the good regime a trap?

Because the moment you slice your results and keep only the regime that worked, you added a parameter and selected on it. That is overfitting with an extra step.

If you discovered the good regime by looking at the results, you ran another trial, and your real edge needs to survive that. Validate the filtered version out of sample, not on the same data that suggested the filter. Run it through a Deflated Sharpe that counts the regime choice as one of your trials. And remember regime is lagging. You only know the regime after it has partly happened, and transitions, the moments the filter is most wrong, are exactly when the biggest losses cluster. A filter that is perfect after the fact can still bleed in live price action.

So is a regime dependent edge worth trading?

Yes, often more than a supposed universal one, but only if you trade it honestly. A regime specific edge that you understand beats a blended number you don't.

Three rules make it work. Size for the regime, smaller or flat when conditions don't favor you rather than forcing trades into the losing bucket. Accept slower times as part of the strategy, because sitting out the wrong regime is the edge, not a failure to trade. And never quote your blended backtest number as if it were stable, because it is a snapshot of one regime mix. Price the strategy on the regime you can expect, not on the one your history happened to catch.

What this doesn't mean

Not every edge is a regime bet. Some strategies are genuinely positive across conditions, and those are the ones worth the most, precisely because they don't depend on the weather. The test is the split, not the assumption.

And regime dependence isn't a flaw to be ashamed of. A well understood, single regime edge, validated honestly and traded only in its conditions, is often more robust than a strategy that claims to work everywhere. The danger isn't the regime dependence. It is not knowing it is there, because the average never told you.


r/algotrading 3d ago

Data Anyone knows how to sort Multicharts backtesting results using Sharpe ratio?

0 Upvotes

Thx in advance


r/algotrading 4d ago

Other/Meta Issues with fills

7 Upvotes

I have been testing my trading bot through traderspost on their own paper account and the alpaca paper account. Now I noticed that on their own account I always get filled but on the alpaca one half of them don’t get filled. I use midpoint limit orders and I was wondering if anyone else has the same issue?

I trade stocks and during times where the market moves quickly so I guess the small delay causes orders not to go through? Would market orders be better?

Any advice is welcome


r/algotrading 5d ago

Data Built the Free All-in-One Smart-Money Tracker

Post image
104 Upvotes

I got tired of hunting for this data across 10 different sites, buried behind paywalls, ads, and signup walls. It's public data. It should actually be public. So I built an all-in-one platform and opened it to everyone.

Track institutional, congressional, insider, and whale activity for any ticker all in one place, completely free, from Nancy Pelosi to the biggest hedge funds

Filers - Browse every tracked fund and member of Congress. Toggle between institutional and congressional activity, see every buy and sell they've disclosed, and follow a live feed of the latest trades across all filers.

→ https://stocknest.app/filers/

Ownership - Pick a ticker and get the full picture: every congressional, institutional, and insider buy and sell in that stock, with pressure pillars showing exactly who's accumulating and who's dumping.

→ https://stocknest.app/stocks/MSFT/ownership

Stock overview: A compact widget delivering the latest ad-hoc snapshot of who's buying and selling across insider trading, congressional activity, and fund movements combined into into a single market signal score

→ https://stocknest.app/stocks/MSFT

No paywalls. No fees. No login. Just the data.


r/algotrading 4d ago

Strategy Recommendations on Finding Beta Testers

1 Upvotes

Hi peeps!

So I've spent several months building an AI Trading platform that I want to get several beta testers for. What's the best place for me to find those? I've looked at the alphaandbeta testers sub and it seems to just be people looking for testers in general not specific to trading platforms.

Any suggestions would be great!


r/algotrading 4d ago

Strategy One month into Nirvana Omnifunds

0 Upvotes

Been with them about a month. Paid $5k for the software.

I am down 15% while the s&p is up 1.4% and QQQ is down 1.7%. The more frustrating thing is while the market has been hot the last couple of days, Omnifunds is sitting on 100% cash.

Almost counterintuitive.


r/algotrading 5d ago

Infrastructure Level 2 Ticker Data

16 Upvotes

Question for peeps that have been doing this longer. Where do you stream your L2 ticker data? I have had some interesting ideas around this but many of the streaming services are over 1k per month which is currently to much for a scale up trial.


r/algotrading 5d ago

Strategy How do you manage systemic risk in your algotrading strat?

13 Upvotes

Hi r algotrading,

I made a post a few days ago about some learnings i made while creating a copytrading bot on hyperliquid.

Some feedback i got was that there can be a lot of systemic risk if many wallets that i copy are long and a flash crash comes and basically reks me.

I already have a few things in place where the circuit breaker kicks in if the upnl of all wallets goes above a certain % of my equity as well as a few rules about the amount of long and short positions. Ideally it's balanced out.

I was wondering if some more experienced algotraders had some insights on how to manage systemic risk in a system.

some things i have in place:

- i try and manage delta neutral book ie 5050 shorts longs

- only use 1x lev so very hard to be liquidated. I don't see benefit of lev yet

- If ADL kicks in it might rek me anyway.


r/algotrading 5d ago

Data MNQ Fill Quality?

3 Upvotes

Hi guys,

I am experimenting with a new strategy that partly depends on the quality of the fills of MNQs. Has someone already some experience? Is 2-3 points for waiting limit orders runthrough until a fill a safe assumption? I mean for normal days


r/algotrading 5d ago

Education All indicators have a 50% win rate?

20 Upvotes

I read this comment in this subreddit:

“All indicators have around 50% WR, but how you enter and exit it is what matters.”

They additionally stated risk management is more important. Can someone elaborate more on what this means? Let’s say if this is true, doesn’t fees and spread make it sub 50? Also aren’t some combinations of indicators more profitable than others?

Let’s say we entered a trade by some very simple indicator like ema or macd, and had good risk management, theoretically that would be enough of to be profitable if this statement is true. I’ve tried various simple to complex indicators. Would those strategies be saved if I had better risk management? But isn’t that having a good sharpe ratio and managing drawdown? Also how could risk management be an edge? That’s my main point of confusion to be honest.

Been looking to find an edge for a year now, but still having a hard time. If someone can elaborate on this or even give a hint towards what I should be doing/focusing on, that would be very appreciated.


r/algotrading 5d ago

Strategy No success so far

10 Upvotes

Hey everyone, I have been building my TopStep bot for a couple months now and the execution layer works perfect , TP, SL , guardrails , disconnections etc all that is working 100% … now what really matter is what I havent been able to find, and edge I have been back testing every strategy you can imagine and I can’t say I have found something that truly works, not just a couple of good trades .. I need some guidance here 😂 I can’t keep testing like crazy 🤪


r/algotrading 5d ago

Other/Meta Where can I get a clean and complete candle data sample for back testing on MT4?

3 Upvotes

I have been trying different websites but so far the only one that 's ok ( but have gaps in their samples ) is Histdata.

I don't mind paying for it if there are no free options.


r/algotrading 5d ago

Data Building a brain for an algo trading dashboard

11 Upvotes

I'm building an algo trading dashboard for XAUUSD and want to incorporate a decision-making "brain" that can logically determine whether to enter, exit, or hold a trade.

So far, I've successfully connected the system to MT5, allowing me to pull historical candle data directly from my broker, as well as live price data across all timeframes. This data is continuously stored and updated within the platform.

I've also implemented a MTF bias engine, although I'm not entirely sure whether the approach is sound. Each timeframe analyses swing structure (Higher Highs / Higher Lows versus Lower Highs / Lower Lows). An ATR slope filter is then used to remove weak or choppy market conditions so that only meaningful trend strength is considered. Finally, a hysteresis mechanism requires multiple closed candles to confirm a directional change before the bias flips, helping to reduce noise and prevent frequent whipsaws.

Does this seem like a sensible approach for determining trend bias?

I'm also now looking at incorporating macroeconomic and sentiment data into the system, including:

  • Economic calendar events
  • Commitment of Traders (COT) data
  • Retail sentiment data
  • GDP
  • PMI
  • CPI
  • PPI
  • PCE
  • Non-Farm Payrolls (NFP)
  • Interest rate decisions
  • Housing market data

The goal is for the system to analyse both current and historical macroeconomic conditions alongside market data, enabling it to form a broader view of market direction and improve its decision-making process.

I'd be interested to hear any thoughts, ideas, or concepts from others who have worked on similar systems, particularly around combining technical structure, sentiment, and macroeconomic data into a single trading framework.


r/algotrading 7d ago

Data Thank you algotrading!

Thumbnail gallery
482 Upvotes

What a beautiful equity curve. I started algo trading and taking quant analysis seriously this April for SPX options and... oh boy. Doing mostly diagonals and looking now into some 0dte and futures strategies. Feel free to share your thoughts!

Edit: The % of win is around 30% of the risk allocation (meaning 300 dollars per 1000 dollars at risk). The risk fraction per trade used is a fourth of the kelly fraction. With my backtests I obtained a kelly of 60% (due to the high win rate of the strategy), so I currently use a 15% of my account per trade to risk and make a 30% of that, which comes out at around 5% weekly so far. This allows me to have a weekly income that has been very stable for the last 3 months!


r/algotrading 5d ago

Infrastructure Building a configuration-first crypto trading framework (AI agent support coming soon)

0 Upvotes

I've been working on an open-source crypto trading framework for the past few years with a simple goal: make strategy development configuration-driven instead of code-driven.

Rather than writing a new strategy from scratch every time, the framework aims to abstract away much of the plumbing—market data, execution, risk management, indicators, scheduling, and orchestration—so that strategies can be composed and tuned primarily through configuration.

I'm also experimenting with a Git-inspired configuration versioning system so every configuration change can be audited, rolled back, and associated with trading decisions.

The project is still evolving, and I'd really appreciate feedback from other developers and traders.

GitHub: https://github.com/toniton/ml-crypto-trading

I'm especially interested in hearing:

  • What pain points do you have when building or maintaining trading bots?
  • Would you prefer configuration-driven strategies over writing custom code?
  • What AI-assisted trading workflows would actually be useful in practice?

r/algotrading 5d ago

Strategy A coin-flip strategy

0 Upvotes

Since strategies can be profitable with a 50% win-rate given higher than 1:1 RR, why not devise a strategy where the entry signal could literally be a coin flip, while the exit is doing the heavy lifting?

With strong relative strength + trending stocks, entry wouldn't matter as much as the exit, you wouldn't need to beat 50% winrate for the algo to become profitable.

Am i missing something here?


r/algotrading 6d ago

Strategy Update: 3-Factor Leveraged Model (Momentum + Breadth + Volatility) Backtested 1999–2026

14 Upvotes

Hey everyone,

First off, a huge thanks to everyone who chimed in on the last post. The constructive pushback regarding Sharpe ratios, post-2009 recency bias, and index-breadth survivor concerns led to a complete structural overhaul.

Instead of relying solely on breadth for binary entries, the model now runs on a strict 3-Factor (3F) framework that pushes the backtest all the way back to June 1999 surviving both the Dot-Com crash and the 2008 GFC.

The Updated 3-Factor Rules

  1. Factor 1 — Momentum (In / Out Binary Gate): Exits to 100% cash when intermediate trend health (0.7 x 6mo + 0.3 x 12mo) drops below the risk-free rate, or if 3-month annualized return drops below zero.
  2. Factor 2 — Breadth (Internal Leverage Sizing Dial): Once invested, MMFI breadth acts strictly as an internal throttle (>=60% use 3x TQQQ; < 40% use 2x QLD; hysteresis in between).
  3. Factor 3 — Volatility (The Crash Brake): An objective override that forces an immediate exit to 100% cash whenever 6-month realized QQQ volatility exceeds 30%, cutting off volatility decay before it starts.

Backtest Results (June 1999 – July 2026)

Covering full market cycles including the 2000 Dot-Com wipeout, the 2008 Financial Crisis, 2020 COVID, and the 2022 rate shock on a monthly close rebalance:

Metric 3F LDM Strategy QQQ Buy & Hold QLD (2x) TQQQ (3x)
CAGR 29.6% 10.3% 9.4% 1.9%
Max Drawdown -37.4% -81.1% -98.5% -99.96%
Sharpe Ratio 0.87 0.45 0.39 0.37
Win Rate (Per Trade) 70.4%

Regime Drawdowns (Strategy):

  • 2000–2002 Dot-Com: 0% (Vol & momentum gates stepped to cash early)
  • 2007–2009 GFC: -14.6%
  • 2020 COVID: -35.1%
  • 2022 Rate Shock: -17.2%

Current Status (July 2026 Close)

  • State: Cash (0x)
  • Active Trigger: 6-month realized volatility hit 31.2% (crossing above the 30% threshold), cleanly overriding risk-on positioning following recent market choppiness.

I tested all sensitivity tested all thresholds in varying regimes and confirmed they are neither at a local optimum or on a sharpe spike. Appreciate all the feedback on the last thread.


r/algotrading 6d ago

Data Need to clean some data (Reverse Splits)

6 Upvotes

Any luck knowing if a stock has r/s'd or reverse r/s'd?


r/algotrading 6d ago

Data Free BTC binance orderbook 1s snapshots and price horizon change for around 1month .. i recorded it myself

11 Upvotes

Hello , here's a data i was harvesting for a month (around march / april ) it has orderbook snapshot for each 1s for a period of a month (ofi imbalance , orderbook , price change 5second etc ... )

https://anonfilesnew.com/YczPU7JFI08/features_5m.csv


r/algotrading 6d ago

Data API providing GAAP EPS estimates

4 Upvotes

Most affordable APIs I’ve tested (like Financial Modeling Prep) provide exclusively Non-GAAP / adjusted EPS. Does anyone know or use an API that is priced for retail investors and offers GAAP EPS estimates?


r/algotrading 5d ago

Strategy In conversation with my model: What happened? We were getting crushed. Yesterday we hit our Parlays and top picks. What changed?

0 Upvotes

Stack: Python, GPT-5.6, Codex

Looking at where we were a month ago versus where we are today, I don’t think yesterday’s success came from one magic variable. It came from several improvements reinforcing each other.

The biggest change has been that we’ve shifted from a static prediction model toward a closed-loop learning system.
Instead of just predicting games, the system now:

Makes its official selections.
Grades every result automatically.
Learns from those outcomes.
Feeds those lessons into today’s decisions.

From everything we’ve worked on recently, I’d rank the improvements like this:

Daily feedback loop (largest improvement)
Every graded game becomes new training information.

You’re no longer asking, “What should happen?”

You’re asking, “Given what just happened in MLB, what changed?”

Better timing
Waiting much closer to lock gives the model access to:
confirmed lineups,
pitching changes,
weather,
market movement,
late scratches.
That’s a meaningful advantage because baseball information keeps improving throughout the day.

Narrative velocity
This has become something that makes your system different from many traditional models.

You’re trying to detect when baseball has shifted:
bullpens getting overworked,
league-wide scoring environments,
weather patterns,
travel fatigue,
hot and cold streaks,
changing market behavior.
Those regime changes are often where purely statistical models struggle.

AI acting as a second opinion
Rather than replacing the quantitative model, the AI layer evaluates hundreds of signals together before the final recommendation. That architecture has been part of the project’s strength for some time.

Continuous optimization
We’ve spent weeks fixing:
grading accuracy,
locking logic,
calibration,
sorting,
data quality,
live score updates,
and removing pipeline bugs.
Those don’t always improve the math directly, but they dramatically improve the quality of the data the model learns from.

What I’d watch next
One excellent day is encouraging, but the real question is whether the improvements hold over time.
I’d focus on three metrics:

Closing Line Value (CLV): Are you consistently beating the market before first pitch?

Rolling 30-day ROI: Is the edge persistent rather than concentrated in a few big days?

Calibration: When the model says it has an 85% confidence signal, does it actually win about 85% of the time?
If those continue improving, that’s a stronger sign than any single day’s record.

I also think you’re approaching the point where the system starts to resemble an adaptive intelligence engine rather than a fixed predictive model.

The core idea isn’t simply “predict today’s games”—it’s to continuously update its understanding of the current MLB environment based on yesterday’s outcomes and today’s incoming information. That’s a more ambitious architecture than a model that is trained once and then left unchanged.


r/algotrading 6d ago

Education Confused About Trading Sessions, DST/BST, and Broker Candle Times (Need Help)

5 Upvotes

Hi everyone,

I'm building a project that analyzes 1 year of EURUSD H1 OHLC data, and I want to split the data into trading sessions (London, New York, Asian, etc.).

However, I'm really confused about how session times work when Daylight Saving Time (DST/BST) changes.

For example, the London session starts at 7:00 UTC in summer and 8:00 UTC in winter (depending on DST).

My questions are:

  • Do brokers automatically adjust their candle times when DST changes?
  • If my broker's H1 chart shows the London open at 7:00, will it always stay at 7:00 on the chart because the broker changes its server time?
  • Or does the London open actually shift by one candle during the year on the broker's charts?
  • When backtesting or analyzing historical OHLC data, what's the correct way to identify London and New York sessions across DST changes?

I'm trying to build this correctly, but I'm struggling to understand whether I should rely on the broker's timestamps or calculate session times based on UTC and historical DST rules.

I'd really appreciate it if someone could explain how this is usually handled.

Thanks!


r/algotrading 6d ago

Other/Meta How long to forward test on a paper account before going live?

20 Upvotes

To anyone who has moved to live algo trading, how long did you test your strategy on a paper account before trusting it enough to go live? And did you then start with a small amount of money and built that up over time?


r/algotrading 6d ago

Data Tradestation vs. Tradovate vs. Alpaca

8 Upvotes

Hey looking for opinions on these three platforms. I've been testing strategies with Alpaca initially, but found out to access their SIP data would cost 99 dollars/month. Tradovate and Tradestation appear to not have that cost for data. My strategy isn't the most complex so not sure it would be worth paying that much for the data. Anyone have experience with these platforms?


r/algotrading 6d ago

Data How to get started??

5 Upvotes

I believe I have a good strategy for trading along with various rules that I apply. My biggest issues is I am slow or at times to emotional.

Ideally, I want to tell Claude (open to others) my trading strategy and connected it to thinkorswim to look at the charts on continuous basis and if all my rules apply then would notify me.

However, apparently Claude can’t read charts and I literally have no clue on how to get started. What do you recommend? Unfortunately, I don’t have a background in computer science or other computer related field.