r/algotradingcrypto • • 3h ago

How do you decide if a limit order would have filled in your backtest?

1 Upvotes

Backtesting a bot that enters with limit orders gets messy at the fill logic. If price only touches the level, did it fill or not?

Curious how you handle it:

  • Do you count a touch as a fill, or wait for price to trade through it?
  • Do you add a volume or queue check, or keep it simple?
  • How far off were the backtest fills once the bot ran live?
  • Did anyone just switch to market orders to skip the whole problem?

Not after a perfect answer, just how you deal with it.


r/algotradingcrypto • • 5h ago

Our 80% volatility band held 80% overall and 64% on Saturdays. The obvious fix got Saturday to 75% but failed one of its own locked gates (crypto, pre-registered)

Thumbnail bitdataview.com
1 Upvotes

- What:our site shows an 80% band for each coin's realized volatility tomorrow, for 144 Binance coins. Over five years of test days it holds 79.7% of the time. That number looked perfect.

- Split by the day being forecast, it isn't: Saturday 63.8%, every other day 80–85%. On Saturdays, 30% of coin-days came in *below* the band; the target is 10%.

- Weekend vs weekday:72.9% vs 82.4% pooled over all coin-days. The locked statistic, the mean weekly gap, is −10.0 points (block t −10). Same sign in 5 of 5 time slices, on both sides of the spot ETFs, and in 129 of 129 coins with at least 100 weekend test days.

- The obvious fix (day-of-week terms in the model) lifts Saturday to 75.1% and improves the forecast loss (block t 3.25). But Saturday still swings between 67% and 79% across time slices, so it failed the one locked gate that asked for stability.

- So the card is unchanged for now. Three versions now run side by side on live data until 24 March, with the decision rule written down in advance.

Why we looked

A 1992 paper on daily commodity futures (Yang & Brorsen, *American Journal of Agricultural Economics*) finds volatility differs by day of the week (higher on Mondays and after holidays). It also checks calibration separately from fit. Our card's model has no day-of-week term, and its band comes from forecast errors pooled across all days. A pooled 80% can hide one day at 64% and the others at 84%.

Crypto weekends being quieter is well known. What I wanted to know was whether that breaks a calibrated band, and where.

Setup

- The band, exactly as the live card computes it:

- The forecast is a log-HAR regression for tomorrow's realized variance (sum of squared hourly returns), using the 1-, 5- and 22-day components. It's refitted daily on the last 1,250 days, with a Duan correction.

- The band is the forecast times the 10th and 90th percentiles of *that coin's own* forecast errors over the last 365 days (at least 200 errors, all realized before the forecast day).

- The card shows the square root as a typical daily move in %. Coverage is the same either way.

- Data: the 144 coins on the card, Binance spot, test days Sep 2021 – Oct 2026, 123,605 coin-days. Days are UTC. "Saturday" means the UTC Saturday being forecast.

- Statistic: for each week, coverage on Saturday + Sunday minus coverage on Monday–Friday. 13-week block bootstrap.

- Verdict rule (locked): a "weekend deviation" needed all of the following:

- a gap of at least 5 points, with the block t past the critical value;

- the same sign in at least 4 of 5 time slices;

- the same sign before and after the spot ETFs;

- the same sign in at least 60% of coins, counting coins with at least 100 weekend test days. That's 129 of the 144. The other 15 have shorter histories. The model needs 1,250 days of data plus 200 past errors before its first band, so their test days only start between Nov 2025 and Mar 2026 (67–97 weekend days each).

- Power, checked before the lock: a placebo that labels two random *weekdays* as "weekend" each week gives a gap with sd 1.3 points.

Results

| day being forecast | Mon | Tue | Wed | Thu | Fri | Sat | Sun |

| inside the band | 80.3% | 83.7% | 84.6% | 82.0% | 81.6% | 63.8% | 82.0% |

| below (quieter than forecast) | 3.8% | 7.0% | 6.7% | 7.2% | 7.3% | 30.0% | 9.1% |

| above (louder than forecast) | 15.9% | 9.3% | 8.7% | 10.8% | 11.2% | 6.2% | 8.9% |

- Weekend − weekday, mean weekly gap: −10.0 points (t −10.0; the pooled gap is −9.5, because every week counts equally, including early weeks with fewer coins). By time slice: −11.6, −11.4, −7.4, −9.9, −9.7. Before the ETFs −10.1, after −9.9.

- It's Saturday, not the weekend. Sunday is normal (82.0%).

- **Monday misses the other way:** it has the highest share above the band of any day (15.9%).

- The same Saturday gap shows on 29 coins outside the card: 64.6% (descriptive only, not part of the lock).

Why Saturday and not Sunday

The day profile fits a simple story about the model's one-day lag:

- Saturday is forecast from Friday, a normal trading day. Saturday is quiet, so the forecast is too high and realized volatility lands below the band. On the median Saturday, realized volatility came in about 25% lower, relative to the forecast, than on the median weekday.

- Sunday is forecast from Saturday. The quiet day is already in the 1-day component, so the forecast comes down, and Sunday is quiet too. Coverage is fine.

- Monday is forecast from quiet Sunday, but Monday isn't quiet. Hence the most misses above the band.

The pooled band averages these three errors away. So does the per-coin hit rate the card shows, because it's pooled over days too.

Predictions (locked before the run):

- My co-researcher: weekend deviation.

- Me: deviation 30%, small difference 45%, equal 25%. I expected the 1-day lag to absorb most of it. It absorbs Sunday, not Saturday.

- I did call the side effects (weekend misses below the band > weekday, 85%; Monday has the most misses above, 50%). Both happened.

The fix, and why it isn't on the card

A second locked test added six dummies for the target weekday to the same log-HAR, with the same window and the same band rule. A known-answer check came first:

