← Live Tool

How I Built the BTC Leverage Gate

Decision logic, the three-tier leverage ladder, asymmetric RSI thresholds — and the slope check most EMA200 tools skip
By Russ, Trade Logic  ·  March 2026  ·  11 min read

What this tool is actually for

The Leverage Gate is not a signal tool. It doesn't tell you whether to buy or sell Bitcoin. What it tells you is whether the current market structure justifies using leverage at all — and if so, how much.

This distinction matters more than it sounds. I've found that most leveraged trading losses don't come from wrong directional calls. They come from sizing: taking a full leveraged position in a market that's churning sideways, where the signal-to-noise ratio is too low to trade profitably at any reasonable stop distance. In those conditions, even a directionally correct trade gets stopped out on noise before it can reach target.

The tool answers a more fundamental question than "which direction": is this a market worth leveraging at all right now? The answer is binary in its most important form — yes or no. The three-tier ladder adds nuance to the yes.

The three-tier leverage ladder — exact conditions for each level

LevelRegime StateConditions Required
1× — NO TRADE Chop / Filter OFF Price is below EMA200 on 4H or 1D (either timeframe failing kills the trade). Structure is misaligned. No leveraged entries in either direction.
2× — DECENT Aligned, not clean Price is above EMA200 on both 4H and 1D (TrendOK). But at least one of: slopes not both rising, or 1H momentum not confirmed via EMA50 + RSI. Structure is there but not fully confirmed.
3× — CLEAN Clean trend + momentum Price above EMA200 on both 4H and 1D and both EMA200 slopes rising and momentum confirmed (1H and 4H above EMA50, 1H RSI ≥ 55). All three layers agree.

The ladder is deliberately conservative. 3× is the ceiling, not an encouragement. Most experienced traders wouldn't go beyond 3× on a spot-equivalent Bitcoin position even in ideal conditions. The tool assumes you're applying these multipliers to a base position size already calculated through a proper risk model — it's not suggesting you put 3× your account into a trade, it's suggesting you can size up to 3× your normal risk unit when all conditions are met.

The TrendOK check — why both timeframes are required

The first gate is TrendOK: is price above the 200-period EMA on both the 4H and the 1D chart simultaneously? If either fails, the tool returns NO TRADE regardless of what anything else shows.

// TrendOK (long side)
trendOK = (c4h > ema200_4h) AND (c1d > ema200_1d)

// Both must be true — one failure = NO TRADE
if c4h > ema200_4h AND c1d < ema200_1d → NO TRADE  // daily failing
if c4h < ema200_4h AND c1d > ema200_1d → NO TRADE  // 4H failing
if c4h > ema200_4h AND c1d > ema200_1d → PROCEED  // both clear

The reason both timeframes are required rather than just the daily is the same one I explained in the Signal Aggregator documentation: the 4H EMA200 breaks first. In every significant BTC correction I've traded through, the 4H lost its position before the daily did. By the time the daily EMA200 is breached, you're often already 10–15% into the move. Requiring 4H alignment too gives earlier warning without the choppiness you'd get from using 4H alone.

The misaligned state — 4H above EMA200 but daily below, or vice versa — is treated identically to both failing. A disagreement between the two timeframes is a chop signal in its own right. When 4H and 1D can't agree on structure, leverage has no business being deployed.

The slope check — the condition most EMA200 tools skip

Passing TrendOK gets you to the 2× Decent tier. Getting to 3× Clean requires two additional conditions, and the first one is the slope check — which most EMA200 regime tools don't include.

Price above EMA200 is a lagging condition. It tells you where price has been, not where it's going. A price that's $1 above a flat or declining EMA200 is technically in the same "above EMA200" state as a price that's $10,000 above a steeply rising EMA200. Those are not the same regime, and treating them as equivalent is a mistake.

// Slope check: compare EMA200 now vs 5 bars ago
slope4hUp = ema200_4h[now] > ema200_4h[now − 5 bars]
slope1dUp = ema200_1d[now] > ema200_1d[now − 5 bars]

// "Clean" requires BOTH slopes rising
clean = slope4hUp AND slope1dUp AND momentumOK

