EMA Slope - RSI Oscillator Strategy by xvelox_
By xvelox_
Performance Metrics
- Author: xvelox_
- Symbol: BINANCE:BTCUSDT
- Timeframe: 15 minutes
- Net P&L: +3,976.70 USDT (+39.91%)
- Win Rate: 58.7%
- Profit Factor: 1.747
- Max Drawdown: 999.99 USDT (7.48%)
- Total Trades: 126
Description
**EMA Slope Strategy** combines normalized EMA slope momentum with centered RSI to build a multi-entry system for both continuation and reversal setups. It uses a global No Trade Zone (NTZ) to block weak signals, optional divergence modules, RSI-Slope oscillator entries, and entry-type-specific trailing management.**Core Concept - Arctan Slope Normalization:** The strategy measures the change in a long moving average and normalizes it with an arctan model to a centered range that asymptotically approaches +/-50. This keeps slope and centered RSI on comparable scales without hard clipping, making momentum relationships more realistic across different volatility regimes.**Global NTZ Filter:** The NTZ acts as a full entry blocker when enabled. No new entries are allowed while normalized slope is inside the zone, including reversals. This keeps the strategy focused on stronger momentum conditions while still allowing exits inside the NTZ.**Entry Engine:** The script supports NTZ Cross, Acceleration, RSI Divergence, Slope-RSI Divergence, and RSI-Slope Oscillator entries. The oscillator now checks NTZ only on the initial cross, then waits for RSI and slope to keep moving in the same direction within a timeout window.**Trade Management Enhancements:** Same-direction stacking is blocked, but opposite-direction entries can still reverse positions cleanly. Old trailing-stop state is cleared on reversal so only the new side remains active. Standard entries can optionally exit on NTZ re-entry, while divergence and oscillator entries use their own ATR-based trailing logic and grace periods.Default values were tested in BTCUSDT 15min market.### π― Key Featuresβ **Global No Trade Zone (NTZ)** - Blocks all new entries while slope is inside the neutral zone β **Momentum-Based Entries** - Requires minimum delta to filter weak signals β **Stretch Filter** - Prevents entries when MAs are overextended β **Trend Confirmation** - Optional filter ensures trades align with trend β **Acceleration Entry** - Alternative entry on sudden slope acceleration β **RSI Divergence Entries** - Detect reversals with multi-peak divergence analysis β **Slope-RSI Exhaustion** - Visual warnings and optional filter using normalized momentum comparison β **RSI-Slope Oscillator Entries** - Arms on a valid cross outside NTZ, then confirms with same-direction RSI and slope movement β **Side-Aware Reversals** - Blocks same-direction add-ons while still allowing opposite-side reversals β **RSI-Slope Cross Exit** - Optional close/reverse for any position when RSI and slope cross with same-direction momentum β **Exit Confirmation** - Requires consecutive bars to filter false exit signals β **Entry-Type Trailing Stops** - Separate ATR trails and grace periods for standard, divergence, and oscillator trades β **Immediate Trail Reset On Flip** - Disables the old side's stop state as soon as a reversal is triggered β **Individual Entry Type Controls** - Enable/disable each entry method independently β **Dynamic RSI Coloring** - Visual RSI coloring based on overbought/oversold levels β **Flexible Position Sizing** - Percent of Equity, Fixed Quantity, or Percent of Cash β **Built-in Alerts** - Entry/exit alerts with trade details### π Technical Calculations**Slope Normalization Formula:** `maDF = longMA - longMA[smoothBars]`, then `normalizedSlope = (100 / pi) * atan(maDF / stdev(maDF, lookback))`. This produces a centered oscillator that asymptotically approaches +/-50 and stays comparable with centered RSI.**Acceleration Detection:** Calculates the absolute change in slope between bars, multiplied by smoothing factor and scaled to 0-50 range. Values above threshold (default 38) indicate sudden momentum shifts, visualized as colored dots.**RSI Divergence:** Uses pivot high/low detection on smoothed RSI with configurable sensitivity (lookback = 16 - sensitivity). Compares price pivots against RSI pivots to identify divergences: bullish when price makes lower lows while RSI makes higher lows, bearish when price makes higher highs while RSI makes lower highs.**Slope-RSI Exhaustion:** Compares normalized EMA slope momentum against centered RSI (RSI - 50) on the same scale. When slope is accelerating in one direction but RSI is moving opposite over multiple lookback periods, it indicates trend exhaustion. The gap between slope and RSI must exceed threshold (default 10.0 points) to filter noise.**RSI-Slope Oscillator:** Detects when centered RSI crosses normalized slope outside the NTZ, then waits for both RSI and slope to continue moving in the same direction within a timeout window. This allows reversal-style entries without requiring the slope to stay outside the NTZ after the cross.**Trailing Stop (Blackflag FTS Swingarm):** Uses Wilder's moving average of true range (modified or standard) multiplied by ATR factor. Separate trailing stops for different entry types: Standard entries (NTZ Cross, Acceleration) use standard ATR factor with grace period (default 3 bars). Divergence entries use wider ATR factor (default 6.0) with grace period (default 5 bars). RSI-Slope Oscillator entries use wider ATR factor (default 6.0) with grace period (default 3 bars). Grace periods prevent immediate exits after entry.**Visual Indicators:** Green/Red = trend direction, Gray = NTZ zone, Colored dots = acceleration, Centered RSI line (RSI-50) with dynamic coloring (Red when overbought >20, Green when oversold long MA) if enabled. This is the primary trend-following method.2. **Acceleration Entry:** Triggers when acceleration value β₯ threshold (default 34) AND slope is already above NTZ AND delta is sufficient. This captures sudden momentum bursts during strong trends, visualized as colored dots on the indicator.3. **RSI Divergence Entry:** Triggers when bullish divergence detected - price makes a lower low while RSI makes a higher low over the sensitivity lookback period. Optional Slope-RSI confirmation can be required. This targets reversal opportunities at potential bottoms.4. **Slope-RSI Divergence Entry:** Triggers when slope is accelerating downward (negative delta, slope below -8) but RSI is rising over lookback periods, with gap between slope and RSI exceeding threshold. This detects bullish exhaustion reversals during downtrends.5. **RSI-Slope Oscillator Entry:** Triggers when centered RSI crosses normalized slope outside the NTZ, then confirms when both RSI and slope keep moving in the same direction within the allowed timeout window. This targets reversal-style entries while the global NTZ filter still blocks final entries inside the zone.**Short Entry Conditions:** Mirror of long conditions with opposite directional requirements.**Exit Logic by Entry Type:**- **NTZ/Acceleration Entries:** Exit when slope re-enters NTZ, if that option is enabled, or when the standard trailing stop triggers after its grace period.- **Divergence Entries (RSI or Slope-RSI):** Exit only via divergence-specific trailing stop which uses wider ATR factor (default 6.0, adjustable 4-8) and grace period (default 5 bars) before activation. This allows reversal trades time to develop without premature exits.- **RSI-Slope Oscillator Entries:** Exit when the opposite oscillator condition triggers or when the oscillator-specific trailing stop is hit after its grace period.- **RSI-Slope Cross Exit (All Entry Types):** Optional exit/reverse condition that applies to ALL positions. When enabled, exits or reverses position when RSI crosses Slope with both indicators moving in the same direction. Bearish: RSI crosses below Slope AND both heading DOWN (exits/reverses longs). Bullish: RSI crosses above Slope AND both heading UP (exits/reverses shorts). Can be set to reverse position or close only.### π How-To Guide**Add to Chart:** Indicators β Search "EMA Slope Strategy" β Select**Parameter Configuration Guide:**- **MA Settings**: Two moving averages required. Short MA (default 40) used for stretch filter calculation. Long MA (default 160) used for slope calculation. Ratios: 20/80 (fast, more signals), 40/160 (standard, balanced), 50/200 (slow, fewer but stronger signals). EMA recommended for responsiveness.- **NTZ Threshold**: Controls minimum momentum required for entries. Lower values (5-6) generate more trades but may include weaker signals. Higher values (10-12) generate fewer but stronger momentum signals. Default 8 balances frequency with quality.- **Stretch Filter**: Percentage difference threshold between MAs (default 0.38%). For longs: blocks when long MA > short MA by threshold amount. For shorts: blocks when long MA 20, Green when cRSI < -20, Neutral when between -20 and 20. Customizable colors and line width.**Alerts:** Right-click chart β Add Alert β Select "EMA Slope Strategy" β Choose condition β Configure notifications**Backtest:** Strategy Tester tab β Select strategy β Set date range & capital β Review results**Panel Interpretation:** Green/Red = trend, Gray = NTZ, Dots = acceleration, Blue = Centered RSI, Purple/Lime = price-RSI divergence, Orange/Yellow = slope-RSI exhaustion**Multi-Timeframe:** Higher timeframe for trend, lower for entries. **Market Adjustments:** Crypto: 20/80 MA, NTZ 6-7 | Forex: 40/160, NTZ 8 | Stocks: 50/200, NTZ 10-12### π‘ Usage Guidelines**Timeframe Recommendations:** Day Trading: 5m-15m charts work well with faster MA settings (20/80). Swing Trading: 1h-4h charts with standard settings (40/160). Position Trading: 4h-Daily charts with slower settings (50/200).**Entry Method Selection:** Use individual entry type controls to enable/disable methods based on market conditions. NTZ Cross and Acceleration work best in trending markets. RSI Divergence and Slope-RSI Divergence work best at potential reversal points. RSI-Slope Oscillator works best for trend reversals when momentum indicators align. You can enable multiple methods simultaneously or use them individually.**Risk Management:** Always validate signals with price action and support/resistance levels. Use position sizing to limit risk to 1-2% of capital per trade. Exit Confirmation bars (default 6) help filter false exits during normal market volatility. Divergence and oscillator entries use wider stops (ATR factor 6.0) with grace periods (3 bars) because reversals need room to develop. Standard entries use tighter stops (ATR factor 4.7) with shorter grace period (2 bars). RSI-Slope Cross Exit provides additional exit mechanism that can reverse positions when momentum shifts.**Market-Specific Adjustments:** Crypto markets: Use faster MAs (20/80), lower NTZ (6-7), higher delta (4-5). Forex: Standard settings (40/160 MA, NTZ 8, Delta 3.2). Stocks: Slower MAs (50/200), higher NTZ (10-12), lower delta (2-3). Always backtest parameter combinations for your specific market and timeframe before live trading.### π Alert SystemThe strategy includes built-in alert conditions for all entry and exit events. Entry alerts include: entry method type (NTZ Cross, Acceleration, RSI Divergence, Slope-RSI Divergence, or RSI-Slope Oscillator), entry price, calculated position size, current normalized slope value, delta value, acceleration value, RSI value, trend confirmation status, Slope-RSI confirmation status (if enabled), and timestamp. Exit alerts include: exit price, original entry price, position size, profit/loss amount and percentage, exit reason (trailing stop, NTZ re-entry, RSI-Slope Cross, or position reverse), current slope and RSI values, confirmation bars count (for NTZ exits), and timestamp. Set up alerts by right-clicking the chart, selecting "Add Alert", choosing the strategy, and selecting which conditions to monitor.### π Use CasesDay Trading (5m-15m), Swing Trading (1h-4h), Position Trading (4h-Daily), Trend Following, Momentum Trading, Reversal Trading, Range Trading### β οΈ Important Disclaimer**THIS IS NOT FINANCIAL ADVICE**This strategy is for educational purposes only. Trading involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results.**Key Points:** No guarantee of profits - you may lose capital. Not professional financial advice - consult a qualified advisor. Trade only with capital you can afford to lose. Backtest results don't guarantee future performance. You are solely responsible for trading decisions and risk management.**By using this strategy, you acknowledge understanding the risks and that you use it at your own risk. Never invest more than you can afford to lose.****Works on all markets**: Crypto, Forex, Stocks, Commodities, Futures## Short Description (for Script Header - 200-300 chars)Multi-entry strategy combining arctan-normalized EMA slope with centered RSI. Includes a global NTZ entry filter, NTZ/acceleration/divergence/oscillator signals, side-aware reversals, optional NTZ re-entry exits, and separate trailing stops with grace periods for each entry type.## Tags (for Publishing)EMA, Moving Average, Slope, Trend Following, Momentum, No Trade Zone, NTZ, Strategy, Trading Strategy, Technical Analysis, Trailing Stop, Position Sizing, Acceleration, Delta, Stretch Filter, Trend Confirmation, RSI, Divergence, Slope-RSI, Exhaustion, RSI-Slope Oscillator, Normalized Comparison, Exit Confirmation, Alerts, Backtesting, Crypto, Forex, Stocks, Futures, Swing Trading, Day Trading, Reversal Trading, Range Trading## Category**Strategies** β **Trend Following**