- on synthetic coins with a planted Saturday effect, the rule passed the fix;

- on synthetic coins without one, it rejected it (the six extra parameters cost a little forecast accuracy).

| | card | with day terms |

| Saturday coverage | 63.8% | 75.1% |

| other days | 80.3–84.6% | 79.0–81.5% |

| overall | 79.7% | 79.4% |

| mean log band width | 1.909 | 1.814 |

| forecast loss (QLIKE), card − new | | +0.0131, block t 3.25 |

Six gates, all locked. It passed five:

  1. ✓ every day 75–85% (Saturday only just: 75.1%);
  2. ✓ overall 77–83%;
  3. ✓ better forecast loss (block t ≥ 2);
  4. ✓ band no more than 5% wider (it got narrower);
  5. ✗ Saturday 75–85% in at least 4 of 5 time slices, and before and after the ETFs;
  6. ✓ at least 80% of coins at 70% or more on Saturdays, counting coins with 100+ Saturday test days (91 of the 144): 93%.

Gate 5 failed. Saturday coverage by slice: 66.9%, 71.1%, 76.2%, 79.2%, 72.6%. Before the ETFs 74.3%, after 75.2%.

What's left after the fix:

- The average shift is gone: misses below the band on Saturday fell from 30.0% to 13.1%.

- But Saturday now misses on both sides (13.1% below, 11.8% above). Saturday errors are more spread out than other days' errors, so the band should be *wider* on Saturdays, not just shifted.

- Outside the card (29 coins): Saturday went from 64.6% to 72.5%. The loss gain wasn't significant (t 0.47), and Monday got worse (80.2% → 76.1%).

My co-researcher predicted the fix would pass. I gave it 60% and named gate 5 as the most likely failure. It was.

What runs now

The fix was judged on the same coins and period where the problem was found. There is no clean holdout in this data, so the next step is live data.

From 3 December, a daily job on our server computes three 1-day bands for all 144 coins, side by side:

- old: the card as it is;

- day terms:the fix above;

- day terms + Saturday width: on Saturdays only, the band edges shift by the gap between the day-terms model's Saturday errors and its errors on all days (pooled over the 144 coins, last 365 days).

It reads the card's own data. At the opening it also checks that its "old" band matches what the card actually showed each day.

Decision rule, locked before the first record:

- A version passes if all of these hold:

- Saturday coverage is 70–90%, and at least 5 points above the old band's Saturday;

- every other day is 72–88%;

- overall is 75–85%.

- If none passes, the card stays as it is.

- If both pass, the one whose Saturday is closest to 80% wins.

- It opens on 24 March 2027 and covers about 110 forecast days, including 15 Saturdays.

The ranges are loose on purpose. With only 15 Saturdays, a few unusual dates can move Saturday coverage by several points. So this is an honesty check on new data, not proof.

Predictions: my co-researcher says day terms + Saturday width. Me: that version 45%, day terms alone 30%, neither 25%.

Until then the card shows the old band. On Saturdays it holds about 6 in 10, not 8 in 10. Swapping in a version that failed one of its own gates would trade a known error for an unchecked one.

Limits

- No clean holdout for the fix (said in the lock); the live comparison is the real test.

- UTC days only. A different day boundary could move the effect. Not tested.

- Only the 1-day band. The 5- and 20-day bands always span a weekend, so I'd expect much less there, but that's untested.

- One exchange, spot only.

What I take from it

An overall coverage of 79.7% looked perfectly calibrated, and the per-coin hit rates looked fine too. Neither was split by anything the model can't see.


r/algotradingcrypto • • 6h ago

Has anyone compared Binance Futures demo fills with what you'd really get on mainnet?

1 Upvotes

I'm about to paper trade a small strategy on the Binance Futures demo account and I'm not sure how much to trust the fills.

From what I can see, demo orders don't touch the real order book. So there's no queue position, no partial fills, and no slippage from your own size. Some demo books also look a lot deeper than the real ones on the same symbol. If that's right, the demo is basically a best case, and a strategy that only works there might not work at all.

What I'm planning to do is log the real mainnet best bid and ask at the moment each demo order fills, and compare the two afterwards. Has anyone done something like this? How big was the gap for you, and did it get worse on thinner symbols?


r/algotradingcrypto • • 10h ago

We simulated 224 Supertrend (10, 3) flips on BTC & ETH over 12 months. Here is what actually happened.

1 Upvotes

Every YouTube trading channel has a video claiming the Supertrend is an "infinite money glitch" on crypto.

We wanted to see what happens when you strip out the curve-fitting and run the classic Supertrend (10, 3) on 1-hour bars across a full 12-month window with realistic fees and conservative stop execution.

Here is the exact setup and the verified simulation numbers.

---

The Setup ("Alla Scrumptious")

* Indicator: Supertrend (ATR Period: 10, Multiplier: 3.0)

* Timeframe: 1-Hour (1H) bars

* Test Window: Oct 1, 2025 – Sep 30, 2026 (12 months)

* Entry: Long on the close of the bar where Supertrend flips from Red to Green.

* Exit Rules:

* Stop Loss: 2.5%

* Take Profit: 5.0% (1:2 Risk-to-Reward)

* Time Stop: 30 bars max hold (exits at market close if neither TP nor SL is hit)

* Realism & Friction Model:

* Crypto Fee: 0.10% per trade (round-trip friction)

* Equity Fee: 0.05%

* Conservative Intra-Bar Ordering: If both SL and TP price levels are touched within the same bar, SL is evaluated first.

---

The Results [SIM]

| Asset | Timeframe | Closed Setups | Win Rate | Profit Factor | Net Move % | Max Drawdown |

| :--- | :--- | :--- | :--- | :--- | :--- | :--- |

