PROTECTED SOURCE SCRIPT
12/21 EMA STRAT - [RZ]

12/21 EMA Strategy with Performance Analytics
👁️ - OVERVIEW
This indicator implements a simple yet effective exponential moving average (EMA) crossover strategy that compares a 12-period EMA against a 21-period EMA. The system generates long signals when the 12 EMA is positioned above the 21 EMA, and moves to cash when the 12 EMA falls below the 21 EMA.
🧠 - STRATEGY LOGIC
Signal Generation:
Technical Implementation:
⚙️ - FEATURES
The indicator includes a comprehensive table displaying real-time performance metrics comparing the strategy against a buy-and-hold approach:
Visual Components
Alert System
📝 - How to Use
📊 - Multi-Timeframe Compatibility
This indicator works across multiple timeframes, however, performance characteristics vary significantly depending on the timeframe selected:
ETH

SOL

⚠️ - DISCLAIMER
This indicator is provided for educational and informational purposes only. It is NOT financial advice, investment advice, or a recommendation to buy or sell any security or financial instrument.
👁️ - OVERVIEW
This indicator implements a simple yet effective exponential moving average (EMA) crossover strategy that compares a 12-period EMA against a 21-period EMA. The system generates long signals when the 12 EMA is positioned above the 21 EMA, and moves to cash when the 12 EMA falls below the 21 EMA.
🧠 - STRATEGY LOGIC
Signal Generation:
- Long Position: Activated when 12 EMA > 21 EMA
- Cash Position: Activated when 12 EMA < 21 EMA
Technical Implementation:
- Uses perpetual condition checks instead of crossover/crossunder functions to prevent signal misgeneration and ensure reliability
- Implements barstate.isconfirmed validation to eliminate repainting issues and ensure all signals are confirmed on closed bars
- Provides clean, reliable signals suitable for both backtesting and live trading
⚙️ - FEATURES
The indicator includes a comprehensive table displaying real-time performance metrics comparing the strategy against a buy-and-hold approach:
- Sharpe Ratio: Risk-adjusted return measurement
- Sortino Ratio: Downside risk-adjusted return measurement
- Omega Ratio: Probability-weighted ratio of gains versus losses
- Maximum Drawdown %: Largest peak-to-trough decline
Visual Components
- Equity Curves: Plots both strategy equity and buy-and-hold equity for visual comparison
- Status Table: Real-time display of current position (Long/Cash) and performance metrics
- Clean Chart Interface: Easy-to-read visualization of strategy performance
Alert System
- Long signal triggers
- Cash signal triggers
📝 - How to Use
- Add the indicator to your chart
- Review the performance metrics table to compare strategy vs. buy-and-hold
- Monitor the equity curves to visualize strategy performance
- Set up alerts for long and cash signals if desired
- Use the current position indicator to track strategy status
📊 - Multi-Timeframe Compatibility
This indicator works across multiple timeframes, however, performance characteristics vary significantly depending on the timeframe selected:
- Different timeframes will produce different results
- Strategy performance may be optimal on certain timeframes and underperform on others
- DYOR (Do Your Own Research): Users are strongly encouraged to backtest the strategy on their preferred timeframes and market conditions before use
- Test extensively with historical data to understand the strategy's behavior in your specific use case
ETH
SOL
⚠️ - DISCLAIMER
This indicator is provided for educational and informational purposes only. It is NOT financial advice, investment advice, or a recommendation to buy or sell any security or financial instrument.
- Past performance does not guarantee future results
- Trading involves substantial risk of loss and is not suitable for all investors
- You should carefully consider your financial situation and risk tolerance before making any trading decisions
- Always conduct your own research and consult with a qualified financial advisor before making investment decisions
- The creator of this indicator assumes no responsibility for any financial losses incurred through the use of this tool
- Use this indicator at your own risk
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.