The 5-bar lookback is tunable in the code (slopeLookback = 5). I settled on 5 after testing 3, 5, and 10. Three bars was too reactive — it flipped constantly during normal EMA200 flattening. Ten bars was too slow — it would show a declining slope well into a new uptrend. Five bars gives a meaningful signal that catches genuine slope reversals without crying wolf on temporary flattening.

The practical implication: You can have a strong-looking chart — price well above EMA200 on both timeframes — but still only qualify for 2× rather than 3× if the EMA200 lines are flattening. A flattening EMA200 after a sustained rally is often an early warning of distribution. The slope check enforces discipline at exactly that moment when overconfidence is highest.

The momentum gate — EMA50 + RSI together

The second condition for reaching 3× Clean is momentum confirmation. This requires three sub-checks to all pass simultaneously:

// Momentum (long side) — all three required
c1h > ema50_1h    // 1H price above 50-period EMA
AND c4h > ema50_4h  // 4H price above 50-period EMA
AND rsi1h ≥ 55     // 1H RSI(14) above 55 midline

The EMA50 checks operate on a different level than the EMA200 trend filter. EMA200 answers the macro question — is the long-term structure intact? EMA50 answers the medium-term question — is the current push actively above its own recent average? A price above EMA200 but below EMA50 means the long-term structure is fine but near-term momentum has stalled. That's a 2× condition, not 3×.

The RSI threshold of 55 rather than the standard 50 midline is deliberate. RSI above 50 is barely bullish — at exactly 50 the indicator has no conviction. I want momentum confirmation, not just non-negativity. RSI above 55 means recent gains are meaningfully outpacing recent losses. If you find the tool spending too much time at 2× during genuine uptrends, you can lower this to 52 in the settings. If you want it stricter, raise it to 58 or 60.

Why longs and shorts use different RSI thresholds

This is the design decision I'm most confident in and the one that took the longest to get right. The short-side momentum check is intentionally asymmetric:

📈 Long Momentum Gate

rsi1h ≥ 55

Requires RSI above 55. No upper cap. Longs are permitted at any RSI level above the threshold — including RSI 80+ in strong uptrends.

📉 Short Momentum Gate

25 ≤ rsi1h ≤ 45

Requires RSI in the 25–45 band. Both a ceiling AND a floor. Shorts are blocked below RSI 25 even in confirmed downtrends.

The RSI floor on shorts — refusing to confirm short momentum when RSI is below 25 — is the rule that most people question first. If RSI is 20 and price is in a confirmed downtrend below EMA200 on both timeframes, why would you block shorts? That sounds like a perfect short setup.

The answer is capitulation. When RSI drops below 25, the market has usually already experienced a significant panic flush. Weak hands have sold. Forced liquidations have run. The participants still holding are typically more committed, and the participants on the sidelines include a growing pool of buyers waiting for exactly this kind of extreme reading. Shorting into an RSI-20 environment in a confirmed downtrend means shorting into potential buyer exhaustion — you're entering when the highest-risk part of the down move is most likely behind you, not ahead.

The ceiling on shorts (RSI ≤ 45) enforces the same logic from the other direction. If RSI is above 45 in a confirmed downtrend, price may be in a bear market relief rally — exactly the most dangerous environment for new short entries. The tool waits for momentum to actually roll over before confirming short conditions.

The rule I learned the hard way: I've been stopped out of short trades during capitulation spikes more times than I've been stopped out of long trades during relief rallies. The downside moves faster. The wick against your short during a panic flush is bigger than the wick against your long during a melt-up. The RSI floor exists because the cost of being wrong on the short side during capitulation is disproportionately high.

The regime duration tracker — why it's there

At the top of the dashboard there's a line that says something like "Regime unchanged for: 3d 14h 22m." This persists across sessions using your browser's localStorage. It sounds like a minor feature. It's actually one of the most practically useful things on the page.

A regime that has been in place for 4 days carries different weight than a regime that flipped 20 minutes ago. When the tool shows CLEAN TREND and the timer says 5 days, that's a well-established trend you're trading with. When it says CLEAN TREND and the timer says 2 hours, you're looking at a fresh breakout — potentially valid, but with much less confirmation behind it.