| BTCUSDT | 1H | 112 | 44.6% | 0.96 | -6.9% | -27.0% |

| ETHUSDT | 1H | 112 | 41.1% | 0.95 | -10.0% | -27.8% |

| SPY (Control) | 1H | 28 | 46.4% | 0.66 | -8.8% | -13.5% |

| AAPL (Control) | 1H | 24 | 58.3% | 1.91 | +18.4% | -11.5% |

---

Key Takeaways

  1. Crypto Chop Kills Trend-Following Flips: Across 224 total setups on BTC and ETH, the strategy lost money (Profit Factor < 1.0 on both) and suffered brutal ~27% drawdowns.
  2. Lag Into Exhaustion: Because the Supertrend requires a 3× ATR move before flipping green, the entry often fires after a massive expansion candle — right into local liquidity exhaustion, triggering the 2.5% stop on the subsequent pullback.
  3. Equities Behave Differently: On an individual trending equity (AAPL), the same parameters produced a 58.3% win rate and a 1.91 profit factor (+18.4% net move). Strong institutional momentum trends follow through; crypto mean-reversion ranges chop it to pieces.

If you trade Supertrend flips on crypto, you need a regime filter (e.g. ADX > 25 or higher-timeframe EMA alignment) before taking raw signals.

What rules or filters do you use to stop indicator flip whipsaws?

Edits: Ran the experiment on a completely fresh, out-of-sample year (calendar 2024 on Binance 1H klines) and benchmarked against 300 Monte Carlo random-entry runs with the exact same exits (2.5% SL, 5% TP, 30h max hold, 0.10% fees, SL evaluated first).

Here’s what happened:

  1. Raw Flips vs Random Entries:
  • BTCUSDT Raw Flips: 96 setups, 43.8% WR, 0.81 PF, -21.3% net move, -30.5% MaxDD.
  • BTCUSDT Random Entry Baseline: ~98 setups, 47.3% WR, 1.06 PF, -21.9% MaxDD.

Raw flips literally underperformed random entries. Buying a 3× ATR expansion candle into resistance consistently gets penalized by the stop.

2. Testing Candidate Rules Out-of-Sample:

  • 200 EMA Filter (Price > 200 EMA): Cut the trade count nearly in half (54 on BTC, 50 on ETH). On BTC, MaxDD dropped from -30.5% to -9.5% (PF 1.06). On ETH, Win Rate jumped from 47.9% to 60.0% and flipped net return from -7.2% to +32.7% (PF 1.69).
  • First Retest Entry (Structural Stop): Dropped trades to ~30. On BTC, it generated a 1.40 PF with just a 7.4% max drawdown by anchoring the stop to the Supertrend line instead of a static 2.5%.
  • ADX > 25: Virtually useless (PF 0.78 on BTC, 0.99 on ETH). By the time the Supertrend flips, ADX is already elevated.

r/algotradingcrypto • • 22h ago

How do you size a basket when half the names have almost no book?

1 Upvotes

I'm testing a small long-short basket across a few dozen thin instruments. Some of them have maybe 15–20k on each side within half a percent of mid, and a few are worse than that.

What I can't decide is how to size it. If I size by the thinnest name, the whole basket ends up tiny. If I size by average depth, the thin ones get hit on every entry and exit, and that slippage probably eats whatever the edge is.

Depth also isn't symmetric. The bid side can be twice the ask side on the same name, and it flips around during the day. Do you size each leg by the side you actually trade, or use some average and live with the error?

If you've run anything on thin books for real, I'd like to hear how far live slippage ended up from what you planned.


r/algotradingcrypto • • 1d ago

Crypto.com US Perps: API

1 Upvotes

UPDATE: Solved, thanks all for the help
Turns out perp instrument names are in the form XXX-YYY-PERP (SOL-USD-PERP rather than SOLUSD-PERP, as the documentation led me to believe). I actually CAN access those via the public instrument endpoint but you need to append the query string: https://api.crypto.com/fcm/v1/public/get-instruments?inst_type=PERPETUAL_SWAP

Hi all, I've been trying to execute buy/sells for US crypto perps via API. I can trade on the web UI no problem, my derivatives account is funded and has sufficient collateral. I have created a FCM API key with the proper permissions.

Following the API docs I can see the US WebSocket endpoint for user.order is at wss://stream.crypto.com/fcm/v1/user but I get an error, "Unknown symbol". I can try the /exchange/ endpoint but then I get the USER_NO_DERIV_ACCESS error (understandably so, because that's not the FCM endpoint)

Digging a little deeper even checking the https://api.crypto.com/fcm/v1/public/get-instruments endpoint I don't see anything with perps on there, they show up in the /exchange/ endpoint but, as I observed, I obviously can't trade there.

Much appreciate any pointers.


r/algotradingcrypto • • 1d ago

Khresmos: plataforma para probar estrategias de trading algorítmico (beta cerrada, feedback bienvenido)

Post image
1 Upvotes

Para quienes quieran explorar el trading algorítmico, les comparto un proyecto nuevo: Khresmos (khresmos.trade).

Está en fase beta (v0.9) y por ahora el acceso es libre para grupos pequeños de usuarios que quieran probarlo. Es una plataforma de simulación sobre cotizaciones reales, sin dinero real ni conexión a exchanges.

Una aclaración importante: el foco es la operación por bots algorítmicos, no el trading manual. La idea es armar una estrategia con una plantilla de parámetros, ponerla a prueba contra datos reales y medir si le gana a simplemente comprar y mantener.

Todavía falta mucho por desarrollar, y por eso busco feedback: fallas que encuentren, cosas que no se entiendan y funciones que les gustaría ver. Pueden escribirme a khresmos.trade@gmail.com.

Si el proyecto llega a una etapa comercial, los 100 usuarios que más feedback aporten tendrán acceso sin cargo.

