MSV - Sinal O que o script faz?
Identifica sinais automáticos de compra e venda baseados na confluência de indicadores técnicos.
Utiliza Médias Móveis Exponenciais (EMA 9 e EMA 21) para detectar tendências.
Usa o Índice de Força Relativa (RSI 14) para medir sobrecompra e sobrevenda.
Aplica o MACD (12, 26, 9) para confirmar mudanças de tendência.
Adiciona Bandas de Bollinger para evitar compras e vendas precipitadas.
Exibe setas de compra (🟢) e venda (🔴) no gráfico.
🔹 Como funciona?
🟢 Sinal de Compra:
✅ EMA 9 cruza acima da EMA 21 (início de tendência de alta).
✅ RSI abaixo de 40 (ativo relativamente barato).
✅ MACD cruza acima da linha de sinal (entrada confirmada).
✅ Preço tocando ou abaixo da Banda Inferior de Bollinger (indica possível reversão).
🔴 Sinal de Venda:
✅ EMA 9 cruza abaixo da EMA 21 (início de tendência de baixa).
✅ RSI acima de 60 (ativo pode estar sobrecomprado).
✅ MACD cruza abaixo da linha de sinal (saída confirmada).
✅ Preço tocando ou acima da Banda Superior de Bollinger (indica exaustão da alta).
🔹 Benefícios desse setup
✔️ 100% automático e otimizado para Swing Trade.
✔️ Evita sinais falsos ao exigir confluência entre os indicadores.
✔️ Ótima precisão para operar em criptomoedas e outros ativos.
✔️ Leve e fácil de usar no TradingView.
指標和策略
Relative Volume MetricsSimple table the reports 3 volume metrics.
1. RelVol - reports relative volume using the TradingView relative volume function. Updates bar by bar.
2. %30D Vol - divides today's volume by the 30 day average volume. Updates bar by bar.
3. Bar Threshold - Calculates the average volume to a custom lookback period and turns red when volume reaches a configurable standard deviation threshold for that period
MA 50/200 with FibonacciThis indicator combines two classic tools for market analysis: the 50-period and 200-period Moving Averages (MA) and Fibonacci retracement levels.
The MA 50 (blue line) and MA 200 (red line) give you a quick view of the trend direction—whether the market is in an uptrend or downtrend based on the position of the price relative to these moving averages.
The Fibonacci retracement levels (green, blue, orange, purple, red, yellow, and black lines) are drawn based on the highest and lowest prices in the last 200 bars. These levels show key areas where the price might pull back or find support/resistance, helping you identify potential entry and exit points.
Whether you’re a trend follower or a retracement trader, this indicator offers a powerful combination to help spot trends and reversal zones in the market.
Al-Sat Noktaları (BORSACISELİMALDEMİR)Bu indikatör, fiyatın hareketli ortalamayla kesişim noktalarını temel alarak alım (long) ve satım (short) sinyalleri üretir. İşte nasıl kullanılacağına dair temel bilgiler:
1. Alım ve Satım Sinyalleri:
Alım (Long) Sinyali: Fiyat, hareketli ortalamayı yukarı doğru keserse (crossover), yani kapanış fiyatı hareketli ortalamanın üstüne çıkarsa, bu bir alım sinyali olarak kabul edilir.
Satım (Short) Sinyali: Fiyat, hareketli ortalamayı aşağı doğru keserse (crossunder), yani kapanış fiyatı hareketli ortalamanın altına inerse, bu bir satım sinyali olarak kabul edilir.
2. Grafikte Görüntülenme:
Alım Sinyali: Yeşil "AL" etiketi, fiyatın hareketli ortalamayı yukarı kesmesiyle oluşan alım sinyalini gösterir. Bu etiket, fiyat barlarının alt kısmında gösterilir.
Satım Sinyali: Kırmızı "SAT" etiketi, fiyatın hareketli ortalamayı aşağı kesmesiyle oluşan satım sinyalini gösterir. Bu etiket, fiyat barlarının üst kısmında gösterilir.
Bu etiketler, piyasa koşullarına göre alım ve satım fırsatlarını görsel olarak belirlemenizi sağlar.
Hammer Detector### Hammer Pattern Detector
The Hammer Pattern Detector is a specialized technical analysis tool designed to identify high-probability hammer candlestick patterns. This indicator uses precise mathematical calculations to detect hammer patterns that meet specific criteria, helping traders identify potential market reversals.
#### Key Features
- Precise detection of hammer patterns based on shadow-to-body ratios
- Customizable parameters for fine-tuning pattern recognition
- Visual alerts with markers above qualifying candles
- Built-in alert functionality for real-time notifications
#### Parameters
1. **Shadow Length Multiplier (min)**: Controls how many times longer the lower shadow must be compared to the candle body (default: 2.0)
2. **Maximum Upper Shadow (%)**: Sets the maximum allowed length for the upper shadow as a percentage of total candle length (default: 10%)
3. **Minimum Body to High Distance (%)**: Defines how close the body must be to the high of the candle (default: 90%)
#### Detection Criteria
The indicator identifies hammer patterns based on three main conditions:
- Lower shadow must be at least twice the length of the body (adjustable)
- Upper shadow must be minimal (max 10% of total candle length by default)
- Candle body must be positioned near the high of the candle
#### Use Cases
- Identifying potential trend reversals
- Finding entry points in oversold conditions
- Confirming support levels
- Part of a broader reversal strategy
#### Tips for Best Results
- Use in conjunction with support/resistance levels
- Combine with volume analysis for confirmation
- Consider overall market context and trend
- Adjust parameters based on your trading timeframe
#### Installation
1. Add the indicator to your chart
2. Adjust the parameters according to your trading style
3. Optional: Set up alerts for real-time notifications
#### About
Created by WK
Version: 1.0
All rights reserved ©WK
For questions or suggestions, please reach out through TradingView.
Scalping MACD + RSI + EMAs + Gestión de RiesgoEsta estrategia de scalping está diseñada para ejecutarse en gráficos de corto plazo (como 1 min, 5 min o 15 min) en TradingView. Se basa en la combinación de tres indicadores técnicos clave para detectar oportunidades de compra y venta con alta probabilidad de éxito:
MACD (Moving Average Convergence Divergence): Identifica cambios de tendencia mediante el cruce de la línea MACD y la señal.
RSI (Relative Strength Index): Filtra entradas para evitar comprar en sobrecompra o vender en sobreventa.
Medias Móviles Exponenciales (EMA 50 y EMA 200): Confirma la tendencia general del mercado y evita operar en contra de la dirección predominante.
Además, la estrategia incorpora gestión de riesgo con Stop Loss (SL) y Take Profit (TP), lo que permite minimizar pérdidas y maximizar ganancias de forma automática.
EMA MULTIPLE TIME FRAME HORIZONTAL (BY WAGUNG BEJIR)Deskripsi Skrip: EMA Multiple Timeframes (Last Horizontal Line)
Skrip ini digunakan untuk menampilkan EMA (Exponential Moving Average) 9 pada timeframe harian dengan dua elemen utama:
Garis horizontal yang digambar pada level harga EMA 9 yang dihitung, yang akan diperpanjang ke kanan.
Label yang mengikuti garis EMA 9, memberikan informasi bahwa garis tersebut adalah EMA 9 Daily.
Fitur Utama:
EMA 9 Calculation: Menghitung Exponential Moving Average (EMA) dengan periode 9 untuk harga penutupan pada timeframe harian (Daily).
Horizontal Line: Menampilkan garis horizontal pada level harga EMA 9 yang dihitung, dimulai pada bar terakhir dan diperpanjang ke kanan.
Dynamic Label: Menambahkan label "EMA 9 Daily" yang selalu terhubung dengan garis EMA 9 terakhir, dan label ini hanya muncul pada bar terakhir untuk menunjukkan level EMA tersebut.
Parameter Input:
EMA Parameter: Pengguna dapat mengatur periode EMA (default: 9), yang menentukan panjang rata-rata eksponensial untuk menghitung garis EMA.
Visualisasi:
Garis EMA 9 digambar dengan warna kuning, yang memberikan indikasi level harga EMA pada grafik.
Label yang menunjukkan "EMA 9 Daily" ditempatkan tepat di sebelah kanan garis EMA pada bar terakhir.
Penggunaan:
Skrip ini sangat cocok digunakan oleh trader yang ingin mengikuti level EMA pada timeframe harian dan melihatnya secara dinamis di chart, tanpa gangguan dari garis-garis EMA lainnya. Label yang ditambahkan memberikan penjelasan tambahan untuk memudahkan identifikasi level EMA 9 pada grafik.
High-Probability IndicatorExplanation of the Code
Trend Filter (EMA):
A 50-period Exponential Moving Average (EMA) is used to determine the overall trend.
trendUp is true when the price is above the EMA.
trendDown is true when the price is below the EMA.
Momentum Filter (RSI):
A 14-period RSI is used to identify overbought and oversold conditions.
oversold is true when RSI ≤ 30.
overbought is true when RSI ≥ 70.
Volatility Filter (ATR):
A 14-period Average True Range (ATR) is used to measure volatility.
ATR is multiplied by a user-defined multiplier (default: 2.0) to set a volatility threshold.
Ensures trades are only taken during periods of sufficient volatility.
Entry Conditions:
Long Entry: Price is above the EMA (uptrend), RSI is oversold, and the candle range exceeds the ATR threshold.
Short Entry: Price is below the EMA (downtrend), RSI is overbought, and the candle range exceeds the ATR threshold.
Exit Conditions:
Take Profit: A fixed percentage above/below the entry price.
Stop Loss: A fixed percentage below/above the entry price.
Visualization:
The EMA is plotted on the chart.
Background colors highlight uptrends and downtrends.
Buy and sell signals are displayed as labels on the chart.
Alerts:
Alerts are triggered for buy and sell signals.
How to Use the Indicator
Trend Filter:
Only take trades in the direction of the trend (e.g., long in an uptrend, short in a downtrend).
Momentum Filter:
Look for oversold conditions in an uptrend for long entries.
Look for overbought conditions in a downtrend for short entries.
Volatility Filter:
Ensure the candle range exceeds the ATR threshold to avoid low-volatility trades.
Risk Management:
Use the built-in take profit and stop loss levels to manage risk.
Optimization Tips
Backtesting:
Test the indicator on multiple timeframes and assets to evaluate its performance.
Adjust the input parameters (e.g., EMA length, RSI length, ATR multiplier) to optimize for specific markets.
Combination with Other Strategies:
Add additional filters, such as volume analysis or support/resistance levels, to improve accuracy.
Risk Management:
Use proper position sizing and risk-reward ratios to maximize profitability.
Disclaimer
No indicator can guarantee an 85% win ratio due to the inherent unpredictability of financial markets. This script is provided for educational purposes only. Always conduct thorough backtesting and paper trading before using any strategy in live trading.
Let me know if you need further assistance or enhancements!
Liquidity Heatmap & Volume-Weighted RSILiquidity Heatmap Indicator with Volume-Weighted RSI
Description:
The Liquidity Heatmap Indicator with Volume-Weighted RSI (VW-RSI) is a powerful tool designed for traders to visualize market liquidity zones while integrating a volume-adjusted momentum oscillator. This indicator provides a dynamic heatmap of liquidity levels across various price points and enhances traditional RSI by incorporating volume weight, making it more responsive to market activity.
Key Features:
Liquidity Heatmap Visualization: Identifies high-liquidity price zones, allowing traders to spot potential areas of support, resistance, and accumulation.
Volume-Weighted RSI (VW-RSI): Enhances the RSI by factoring in trading volume, reducing false signals and improving trend confirmation.
Customizable Sensitivity: Users can adjust parameters to fine-tune heatmap intensity and RSI smoothing.
Dynamic Market Insights: Helps identify potential price reversals and trend strength by combining liquidity depth with momentum analysis.
How to Use:
1. Identify Liquidity Zones: The heatmap colors indicate areas of high and low liquidity, helping traders pinpoint key price action areas.
2. Use VW-RSI for Confirmation: When VW-RSI diverges from price near a liquidity cluster, it signals a potential reversal or continuation.
3. Adjust Parameters: Fine-tune the RSI period, volume weighting, and heatmap sensitivity to align with different trading strategies.
This indicator is ideal for traders who rely on order flow analysis, volume-based momentum strategies, and liquidity-driven trading techniques.
PDC & EMATitle: Dynamic Price & EMA Table with Previous Day Close
Description: This script provides a dynamic table that displays key information about the current price relative to the previous day's close and the 8-period EMA. It helps traders quickly identify potential trading signals based on these conditions. The table adapts for both web and mobile views, ensuring a seamless experience across devices.
Features:
Previous Day Close (PDC): Indicates if the current price is above ("Y") or below ("N") the previous day's close.
8-Period EMA (8EMA): Shows if the current price is above ("Y") or below ("N") the 8-period EMA.
Action Signal: Displays "Calls" if both conditions are met, "Puts" if neither condition is met, and "Hold" if the conditions are mixed.
Customizable Colors: Allows users to set their preferred colors for up, down, and hold signals.
Responsive Design: Adjusts the table layout for optimal viewing on both web and mobile devices.
This script is ideal for traders looking for a quick visual reference to make informed trading decisions based on price and EMA conditions.
EUR/USD vs USD/CHF SpreadA typical Pine Script for spread trading would include:
Fetching Data: Getting the real-time price of EUR/USD and USD/CHF.
Calculating the Synthetic EUR/CHF Price: Since EUR/USD * USD/CHF ≈ EUR/CHF, we use this relation to analyze deviations.
Computing the Spread: Taking the difference between EUR/USD and the synthetic EUR/CHF price.
Z-Score Normalization: Measuring how far the spread deviates from the mean (Mean Reversion).
Overlay and Visuals: Plotting the spread and key levels to visualize trading signals.
Engulfing Volume IndicatorThe Bullish Engulfing Candlestick Pattern is the primary technical pattern to be analyzed for the buy setup. This particular pattern consists of two candlesticks and serves as a key reversal indicator, signalling a potential shift in market sentiment from bearish to bullish. It occurs following a downtrend and is characterized by a small bearish candle (typically black or red) that is succeeded by a more significant bullish candle (white or green) on the next trading day. The bullish candle must completely cover or "engulf" the body of the prior bearish candle.
EMA Crossover + Candle Pattern AlertI would like to build a trading bot alert in PineScript that performs the following:
9-15 EMA Crossover:
When the 9-period EMA crosses above the 15-period EMA, it's a bullish signal.
When the 9-period EMA crosses below the 15-period EMA, it's a bearish signal.
Candle Pattern Confirmation:
After a bullish crossover, check for any of the following bullish candle patterns in the next 3 or 5 minutes:
Hammer
Bullish Engulfing
Morning Star
Bullish Piercing Pattern
If any of these patterns are detected, trigger an alert
ATR % & 10 / ATR %Shows current ATR as a percentage of current price and also shows 10 divided by current ATR% for leverage purposes.
SimpleTrendlinesLibrary "SimpleTrendlines"
An accessible and semi-effortless way to draw trendlines with automatic slope and angle calculation.
new(x_axis, offset, strictMode, strictType)
Creates an instance of the trendline library, accepting parameters that allow the library to function accordingly.
Parameters:
x_axis (int) : The x-axis distance between point A and point B.
offset (int) : The offset from x2 and the current bar_index. Used in situations where conditions execute ahead of where the x2 location is, such as pivot events.
strictMode (bool) : Strict mode works in the backend of things to ensure that price hasn't closed below the trendline before the trendline is drawn.
strictType (int) : 0 ensures that price during slope calculation is above line, 1 ensures that price during slope calculation is below line.
method drawLine(this, condition, y1, y2, src)
Draws a new line from the given y-value parameters based on a condition.
Namespace types: Trendline
Parameters:
this (Trendline)
condition (bool) : The condition in order to draw a new line.
y1 (float) : The y-value of point A.
y2 (float) : the y-value of point B.
src (float) : Determines which value strict mode will actively check for leakage before a trendline is drawn.
method drawTrendline(this, condition)
Draws a trendline from the line generated from the drawLine() method.
Namespace types: Trendline
Parameters:
this (Trendline)
condition (bool) : The conditon to maintain the trendline.
TrendlineSettings
The object containing the essential values for proper library execution.
Fields:
x_axis (series int) : The x-axis provided by the user to determine the distance between point A and point B
offset (series int) : The offset from x2 and the current bar_index. Used in situations where conditions execute ahead of where the x2 location is, such as pivot events.
strictMode (series bool) : Strict mode works in the backend to ensure that price hasn't closed below or above the trendline before the trendline is drawn.
strictType (series int) : 0 if price is above line, 1 if price is below line.
TrendlineData
The object containing values that the user can use for further calculation.
Fields:
slope (series float) : The slope of the initial line.
x1 (series int) : The bar_index value of point A.
x2 (series int) : The bar_index value of point B.
y1 (series float)
y2 (series float)
changeInX (series int) : How many bars since the bar_index value of point B.
TrendlineLines
The object containing both the start line and trend line for manipulation.
Fields:
startline (series line) : The initial line that gets drawn when instantiating the drawLine() method.
trendline (series line) : The trendline that gets drawn when instantiating the drawTrendline() method.
Trendline
The object that serves as the class of the library. Inherits all properties and methods.
Fields:
info (TrendlineSettings) : Contains properties inside the TrendlineSettings object.
values (TrendlineData) : Contains properties inside the TrendlineData object.
lines (TrendlineLines) : Contains properties inside the TrendlineLines object.
First 9:15-9:20 Candle Levels (Daily)This indicator captures the closing price of the first 5-minute candle (9:15 - 9:20 AM) every trading day. It then calculates 0.09% above and below this closing price and plots horizontal lines. The indicator resets daily at 9:15 AM, ensuring it always tracks the latest market open. After 9:20 AM, the calculated levels remain visible throughout the day. The upper level is displayed in green, while the lower level is in red. This tool helps traders identify key price levels early in the session, useful for setting stop-losses, take-profit zones, or identifying potential breakout points.
KalmanfilterLibrary "Kalmanfilter"
A sophisticated Kalman Filter implementation for financial time series analysis
@author Rocky-Studio
@version 1.0
initialize(initial_value, process_noise, measurement_noise)
Initializes Kalman Filter parameters
Parameters:
initial_value (float) : (float) The initial state estimate
process_noise (float) : (float) The process noise coefficient (Q)
measurement_noise (float) : (float) The measurement noise coefficient (R)
Returns: A tuple containing
update(prev_state, prev_covariance, measurement, process_noise, measurement_noise)
Update Kalman Filter state
Parameters:
prev_state (float)
prev_covariance (float)
measurement (float)
process_noise (float)
measurement_noise (float)
calculate_measurement_noise(price_series, length)
Adaptive measurement noise calculation
Parameters:
price_series (array)
length (int)
calculate_measurement_noise_simple(price_series)
Parameters:
price_series (array)
update_trading(prev_state, prev_velocity, prev_covariance, measurement, volatility_window)
Enhanced trading update with velocity
Parameters:
prev_state (float)
prev_velocity (float)
prev_covariance (float)
measurement (float)
volatility_window (int)
model4_update(prev_mean, prev_speed, prev_covariance, price, process_noise, measurement_noise)
Kalman Filter Model 4 implementation (Benhamou 2018)
Parameters:
prev_mean (float)
prev_speed (float)
prev_covariance (array)
price (float)
process_noise (array)
measurement_noise (float)
model4_initialize(initial_price)
Initialize Model 4 parameters
Parameters:
initial_price (float)
model4_default_process_noise()
Create default process noise matrix for Model 4
model4_calculate_measurement_noise(price_series, length)
Adaptive measurement noise calculation for Model 4
Parameters:
price_series (array)
length (int)
Daily MA Ribbon + MACD Crossover with Buy/Sell Signals - MaheshAll integrated strategy with MACD and MA for intraday trading
Global M2 Index Percentage### **Global M2 Index Percentage**
**Description:**
The **Global M2 Index Percentage** is a custom indicator designed to track and visualize the global money supply (M2) in a normalized percentage format. It aggregates M2 data from major economies (e.g., the US, EU, China, Japan, and the UK) and adjusts for exchange rates to provide a comprehensive view of global liquidity. This indicator helps traders and investors understand the broader macroeconomic environment, identify trends in money supply, and make informed decisions based on global liquidity conditions.
---
### **How It Works:**
1. **Data Aggregation**:
- The indicator collects M2 data from key economies and adjusts it using exchange rates to calculate a global M2 value.
- The formula for global M2 is:
\
2. **Normalization**:
- The global M2 value is normalized into a percentage (0% to 100%) based on its range over a user-defined period (default: 13 weeks).
- The formula for normalization is:
\
3. **Visualization**:
- The indicator plots the M2 Index as a line chart.
- Key reference levels are highlighted:
- **10% (Red Line)**: Oversold level (low liquidity).
- **50% (Black Line)**: Neutral level.
- **80% (Green Line)**: Overbought level (high liquidity).
---
### **How to Use the Indicator:**
#### **1. Understanding the M2 Index:**
- **Below 10%**: Indicates extremely low liquidity, which may signal economic contraction or tight monetary policy.
- **Above 80%**: Indicates high liquidity, which may signal loose monetary policy or potential inflationary pressures.
- **Between 10% and 80%**: Represents a neutral to moderate liquidity environment.
#### **2. Trading Strategies:**
- **Long-Term Investing**:
- Use the M2 Index to assess global liquidity trends.
- **High M2 Index (e.g., >80%)**: Consider investing in risk assets (stocks, commodities) as liquidity supports growth.
- **Low M2 Index (e.g., <10%)**: Shift to defensive assets (bonds, gold) as liquidity tightens.
- **Short-Term Trading**:
- Combine the M2 Index with technical indicators (e.g., RSI, MACD) for timing entries and exits.
- **M2 Index Rising + RSI Oversold**: Potential buying opportunity.
- **M2 Index Falling + RSI Overbought**: Potential selling opportunity.
#### **3. Macroeconomic Analysis**:
- Use the M2 Index to monitor the impact of central bank policies (e.g., quantitative easing, rate hikes).
- Correlate the M2 Index with inflation data (CPI, PPI) to anticipate inflationary or deflationary trends.
---
### **Key Features:**
- **Customizable Timeframe**: Adjust the lookback period (e.g., 13 weeks, 26 weeks) to suit your trading style.
- **Multi-Economy Data**: Aggregates M2 data from the US, EU, China, Japan, and the UK for a global perspective.
- **Normalized Output**: Converts raw M2 data into an easy-to-interpret percentage format.
- **Reference Levels**: Includes key levels (10%, 50%, 80%) for quick analysis.
---
### **Example Use Case:**
- **Scenario**: The M2 Index rises from 49% to 62% over two weeks.
- **Interpretation**: Global liquidity is increasing, potentially due to central bank stimulus.
- **Action**:
- **Long-Term**: Increase exposure to equities and commodities.
- **Short-Term**: Look for buying opportunities in oversold assets (e.g., RSI < 30).
---
### **Why Use the Global M2 Index Percentage?**
- **Macro Insights**: Understand the broader economic environment and its impact on financial markets.
- **Risk Management**: Identify periods of high or low liquidity to adjust your portfolio accordingly.
- **Enhanced Timing**: Combine with technical analysis for better entry and exit points.
---
### **Conclusion:**
The **Global M2 Index Percentage** is a powerful tool for traders and investors seeking to incorporate macroeconomic data into their strategies. By tracking global liquidity trends, this indicator helps you make informed decisions, whether you're trading short-term or planning long-term investments. Add it to your TradingView charts today and gain a deeper understanding of the global money supply!
---
**Disclaimer**: This indicator is for informational purposes only and should not be considered financial advice. Always conduct your own research and consult with a professional before making investment decisions.
On Balance Volume with Cross DetectionThis indicator enhances the On Balance Volume (OBV) indicator by detecting and visually highlighting crossovers and crossunders between the OBV and its smoothed moving average. The script colors the background of the chart to make these key events more noticeable: red highlights a bearish crossunder when the OBV crosses below the smoothed OBV, while green marks a bullish crossover when the OBV crosses above the smoothed OBV. By focusing on these significant interactions, the script provides traders with a clear visual cue to help identify potential buying and selling opportunities based on the relationship between OBV and its smoothed trend.
This script offers several customizable features to suit different trading preferences. The main editable parameter is the type of moving average used to smooth the OBV: you can choose from options such as Simple Moving Average (SMA), Exponential Moving Average (EMA), Smoothed Moving Average (RMA), Weighted Moving Average (WMA), or Volume Weighted Moving Average (VWMA). The length of the moving average can also be adjusted to better match the trader’s desired sensitivity, with the default set to 14 periods. These options allow traders to tailor the script to their preferred smoothing method and time frame, making it a flexible tool for a variety of strategies. The ability to switch between different moving averages and adjust their lengths ensures that the script can be adapted to various market conditions and trading styles.
This indicator enhances the analysis of the On Balance Volume (OBV) indicator by visually highlighting key crossovers and crossunders with its smoothed moving average. With customizable settings for different moving averages and lengths, traders can tailor the script to their specific strategies. By offering clear visual cues through background coloring, it helps quickly identify potential buy and sell signals. When combined with other technical analysis tools, this script can further improve trading decisions by providing additional context and confirmation, allowing traders to create a more robust and comprehensive trading strategy.
Support and Resistancelookback: This input allows you to specify the number of bars to look back to calculate the support and resistance levels.
support: This is calculated as the lowest low over the specified lookback period.
resistance: This is calculated as the highest high over the specified lookback period.
plot: The support and resistance levels are plotted on the chart with different colors.
bgcolor: This optional feature highlights the support and resistance zones with a semi-transparent background color.
MA Win RateMoving Average Cross Win Rate
This simple yet useful script calculates the percentage of times a moving average crossover successfully predicts price movement.
Win Conditions:
1] A Golden Cross (fast MA crossing above slow MA) where the price moves up afterward.
2] A Death Cross (fast MA crossing below slow MA) where the price moves down afterward.
In this script, I have used a Simple Moving Average (SMA) for illustration.
You can modify the code to apply any type of moving average and test its accuracy.