The timer resets whenever the regime changes — a flip from DECENT to CLEAN, from CLEAN back to CHOP, or from long to short triggers a new timestamp. It doesn't reset on page reload or refresh. This matters because the tool auto-refreshes every 60 seconds, and without the localStorage persistence, every refresh would show "just now" even in a regime that's been stable for a week.

I use the timer as a confidence modifier on top of the leverage recommendation. A 3× CLEAN signal after 6 hours in that regime gets full 3× sizing from me. A 3× CLEAN signal after 30 minutes gets treated more like 2× until the regime duration adds weight to the reading.

Data source and why it routes through a proxy

The Leverage Gate fetches two separate data windows from CoinGecko via a Netlify serverless function:

The Netlify proxy exists because CoinGecko rate-limits direct browser requests aggressively. During peak hours the tool was hitting rate limits and silently returning stale data. Routing through a serverless function gives the requests a consistent server-side IP with better rate limit headroom, and allows the function to cache responses with a 30-second TTL — so if two users refresh at the same time, CoinGecko only sees one request.

One technical detail worth knowing: the 1H and 4H data is resampled from the intraday price stream, not fetched directly as OHLCV candles. CoinGecko's free tier doesn't provide true OHLCV at sub-daily intervals. The resampling uses the last price in each time bucket as the close. This means the EMA calculations are close-only, which matches Pine Script's default EMA behaviour but won't exactly match a platform using OHLCV high/low in its calculations.

What this tool will not do

It won't tell you where to enter. TRADE ALLOWED at 3× means conditions are clean. It doesn't mean enter at market right now. You still need a setup — a level, a candle, a trigger on a lower timeframe. The Leverage Gate answers "should I be leveraged?" not "where do I click buy?"

It applies only to Bitcoin. The EMA200 thresholds, RSI levels, and slope lookbacks are calibrated for BTC's typical volatility and trend characteristics. Applying this logic directly to altcoins without recalibrating the thresholds is likely to give you poorer results — altcoins are more volatile, trend less cleanly, and have more erratic RSI behaviour.

It has no memory of recent whipsaws. If the regime has flipped three times in the past 48 hours — DECENT to CLEAN to CHOP and back — the tool doesn't know that. It reads current conditions only. The regime duration timer helps here, but it's not a volatility regime detector. During genuinely unstable periods, multiple flips in the timer history are a signal to stay at 1× regardless of what the current reading shows.

It doesn't replace position sizing. The leverage recommendation tells you the multiplier ceiling. Your actual position size still needs to be calculated based on your account size, your stop distance, and your risk per trade. The Trading Calculator handles that step — the Leverage Gate feeds into it, not replaces it.

How to use it in a pre-trade routine

The Leverage Gate is the first check in my pre-trade process, not the last. Here's the sequence:

  1. Check the filter result and regime state. If it shows NO TRADE / CHOP, I stop. No further analysis. No looking for exceptions. The filter being off means the structural conditions for leverage aren't present.
  2. Note the leverage ceiling. 2× DECENT means my maximum multiplier is 2×. I won't talk myself into 3× because the setup looks particularly clean — if the tool says 2×, the market conditions don't warrant more.
  3. Check the regime duration. If the current regime is less than a few hours old, I treat the leverage ceiling as one tier lower until it stabilises. A fresh 3× CLEAN gets treated as 2× for the first trading session.
  4. Cross-reference with the Signal Aggregator score. If the Leverage Gate says TRADE ALLOWED but the Signal Aggregator score is below 5.0, there's a conflict between the regime filter and the broader indicator picture. I don't override the Signal Aggregator — I investigate the disagreement.
  5. Then go find the setup. The Leverage Gate has answered the risk question. Now TradingView answers the entry question.

The honest use case for this tool: it's most valuable not when it says yes but when it says no. The CLEAN TREND 3× reading is easy — you were probably already willing to trade. The NO TRADE reading when you have a setup you want to take is where the tool earns its place. Having an explicit external filter that says "not today" is harder to argue with than your own judgment when you're already looking at a chart you want to trade.

Use the Live Tool

The BTC Leverage Gate is free, updates every 60 seconds, and works for both long and short bias modes.

Open Leverage Gate →

Related Tools & Reading