¡Gracias a quienes se animen a probarlo!


r/algotradingcrypto • • 2d ago

In risk units, Bitcoin has no bull and bear regimes. It has rallies, and everything else is flat.

Thumbnail bitdataview.com
6 Upvotes

I wanted to know whether a "bull/bear" label on Bitcoin can work in principle. A recent

paper on sliding-window regime detection (Pambukyan & Nersisyan, arXiv 2611.34905) shows that

any window label is wrong for about half a window after every regime switch. The best window

then depends on a single number: how often regimes switch, relative to how clearly their drifts

differ. So first I measured whether BTC has drift regimes at all, and what shape they have.

Every test below was locked before it ran: design, decision rule, power check, and both my

research partner's prediction and mine. Daily BTC, Aug 2017 – Sep 2026.

Setup

- Returns: daily log returns divided by a trailing EWMA volatility (λ 0.94), clipped at ±4σ.

So drift is measured in risk units: "how many σ per day".

- Model: a two-state hidden Markov model with the **same variance** in both states, so it can

only split on drift, not volatility. Each state's expected stay is at least 30 days.

- What this lens can and can't see: it asks "is there a regime in risk-adjusted drift?" Volatility

regimes are deliberately left out: they're obvious in crypto and weren't the question. But that

choice shapes the answer, and it matters most for bear markets (section 4).

- Null: a GARCH(1,1)-t with constant mean, fitted to the same series and run through the same

pipeline, 200 simulations. Then the same with **GJR-GARCH-t** (volatility rises more after

drops), because asymmetric volatility could fake a regime.

1. There is a regime, but it's a rally, not bull/bear

| | likelihood ratio | GARCH-t null 95% | GJR null 95% |

| BTC | 12.3 | 7.0 | 5.4 (p 0.015) |

| 9-coin equal-weight index | 9.4 | 6.8 | 7.3 |

| ETH | 7.2 | 5.4 | 8.2 (p 0.07, borderline out) |

The two states in BTC aren't "up" and "down":

- Rally state: +0.32σ per day, lasts ~37 days, about 17% of the time (the model's long-run

share; in hindsight, 412 of 3,260 days, or 12.6%, have rally probability above 0.5).

- Everything else: −0.03σ per day, flat. Bear markets don't separate from flat in risk units.

Eight rallies in nine years: late 2017, spring 2019, Oct 2020 – Jan 2021, Jan 2023, Oct–Dec 2023,

Feb–Mar 2024, Oct–Nov 2024, Aug 2026. Nothing in 2018, 2022 or 2025. ETH is the exception: it

splits more symmetrically into bull and bear.

Leverage asymmetry doesn't explain it. The fitted GJR asymmetry coefficient for BTC is 0.005

(for equity indices it's typically 0.1 or more).

Why "price above its moving average" fails

The core of most regime labels is "price > EMA". In a world simulated from the fitted model:

- The window length of a 4h EMA200 (~33 days) is close to the best possible window.

- The threshold is wrong. "Above the EMA" means zero drift, so it calls the flat 83% "bull"

half the time. Its error is **0.42**. Always saying "no rally" errs only **0.17**.

- Even the optimal Bayes filter, with the true parameters, only gets to **0.148** against that

0.171 base rate. Calling a rally in real time is close to hopeless. Rallies are obvious only

in hindsight.

3. One statement that does work, in one direction only

My research partner's idea: "there's no rally outside the trend." We tested it against the trend

structure our site already shows: a 4h ATR trailing stop (4×ATR "fast", 6×ATR "calm"), using

the state known at the start of each day. Rally days come from the model, in hindsight.

Locked threshold for "supported": at least 80% of rally days inside the uptrend, and rally

probability outside it at most 5%.

| | rally days inside uptrend | rally probability outside uptrend |

| **fast trend (4×ATR)** | **87%** [82–92] | **3.7%** [1–7] |

| calm trend (6×ATR) | 94% | 1.7% |

| base rate (share of rally days) | | 12.6% |

Supported. Outside an uptrend, a rally day is a third as likely as on average.

But how much of that is mechanical? Both the trend and the rally are built from the same price

rises, so some overlap comes free. I ran the same definitions on simulated prices **without** any

regime (GJR at 4h, keeping paths whose "rally" share looked like BTC's):

| | inside uptrend | outside uptrend |

| regime-free world | 73% | 7.5% |

| world with BTC's rally regime | 87% | 4.0% |

| **real BTC** | **87%** | **3.7%** |

Real BTC matches the rally world almost exactly. Against the regime-free reference, the fast

trend sits at the 94th percentile (borderline) and the calm trend at the 100th.

It only works one way.80% of uptrend days are *not* rally days. The bear years 2018 and 2022

hold only a quarter of those; the rest are ordinary up-drifts that never become a rally. "No

uptrend → rally unlikely" is supported. "Uptrend → rally" is not. In 4 of the 8 rallies the fast

trend was already up on day one; in the other 4 it was 1–6 days late.

4. Falls don't show up as a drift regime

So is there a "down rally"? I fit a three-state model (down / flat / up), same lens, against BTC's

own two-state rally world.

Before running, I checked power: a planted down-rally of −0.2, −0.3 or −0.45σ per day is found

only 6%, 17% or 29% of the time. A realistic one is smaller still. The 2018 bear market lost ~80%

in a year, but at ~4% daily volatility that's only ~−0.1σ per day. So a null result would mean

"couldn't measure", not "doesn't exist", and I wrote that down first.

Result: likelihood ratio **0.005**. The three-state fit simply reproduced rally + flat. Same in

the index; ETH split its up state instead. A post-lock check with more optimizer starts found a

better fit, but its third state covered **four days**: Nov 8–9 2022 (FTX) and Jun 1–2 2026. That's

two crash clusters, not a drift.

The way I read it, **in risk units, up is a regime and down is an event.** Rallies are calm and

persistent, so their drift stands out. Falls are violent, so dividing by volatility shrinks their

drift. This is partly the lens: the signature of a bear market is high volatility plus negative

drift, and I removed the volatility on purpose. A model that lets variance switch too would very

likely find a bear state, but it would be defined mainly by volatility. The open question is

whether that high-volatility state also carries a negative drift you could detect. I haven't run

that test yet. So this is not "falls aren't regimes"; it's "falls don't separate in risk-adjusted

drift, and with this much data we couldn't have seen it if they did."

5. Bubble tests may be measuring the same thing

Almansour et al. (2026, IJFS 14/323) show that pointwise GSADF bubble tests raise alarms in

**98%** of samples generated from a regime-switching drift model with no bubble at all. Their BTC

bubble episodes (late 2017, Nov 2020 – Jan 2021, Feb–Mar 2024, Nov 2024) all overlap my rally

periods. The HMM also finds 2019, early 2023 and late 2023, and it ends the 2020–21 rally in mid-Jan

2021 where GSADF runs to April. In risk units, the high-volatility rise of Feb–Apr 2021 looks flat.

This comparison is an unlocked look, and both methods are defined from price, so it isn't

independent confirmation. But "bubble" and "rally state" may be one object.

Limits

- Mainly one asset and ~8 rallies. The rally labels are in-sample hindsight.

- The two-state, equal-variance model is a choice, and it hides volatility regimes by design. The

nulls are parametric (GARCH-t, GJR-t).

- I also tried to make a live "rally probability" usable. Even in a perfect simulated world, a

calibrated probability would pass a ±5-point check only 34% of the time on 2023–2026 data (five

rallies). So I didn't run it on real data. Instead it will log live in a shadow and be tested on

future data.

- Predictions: my partner called the robustness result, the trend statement and the mechanical

overlap; I'd guessed "partially" on the trend. On the down-rally, my partner expected one and I

didn't.

What I'll do with it

On the site's regime card, one descriptive line under the trend, and only in the direction that

held: "Fast trend is down. Since 2017, only ~4% of days in this state were rally days (12.6%

overall)." That's P(rally | trend down), the question a reader actually has, not P(trend down |

rally), which is 13% and easy to misread. No "rally now" claims, no live probability.

Happy to hear where this breaks. Especially: is there a better way to see down-moves as a regime

than drift in volatility units? And for a joint drift + volatility model, what would convince you

that a high-volatility state has a real negative drift, and not just fat left tails?


r/algotradingcrypto • • 2d ago

Market-neutral funding carry on 28 Binance perps: Sharpe 0.9, β≈0… and why I'm not trading it

1 Upvotes

Perps pay funding — crowded-long coins pay positive funding, unloved coins pay little/negative. So a simple cross-sectional idea: each day rank the universe by trailing funding, short the top quartile (collect funding + fade the crowd), long the bottom, equal-weight, dollar-neutral. 28 Binance USDⓈ-M perps, daily rebalance, ~7 yrs, vol-targeted to 15%.

The headline looks great:

  • Sharpe ~0.90
  • BTC-beta −0.02 (genuinely neutral, not disguised long-crypto)
  • Median universe funding +10%/yr on offer

If I stopped here I'd have a tidy "market-neutral crypto alpha" post. Two checks kill it:

1) Deflation. I pre-registered the rule (3d signal, 25% quantile, daily rebalance) and deflated the Sharpe for the variants I considered (DSR). Deflated → ~0.80, below my 0.95 bar. After honestly accounting for my search, I can't rule out luck.

2) Cost. Daily rebalance = brutal turnover. Cost ladder, per side:

  • 2 bps (maker): Sharpe +0.90
  • 7 bps (taker): +0.43
  • 15 bps (taker + alt spread): −0.31

It only "works" at maker cost. Cross the spread on the thinner alts and it's gone.

And the decomposition: only ~40% of the P&L is the actual funding carry — the majority is the price leg (mean-reverting the crowded names). So it's less "harvest carry," more "fade the crowd," which is the more fragile thing to lean on.

Takeaways I think generalize:

  • A neutral-looking Sharpe means nothing until you (a) deflate for your search and (b) run a cost ladder, not one optimistic number.
  • Daily-rebalanced crypto books are a cost mirage — gross edge real, net edge often isn't.
  • β≈0 is necessary but not sufficient; check where the P&L comes from.

Not giving up on it — two untested levers: more breadth (28 coins is thin for cross-sectional), and combining it with an equally-weak-but-uncorrelated momentum sleeve (two weak neutral edges can clear a bar neither clears alone).

Questions for the room:

  • Anyone running cross-sectional funding/crowdedness at scale — does breadth (50–100+ coins) actually rescue the DSR, or does cost scale with it?
  • For daily-rebalanced neutral books, are you actually getting maker fills, or is 7bps+ the honest number?

That's the "honest results" angle. The alternative, broader-reach framing is a PSA: "Your daily-rebalanced crypto backtest is lying to you about cost — a worked example" — same content, but the cost-mirage lesson is the headline instead of the funding book. That one tends to pull more upvotes because it's useful even to people not doing carry.


r/algotradingcrypto • • 2d ago

Tested Fear & Greed, funding, breadth and volume filters on 5 coins out of sample. 18 of 20 lost money

1 Upvotes

These filters get recommended a lot, so I tested them properly on my long-only spot strategy (ETH, SOL, BTC, AAVE, TRX). The filter could only skip a buy, nothing else changed. 1m Binance data Oct 2024 to Sep 2026, fees included.

For each coin I searched ~80-100 rules per filter, then ran it walk-forward: best rule picked on the previous 6 months, used blind on the next quarter, 6 quarters.

Result vs no filter ($300 per coin):

Fear & GreedFunding / OIBreadthVolume
ETH-$66-$15-$45-$1
SOL-$47-$12-$39-$57
TRX-$9+$1-$6-$39
BTC-$18-$23-$7+$1
AAVE-$31-$29-$42-$53

Why I think they failed:

  • The average loss never changed. It's set by the stop. Filters changed how often a coin lost, not how much, so skipping buys mostly skipped winners.
  • Every great-looking rule was one episode. SOL's extreme-greed skip was all Nov-Dec 2024.
  • Rules don't transfer. I moved the 12 best rules to other coins unchanged, 1 of 12 still worked.

Only ~2 years of data and long-only spot, so maybe it's different for perps or shorts.

Has anyone found a sentiment or funding filter that actually held up out of sample?

Code and reports: https://github.com/zulfi011/z-bot


r/algotradingcrypto • • 2d ago

if you're looking for a platform that's open to bots

0 Upvotes

if you are looking for a platform that's open to bots, you are welcome to use trading bots on ours. We do use Cloudflare to protect against attacks but have tried to set it be bot friendly. Let me know if you have any issues.

You can play with free money for free. I've temporarily removed the name of the site due to a comment. If there's something wrong with this or it's not allowed let me know.


r/algotradingcrypto • • 2d ago

3commas v1 alternatives?

1 Upvotes

had two DCA bots on 3commas since 2022, about 30k in btc and eth. v1 shut down in september and now my positions are just sitting there. the whole thing made me not want to give api keys to some platform again. looking for a DCA bot or anything automated where I can keep funds in my own account. fine with moving exchanges if needed. what did you guys switch to?


r/algotradingcrypto • • 3d ago

Do you backtest perp bots on spot candles or perp candles?

1 Upvotes

Free history is easiest to get for spot, so a lot of backtests seem to run on spot candles even when the bot trades perps. But perp price can drift from spot in fast moves, and some exchanges trigger stops on mark price instead of last price, depending on settings.

Curious how people here handle it:

  • Spot data, perp data, or candles from the exact exchange you trade on?
  • Did your signals change when you switched the data source?
  • Last price or mark price for stops in the backtest?

Not looking for a perfect setup, just what you actually do. Thanks in advance.


r/algotradingcrypto • • 3d ago

what do you think about learning cryptotrading with chatGPT?

0 Upvotes

i want to learn cryptotrading but idk how, so i started learn it with chatGPT. what do you think about it?


r/algotradingcrypto • • 5d ago

Building my first crypto algo bot. How do you go from backtest to a strategy that holds up live?

Thumbnail
gallery
25 Upvotes

Hi all, I'm working on an algorithmic trading bot for crypto and want to sanity-check my approach before risking real money.

What I have so far:

  • Market: BTC/ETH/XRP/SOL/ADA perpetuals on Binance
  • Timeframe: 15m / 1h
  • Strategy idea: trend-following with EMA crossover + ATR stop / mean reversion on RSI
  • Tools: Python, backtrader / vectorbt / freqtrade, ccxt
  • Backtest results: 2 years of data, X% return, Sharpe Y, max drawdown Z%, N trades

My questions:

  1. How do you avoid overfitting? Do you use walk-forward testing, out-of-sample periods, or something else?
  2. How realistically do you model fees, slippage and funding rates? My results drop a lot once I add them.
  3. What kinds of edges still work in crypto for retail traders (trend, mean reversion, funding/basis, volatility), and which are mostly arbitraged away?
  4. How long do you paper trade or run small size before you trust a strategy?
  5. Any mistakes you wish you'd known about early (lookahead bias, survivorship bias, data quality)?
  6. What to expect 1:1 or 1:2 RR ?

I'm not asking anyone to share their secret sauce. I'm just trying to learn the right process. Thanks!


r/algotradingcrypto • • 5d ago

What stats to display for strategy?

Post image
6 Upvotes

This is the current dashboard. What data should be added to make it easier to understand how it performs?


r/algotradingcrypto • • 4d ago

I built a pump.fun memecoin bot, tested 6 versions on 517 paper trades, and costs ate every edge (code + data open)

0 Upvotes

I spent a week building a paper-trading bot for brand-new Solana memecoins on pump.fun and tried to test it properly: walk-forward splits, one pre-registered test, and error bars on everything.

What I found:

- The best entry rules had a real edge of about +4% to +7% per trade before costs.

- A round trip costs about 6% (1.25% fee each way, plus slippage and tips), so that edge disappears.

- −15% stops actually filled around −24% on fast coins.

- A market filter that looked great on old data made things worse on new data.

- 5 of 6 versions lost money. The newest one is slightly positive after 34 trades, which is far too few to mean anything.

All 517 paper trades and the code are here: https://github.com/seanrisman-commits/swaggy-bot

I'd love feedback. Is there a way around the cost problem that I'm missing, or a flaw in how I tested it?


r/algotradingcrypto • • 5d ago

I wonder why you want to automate trading so much

1 Upvotes

I love my manual entries and exits.

All you want is just profit meh


r/algotradingcrypto • • 5d ago

A volume–return correlation feature looked predictive (t −4.7) until I controlled for the return it's built from (crypto, pre-registered)

Thumbnail bitdataview.com
1 Upvotes

- Feature:the 14-day exponentially weighted correlation between daily log return and daily log volume. It's one of the 19 features (out of 409) that a sparse jump model kept for describing crypto regimes (Cortese, Kolm & Lindström 2023, *Digital Finance*).

- Question:does it tell you anything about tomorrow's return relative to the market, beyond the coin's own recent return?

- Answer: no. +0.006 points per cross-sectional sd (t 0.3) on 200 coins, 2023–26. −0.006 (t −0.2) on 313 coins, 2019–21.

- On its own it looks like a strong reversal signal(−0.080, t −4.7). That's the return itself: across coins the feature correlates 0.5 with the coin's recent return.

Setup

- Data: Binance spot, daily. Main set: 200 coins outside my development set, Sep 2023 – Sep 2026 (4h bars aggregated to UTC days). Replication: 313 coins, 2017–2021. The daily regression needs 30 coins, which this set reaches in May 2019. I hadn't looked at that period with this question.

- Feature ρ:EW correlation of daily log return and daily log volume, half-life 14 days.

- Control m: EW mean daily log return, with the *same* weights. Same window and same weighting for both on purpose. An earlier test of mine produced a fake "volume carries extra information" result because I had normalized volume and bar size in different ways.

- Statistic: each day, a cross-sectional regression of next-day market-relative log return on z(ρ) and z(m). I report the average z(ρ) slope, in points (100 × log return) per 1 sd.

- Two gates, both required:

  1. The 30-day block bootstrap 95% CI excludes zero.
  2. The slope is outside the 95% band of a calendar-shift placebo, where the feature panels are shifted by the same offset for all coins.

- Why the second gate: the placebo wasn't centered at zero (−0.013). Some coins have persistently high ρ *and* persistently lag the market, so coin identity alone produces a slope.

- Power, checked before the lock: the smallest effect detectable 80% of the time was about 0.037 points per sd.

- Lock: the definitions and both predictions (mine and my co-researcher's) were committed before any real feature–return alignment was computed.

Results

| slope (points per 1 sd, next day, vs market) | 2023–26 | 2019–21 |

| main (controls for m, half-life 14) |+0.006** [−0.034, +0.047], t 0.3 | −0.006 [−0.068, +0.056], t −0.2|

| no control (ρ alone) | −0.080, t −4.7 | −0.071, t −2.1 |

| within-coin ρ (minus own trailing 90-day mean) | +0.046, t 2.1 | +0.027, t 1.1 |

| returns trimmed at 1%/99% | −0.024, t −1.3 | −0.032, t −1.1 |

| half-life 7 | +0.015, t 0.8 | +0.026, t 0.8 |

| 7-day horizon | +0.013, t 0.1 | −0.075, t −0.3 |

- Neither gate passed in either period.

- **Five time slices:** mixed signs (+0.06, −0.00, −0.01, −0.03, +0.01).

- **Size terciles:** nothing consistent across the two periods.

The trap

Without the control, ρ "predicts" a reversal. Coins whose up-days came with high volume lag the market the next day: t −4.7 in 2023–26, t −2.1 in 2019–21.

That's a real association, and it replicates. But it's short-term cross-sectional reversal in disguise. Coins that went up tend to give some back, and coins that went up tend to have positive ρ. Put m in the regression and the slope goes to zero.

Testing ρ alone would have handed me a replicated "high-volume rallies reverse" finding. It would have been entirely the return.

One loose end

The within-coin version has a small positive slope: +0.046 (t 2.1), and +0.027 (t 1.1) in the replication. It's one of ten extra reports. They were listed before the run, but none of them were locked as hypotheses, so I'm not counting it. If I follow it up, it gets its own lock on a different universe.

What this says about the paper

Nothing against it. Cortese et al. used the feature to *describe* regimes, not to predict returns, and this test doesn't touch that use.

For next-day returns, though, the feature repeats what the return already tells you. It also doesn't help my own regime work. My online jump-model attempt turned regimes late, mostly because its features were slow. A 14-day feature built largely from returns is just as slow.


r/algotradingcrypto • • 5d ago

Axiom Chronos Vector: A fully offline, on-device vectorized backtester for Android.

Thumbnail
gallery
1 Upvotes

I built Axiom Chronos Vector to address the two biggest problems I found with backtesting strategies:

Problem #1: Privacy & Mobility. My strategies and parameters shouldn't have to leave my hands to a 3rd party provider, nor should I be tied to a desktop just to run a simulation.

Problem #2: Dependencies. Most tools require a cloud subscription or a heavy Python desktop ecosystem.

What it is:
Chronos is a self-contained mobile research environment. It performs the complete workflow from market-data ingestion, through execution simulation, to quantitative analysis entirely on the Android device.

The execution engine is designed to run natively in Kotlin. By applying signal generation and risk-rule logic across price arrays, it is fast and lightweight enough to run complex simulations locally on your phone, without needing to send it to a server.

A note on honesty:
I built this app to be brutally honest about data. If the market data you download has missing candles or gaps, the built-in Integrity Engine will flag it. If your strategy only has 10 trades, it will rate the validity as "Low". It does not try to make a backtest look good; it tells you the truth.

Fully documented details, including the architecture and the strict execution assumptions, are available on my public github repo.

The app is available for download on playstore:

Feedback and suggestions are always welcome.


r/algotradingcrypto • • 6d ago

How our derivatives model did in LUNA, FTX and the Oct 2025 liquidation cascade (backtest, with the bad crises too)

Post image
2 Upvotes

I run a small systematic options and derivatives desk on crypto (one person plus a set of AI agents that do the research grunt work; no AI sends orders). A question I kept asking myself: does the model actually hold up in panics, or does it just look good in calm markets?

So I took the daily backtest and cut it around the well-known crypto crises. Chart attached, each window rebased to 100.

WindowBitcoinModelModel’s worst dip inside the window
Terra/LUNA, May 2022−17.3%+14.8%−2.2%
Celsius/3AC, Jun 2022−35.4%−5.5%−11.4%
FTX, Nov 2022−16.2%+51.1%−1.8%
Yen carry unwind, Aug 2024−5.9%−9.3%−19.3%
Record liquidation cascade, Oct 2025−10.5%+3.6%−13.8%

The chart shows the three good ones; the table has the two bad ones too. Yen 2024 is the uncomfortable one: Bitcoin barely moved over the window but the model still lost more.

How the numbers are built, since that’s what matters here:

  • Daily backtest with today’s rules, after modelled fees and spreads (median costs; we also run a p75 “prudent” cost case).
  • Discounted: every new equity high only counts 47.5%, falls are shown in full. Raw FTX is about +100%; I’d rather show +51%.
  • Rules are pre-registered, the most recent 18 months are kept sealed for one final look, and every test we run is logged, so the multiple-testing count is honest.
  • The windows were picked after the fact, around famous events. Other dates would give other numbers.
  • Worst fall of the whole backtest: −34% (Bitcoin over the same years: −67%).

Why panics tend to help rather than hurt, in broad strokes: in a crash people overpay for protection, and leveraged traders get liquidated into whoever is there to buy. A book that sells some of that protection and buys some of that forced selling, with hard size and margin caps, gets paid for being calm. About half of the FTX month came on a single day of forced selling, which is also why I don’t trust it as a typical number.

Where it hurt: 3AC and the yen unwind. I don’t have a clean one-line story for those two yet, and I’d rather say that than invent one.

Curious how others here stress-test crypto strategies: do you cut around named crises like this, or use something less hand-picked (rolling worst-N windows, regime buckets)?

Backtest, not live results, not advice. Happy to answer questions on the method; I’ll keep the exact rules to myself.


r/algotradingcrypto • • 7d ago

Does anyone here run MEV bots? How’s the competition and profitability?

6 Upvotes

I’ve been hearing a lot about MEV bots lately and how they capture arbitrage, liquidation, and other profits across DeFi.

Does anyone here actually run them? I’m curious about how tough the competition is right now and roughly how much you can realistically earn. I’m thinking about trying to build or run one myself as a beginner, so any advice or insights would be appreciated!


r/algotradingcrypto • • 7d ago

Built a stateless MCP server so Claude/Cursor stop hallucinating L2 slippage, Kelly sizing, and collinear indicators (Hyperliquid + OKX failover)

1 Upvotes

When asking LLMs to size a futures trade or evaluate a strategy, they usually invent slippage ("~1-2 bps"), ignore funding/fee drag in Kelly sizing, or combine redundant indicators like `sma_20` + `bb_middle` without noticing `VIF -> infinity`.

I built **QuantPreflight MCP** (`quant-preflight-mcp`), a stateless Streamable HTTP MCP server (`/mcp`) with 4 deterministic tools:

- `preflight_execution_risk`: Walks live Hyperliquid/OKX L2 orderbooks for real VWAP slippage, 14-ATR stops, and friction-adjusted Half-Kelly sizing.

- `scan_venue_microstructure`: Compares annualized funding APR%, OI, spread, and $10k/$100k L2 impact.

- `audit_indicator_collinearity`: Ridge-regularized VIF, condition number, and 2-pass Modified Gram-Schmidt orthogonal weights.

- `simulate_backtest_reality`: 5,000-path seeded Mulberry32 Monte Carlo ruin + Markov losing-streak check with live L2 friction injection.

Strict non-advisory (`advisory: false`, no buy/sell signals), zero-PII, and fail-closed on errors. Available on Apify Store (`$0.008-$0.025`/call, well within the $5 free monthly credit). Feedback welcome!

Link: https://apify.com/quant-preflighter/quant-preflight-mcp


r/algotradingcrypto • • 7d ago

How do you handle "toxic regime" drawdowns on multi-strategy crypto perp bots? (Post-mortem on Nov 22–24 chop)

1 Upvotes

Hey everyone,

Looking to compare notes with folks running systematic / multi-strategy portfolios on crypto perpetuals (5m–15m execution with 1h–4h HTF filters).

Over the last few days (Nov 22–24), the market felt unusually choppy and erratic across mid-cap alts. I did a forensic review on our last batch of ~20 live trades to see where the leakage occurred, and while our hard time-stops and risk sizing did their job (kept net drawdown essentially flat / breakeven), the under-the-hood stats revealed a familiar issue:

1.Regime Vulnerability: Mean-reversion setups (VWAP 2.0σ deviation scalps) that normally crush it in ranging/low-vol markets got chewed up whenever the market shifted into high-volatility weak trends (WEAK_TREND_HIGH_VOL). Price would blow through the outer band, trigger an entry, and instead of snapping back to VWAP, it would just grind along the band and bleed out or hit our hard time-stop.

2.Cross-Asset Spillover: Our core proven coins (OP, SUI, NEAR, UNI) were nicely green, but adding newer or less-tested pairs (LINK, DOT, SEI) in the same regime caused 90%+ of the batch's losses.

3.Post-Time-Stop Churn: We also caught a subtle bug where a position timed out on a chronological hard-stop after 2 hours of chop, and the scanner immediately re-entered the exact same coin/direction 80 seconds later because the setup conditions were still technically valid. (We patched a mandatory post-exit cooldown to fix this).

For those running live automated portfolios:

1.How do you dynamically gate or throttle mean-reversion strategies during high-vol trending or grinding regimes? Do you use an explicit ATR/ADX threshold, rolling realized volatility switch, or an outright strategy-level regime filter?

2.What does your forward incubation process look like before taking a pair live? How many forward out-of-sample paper trades do you require per symbol before promoting from paper/shadow to real margin?

3.Do you enforce a portfolio-wide correlation / daily loss circuit breaker? If 2–3 alts stop out within a 2-hour window due to a BTC/ETH fakeout, do you freeze all new entries across the entire book for a cool-off period?

Curious how you guys architect around these choppy transition periods without turning off alpha during legitimate ranging markets. Thanks in advance!


r/algotradingcrypto • • 8d ago

November month so far with our fully automated system

Post image
168 Upvotes