FAVO (Fast Adaptive Volume Oscillator)FAVO (Fast Accurate Volume Oscillator) — осциллятор объёма, специально разработанный для выделения повышения объёмов на графике, фильтруя влияние периодических фаз узкой волатильности. Он помогает отслеживать значительные изменения объёмов, исключая шум от временных снижений активности.
Этот индикатор является альтернативой классическим объёмам, упрощая их использование в алгоритмической торговле. В отличие от номинальных объемов, FAVO не требует точных значений, что облегчает настройку автоматических стратегий с применением выявления повышения объёмов.
Основные параметры:
Период ATR: Используется для расчёта волатильности.
Порог волатильности: Уровень волатильности, при котором осциллятор активируется.
Сглаживание объёмов (период): Параметр для уменьшения рыночного шума в объёмах.
Тип отображения: Выбор между отображением в виде линии или гистограммы
Indikatoren und Strategien
Stochastic Divergence BTCStochastic Oscillator with Enhanced Divergence Detection
This indicator enhances the classic Stochastic Oscillator by incorporating divergence detection, helping traders identify potential reversals more effectively.
Features:
Customizable Stochastic Settings:
%K Length, %D Length, and smoothing parameters can be adjusted for precision.
Divergence Detection:
Identifies both Bullish Divergences (potential reversal to the upside) and Bearish Divergences (potential reversal to the downside).
Divergences are marked with labels for easy visualization.
Signal Filtering:
Filters out weaker signals to reduce noise, focusing on significant divergences.
Conditions ensure divergence is detected only in overbought/oversold regions or above a threshold.
Alerts:
Custom alerts for overbought, oversold, bullish divergence, and bearish divergence signals.
How to Use:
Look for Bullish Divergence signals in oversold regions to anticipate upward reversals.
Look for Bearish Divergence signals in overbought regions to anticipate downward reversals.
Combine with price action or other indicators for better confirmation.
Ideal For:
Intraday and swing traders who want to spot market reversals early.
Anyone looking to enhance their trading strategies with divergence analysis.
Stochastic Divergence BTCStochastic Oscillator with Enhanced Divergence Detection
This indicator enhances the classic Stochastic Oscillator by incorporating divergence detection, helping traders identify potential reversals more effectively.
Features:
Customizable Stochastic Settings:
%K Length, %D Length, and smoothing parameters can be adjusted for precision.
Divergence Detection:
Identifies both Bullish Divergences (potential reversal to the upside) and Bearish Divergences (potential reversal to the downside).
Divergences are marked with labels for easy visualization.
Signal Filtering:
Filters out weaker signals to reduce noise, focusing on significant divergences.
Conditions ensure divergence is detected only in overbought/oversold regions or above a threshold.
Alerts:
Custom alerts for overbought, oversold, bullish divergence, and bearish divergence signals.
How to Use:
Look for Bullish Divergence signals in oversold regions to anticipate upward reversals.
Look for Bearish Divergence signals in overbought regions to anticipate downward reversals.
Combine with price action or other indicators for better confirmation.
Ideal For:
Intraday and swing traders who want to spot market reversals early.
Anyone looking to enhance their trading strategies with divergence analysis.
Stochastic Divergence BTCStochastic Oscillator with Enhanced Divergence Detection
This indicator enhances the classic Stochastic Oscillator by incorporating divergence detection, helping traders identify potential reversals more effectively.
Features:
Customizable Stochastic Settings:
%K Length, %D Length, and smoothing parameters can be adjusted for precision.
Divergence Detection:
Identifies both Bullish Divergences (potential reversal to the upside) and Bearish Divergences (potential reversal to the downside).
Divergences are marked with labels for easy visualization.
Signal Filtering:
Filters out weaker signals to reduce noise, focusing on significant divergences.
Conditions ensure divergence is detected only in overbought/oversold regions or above a threshold.
Alerts:
Custom alerts for overbought, oversold, bullish divergence, and bearish divergence signals.
How to Use:
Look for Bullish Divergence signals in oversold regions to anticipate upward reversals.
Look for Bearish Divergence signals in overbought regions to anticipate downward reversals.
Combine with price action or other indicators for better confirmation.
Ideal For:
Intraday and swing traders who want to spot market reversals early.
Anyone looking to enhance their trading strategies with divergence analysis.
Amirreza_ahli v2Amirrezaahli-v2
This indicator is designed for technical analysis, providing buy and sell signals based on multiple confirmations from various well-known indicators. The indicator generates a signal only when at least 7 confirmations from 10 different indicators are met, ensuring higher reliability.
Features:
• Utilizes EMA, MACD, RSI, Stochastic Oscillator, SAR, CCI, Keltner Channels, and Volume to generate signals.
• Includes Divergence Detection for multiple indicators like RSI, MACD, Stochastic, and CCI, enhancing the quality of signals.
• Green Rocket symbols for buy signals and Red Rocket symbols for sell signals, with the number of confirmations displayed on the rockets.
• Alerts for buy and sell signals are available on TradingView, providing notifications whenever a signal is triggered.
• Separate buy and sell confirmations are set for each condition, and a signal is generated only when the minimum number of confirmations is met.
How to Use:
1. This indicator analyzes signals based on 10 different indicators by default.
2. A buy signal is triggered when at least 7 confirmations from the 10 indicators are met, and it is displayed on the chart as a green rocket.
3. A sell signal is triggered when at least 7 confirmations from the 10 indicators are met, and it is displayed on the chart as a red rocket.
4. Alerts for buy and sell signals are preset, so you can receive notifications as soon as a signal is generated.
Note:
This indicator can be used as a supplemental tool for decision-making in trading. However, it is recommended to test the indicator in demo markets before using it for live trading.
or.
Dynamic Signal EngineDynamic Signal Engine
The Dynamic Signal Engine is a powerful and versatile indicator, designed to help traders make informed decisions by combining trend analysis with key support and resistance levels. This tool is inspired by the Linear Regression Oscillator , which laid the foundation for this enhanced implementation. By building on the original concept, this script introduces additional features, customization, and integration with dynamic trading strategies to suit diverse trading styles.
Key Features
Inspiration and Foundation
This indicator draws inspiration from the Linear Regression Oscillator , leveraging its robust trend detection capabilities while adding custom enhancements for broader functionality and user adaptability.
Trading Style Customization
Adaptable for Scalping, Intraday, and Swing Trading with dynamic parameter adjustments for each style.
User-defined inputs for thresholds, lookback periods, and visualization options provide further control.
Enhanced Linear Regression Oscillator (LRO)
A refined implementation of the LRO calculates deviations from a regression line, normalized for improved trend detection.
Identifies bullish and bearish crossovers with added alerts and visual markers.
Includes proximity alerts for critical thresholds to help traders anticipate key market movements.
Dynamic Support and Resistance Integration
Incorporates ENIGMA Signal Logic to identify swing highs and lows, dynamically marking them as fractal support and resistance levels.
When a sell signal from ENIGMA is generated, traders can choose to sell immediately or use the low of the previous candle as the entry point. Similarly, for a buy signal, traders can buy immediately or use the high of the previous candle for entry. These signals are visually indicated by a green triangle for buy signals, ensuring clear and actionable insights.
Advanced Visualization
Displays key levels with customizable horizontal lines (solid, dashed, or dotted) and labels for clarity.
Candle colours and mini arrows highlight trends and potential trading opportunities.
Real-Time Alerts
Alerts for LRO threshold crossings and swing-level breaches keep you updated without the need for constant monitoring.
Optimized for Usability
Designed to keep charts clean by limiting displayed trades and signals to recent activity.
Adjustable parameters ensure flexibility and a user-friendly experience.
How It Works
Trend Detection with Enhanced LRO
The indicator builds on the Linear Regression Oscillator , calculating oscillations of price movements and normalizing them for trend analysis. Crossovers and threshold proximity are visualized on the chart and trigger alerts for potential market shifts.
Dynamic Support and Resistance Levels
The ENIGMA Signal Logic identifies recent swing highs and lows, marking them as key levels. These levels are dynamically updated as new swing points are detected, providing actionable support and resistance zones.
Signal Confirmation
Buy or sell signals are confirmed when:
Price breaches the swing levels.
The LRO aligns with directional bias (e.g., bearish crossover for sell signals).
Signals are further clarified by ENIGMA's green triangle indicators, showing key buy and sell opportunities.
Visualization and Alerts
Signals are displayed using arrows, labelled horizontal lines, and optional candle colours. Alerts notify traders of key events, such as LRO threshold crossings or swing-level breaches.
How to Use
Choose your Trading Style: Scalping, Intraday, or Swing Trading. The indicator adjusts its default settings automatically.
Fine-tune parameters like LRO thresholds, line lengths, and the number of visible trades to suit your preferences.
Observe the chart for signals:
Green arrows and lines indicate buy opportunities.
Red arrows and lines signal sell opportunities.
Use the alert system to stay informed about LRO thresholds and signal confirmations.
Integrate the indicator with your existing trading strategy for better decision-making.
Acknowledgement
This script was inspired by the Linear Regression Oscillator . While it builds on the core concept, this implementation introduces unique enhancements, such as dynamic signal integration, trading style adaptability, and advanced visualization tools, making it a highly customizable and versatile tool for traders.
Disclaimer
This indicator is intended for educational purposes only and should not be considered financial advice. Always perform due diligence and apply appropriate risk management when trading.
Gold Trading Strategy (FVG, RSI, MACD) Gan-Erdene 2024<ganaa jfdisahfjdka iheu7whBN3UETZ 8WZE78TQ GDJABSDUHIg
Multi-Period Technical AnalysisThis indicator table provides a comprehensive view of key technical indicators across different time periods. Here's what each component displays:
Layout:
Top row contains headers for each column
Left-most column shows time periods (Current, -2, -4, -6, -8 candles)
Color coding: Current period is highlighted in green, historical periods in gray
Indicators Displayed:
Price: The actual closing price for each period
MFI (Money Flow Index): A momentum indicator combining price and volume, ranging 0-100
CCI (Commodity Channel Index): Shows overbought/oversold conditions and trend strength
Stochastic K & D: Two lines showing momentum, both ranging 0-100
K line: The faster, more sensitive line
D line: The slower, smoothed line
Williams %R: Shows overbought/oversold levels, ranging -100 to 0
MACD: Two lines showing trend direction and momentum
MACD line: The difference between fast and slow moving averages
Signal line: A smoothed version of the MACD line
Purpose:
Allows traders to see how indicators have evolved over the last few periods
Helps identify trends by comparing current values with historical ones
Provides a quick way to spot divergences between price and indicators
Useful for comparing multiple indicators at specific points in time
Kernel Regression Envelope with SMI OscillatorThis script combines the predictive capabilities of the **Nadaraya-Watson estimator**, implemented by the esteemed jdehorty (credit to him for his excellent work on the `KernelFunctions` library and the original Nadaraya-Watson Envelope indicator), with the confirmation strength of the **Stochastic Momentum Index (SMI)** to create a dynamic trend reversal strategy. The core idea is to identify potential overbought and oversold conditions using the Nadaraya-Watson Envelope and then confirm these signals with the SMI before entering a trade.
**Understanding the Nadaraya-Watson Envelope:**
The Nadaraya-Watson estimator is a non-parametric regression technique that essentially calculates a weighted average of past price data to estimate the current underlying trend. Unlike simple moving averages that give equal weight to all past data within a defined period, the Nadaraya-Watson estimator uses a **kernel function** (in this case, the Rational Quadratic Kernel) to assign weights. The key parameters influencing this estimation are:
* **Lookback Window (h):** This determines how many historical bars are considered for the estimation. A larger window results in a smoother estimation, while a smaller window makes it more reactive to recent price changes.
* **Relative Weighting (alpha):** This parameter controls the influence of different time frames in the estimation. Lower values emphasize longer-term price action, while higher values make the estimator more sensitive to shorter-term movements.
* **Start Regression at Bar (x\_0):** This allows you to exclude the potentially volatile initial bars of a chart from the calculation, leading to a more stable estimation.
The script calculates the Nadaraya-Watson estimation for the closing price (`yhat_close`), as well as the highs (`yhat_high`) and lows (`yhat_low`). The `yhat_close` is then used as the central trend line.
**Dynamic Envelope Bands with ATR:**
To identify potential entry and exit points around the Nadaraya-Watson estimation, the script uses **Average True Range (ATR)** to create dynamic envelope bands. ATR measures the volatility of the price. By multiplying the ATR by different factors (`nearFactor` and `farFactor`), we create multiple bands:
* **Near Bands:** These are closer to the Nadaraya-Watson estimation and are intended to identify potential immediate overbought or oversold zones.
* **Far Bands:** These are further away and can act as potential take-profit or stop-loss levels, representing more extreme price extensions.
The script calculates both near and far upper and lower bands, as well as an average between the near and far bands. This provides a nuanced view of potential support and resistance levels around the estimated trend.
**Confirming Reversals with the Stochastic Momentum Index (SMI):**
While the Nadaraya-Watson Envelope identifies potential overextended conditions, the **Stochastic Momentum Index (SMI)** is used to confirm a potential trend reversal. The SMI, unlike a traditional stochastic oscillator, oscillates around a zero line. It measures the location of the current closing price relative to the median of the high/low range over a specified period.
The script calculates the SMI on a **higher timeframe** (defined by the "Timeframe" input) to gain a broader perspective on the market momentum. This helps to filter out potential whipsaws and false signals that might occur on the current chart's timeframe. The SMI calculation involves:
* **%K Length:** The lookback period for calculating the highest high and lowest low.
* **%D Length:** The period for smoothing the relative range.
* **EMA Length:** The period for smoothing the SMI itself.
The script uses a double EMA for smoothing within the SMI calculation for added smoothness.
**How the Indicators Work Together in the Strategy:**
The strategy enters a long position when:
1. The closing price crosses below the **near lower band** of the Nadaraya-Watson Envelope, suggesting a potential oversold condition.
2. The SMI crosses above its EMA, indicating positive momentum.
3. The SMI value is below -50, further supporting the oversold idea on the higher timeframe.
Conversely, the strategy enters a short position when:
1. The closing price crosses above the **near upper band** of the Nadaraya-Watson Envelope, suggesting a potential overbought condition.
2. The SMI crosses below its EMA, indicating negative momentum.
3. The SMI value is above 50, further supporting the overbought idea on the higher timeframe.
Trades are closed when the price crosses the **far band** in the opposite direction of the trade. A stop-loss is also implemented based on a fixed value.
**In essence:** The Nadaraya-Watson Envelope identifies areas where the price might be deviating significantly from its estimated trend. The SMI, calculated on a higher timeframe, then acts as a confirmation signal, suggesting that the momentum is shifting in the direction of a potential reversal. The ATR-based bands provide dynamic entry and exit points based on the current volatility.
**How to Use the Script:**
1. **Apply the script to your chart.**
2. **Adjust the "Kernel Settings":**
* **Lookback Window (h):** Experiment with different values to find the smoothness that best suits the asset and timeframe you are trading. Lower values make the envelope more reactive, while higher values make it smoother.
* **Relative Weighting (alpha):** Adjust to control the influence of different timeframes on the Nadaraya-Watson estimation.
* **Start Regression at Bar (x\_0):** Increase this value if you want to exclude the initial, potentially volatile, bars from the calculation.
* **Stoploss:** Set your desired stop-loss value.
3. **Adjust the "SMI" settings:**
* **%K Length, %D Length, EMA Length:** These parameters control the sensitivity and smoothness of the SMI. Experiment to find settings that work well for your trading style.
* **Timeframe:** Select the higher timeframe you want to use for SMI confirmation.
4. **Adjust the "ATR Length" and "Near/Far ATR Factor":** These settings control the width and sensitivity of the envelope bands. Smaller ATR lengths make the bands more reactive to recent volatility.
5. **Customize the "Color Settings"** to your preference.
6. **Observe the plots:**
* The **Nadaraya-Watson Estimation (yhat)** line represents the estimated underlying trend.
* The **near and far upper and lower bands** visualize potential overbought and oversold zones based on the ATR.
* The **fill areas** highlight the regions between the near and far bands.
7. **Look for entry signals:** A long entry is considered when the price touches or crosses below the lower near band and the SMI confirms upward momentum. A short entry is considered when the price touches or crosses above the upper near band and the SMI confirms downward momentum.
8. **Manage your trades:** The script provides exit signals when the price crosses the far band. The fixed stop-loss will also close trades if the price moves against your position.
**Justification for Combining Nadaraya-Watson Envelope and SMI:**
The combination of the Nadaraya-Watson Envelope and the SMI provides a more robust approach to identifying potential trend reversals compared to using either indicator in isolation. The Nadaraya-Watson Envelope excels at identifying potential areas where the price is overextended relative to its recent history. However, relying solely on the envelope can lead to false signals, especially in choppy or volatile markets. By incorporating the SMI as a confirmation tool, we add a momentum filter that helps to validate the potential reversals signaled by the envelope. The higher timeframe SMI further helps to filter out noise and focus on more significant shifts in momentum. The ATR-based bands add a dynamic element to the entry and exit points, adapting to the current market volatility. This mashup aims to leverage the strengths of each indicator to create a more reliable trading strategy.
AriVestHub_Inside Bars/Candles
Introduction:
This script identifies and marks inside bars on your TradingView charts. An inside bar pattern is a two-bar candlestick pattern where the second bar is entirely within the range of the first bar. This pattern often signals consolidation and can indicate a potential breakout or trend continuation.
Trading Signals:
Inside bars can indicate potential trading signals. Traders often watch for breakouts above or below the inside bar to identify potential entry points.
Customization:
You can customize the colors, styles, and labels to suit your preferences.
Conclusion
This script is a useful tool for traders looking to identify inside bar patterns on their TradingView charts. By highlighting these patterns, traders can make more informed trading decisions based on potential market consolidations and breakouts.
EMA Status Table - FelipeEMA Status Table - Felipe For easier scanning of EMAs accross multiple timeframes.
UIABu indikator bir neçə texniki analiz alətini birləşdirərək ticarət qərarlarını avtomatlaşdırır. İndikatorun əsas funksiyaları:
1. **ADX (Average Directional Index):** Trendi müəyyən edir və trendin gücünü ölçür.
2. **RSI (Relative Strength Index):** Bazarda alınıb-satılma həddini göstərir.
3. **MACD (Moving Average Convergence Divergence):** Trendin istiqamətini və dəyişiklik momentini izləyir.
4. **Pivot Nöqtələri:** Dəstək və müqavimət səviyyələrini təyin edir.
**İşləmə prinsipi:**
İndikator hər bir texniki alətin verdiyi al və ya sat siqnallarını təhlil edir. Əgər bir neçə alət bir istiqamətdə siqnal verirsə, müvafiq qərar qəbul olunur:
- **Alış siqnalı:** Ekranda yaşıl fonlu, ağ yazılı "AL" lövhəsi görünür.
- **Satış siqnalı:** Ekranda qırmızı fonlu, ağ yazılı "SAT" lövhəsi görünür.
İstifadəçi üçün sadə interfeys təmin olunub, indikator yalnız qərarı göstərir, digər vizual məlumatları gizlədir. Bu, ticarət prosesində diqqəti cəmləmək üçün optimallaşdırılıb.
Combined DCA StrategyThis script compares two investment strategies:
Fixed DCA Strategy: Invests a fixed amount monthly, regardless of market conditions.
Dynamic DCA Strategy: Invests only when a price drop (event) meets defined thresholds (daily, weekly, or monthly).
Parameters:
Start Date: When investments begin.
Monthly Budget: Amount allocated for dynamic investments.
Drop Thresholds: % price drops to trigger dynamic investments.
Fixed Investment: Monthly fixed amount.
Results:
Dynamic Strategy: Total invested and portfolio value when investing during events.
Fixed Strategy: Total invested and portfolio value with regular monthly investments.
Perfect for comparing reactive (event-based) and systematic (fixed) investment strategies.
My script
//@version=5
indicator("USD/IRR Custom Data", overlay=true)
// دادههای شما
var float data = array.from(42400, 42500, 42600, 42700) // نرخ دلار
var int dates = array.from(20240101, 20240102, 20240103, 20240104) // تاریخ (YYYYMMDD)
// رسم نمودار
var lineColor = color.new(color.blue, 0)
for i = 0 to array.size(data) - 1
label.new(bar_index + i, array.get(data, i), tostring(array.get(dates, i)), color=lineColor)
My script
Ebrahim Shojaee
1:20 PM (0 minutes ago)
to me
//@version=5
indicator("USD/IRR Custom Data", overlay=true)
// دادههای شما
var float data = array.from(42400, 42500, 42600, 42700) // نرخ دلار
var int dates = array.from(20240101, 20240102, 20240103, 20240104) // تاریخ (YYYYMMDD)
// رسم نمودار
var lineColor = color.new(color.blue, 0)
for i = 0 to array.size(data) - 1
label.new(bar_index + i, array.get(data, i), tostring(array.get(dates, i)), color=lineColor)
HH||LL||KCThis script is written in Pine Script version 5, designed for TradingView. It defines a custom trading indicator named **HH||LL||KC**. Here's a breakdown of its components and functionality:
---
### **Indicator Overview**
- **Purpose**: Combines multiple technical analysis tools to generate trading signals, including Keltner Channels, RSI-based stochastic oscillator, and conditions for buy and sell alerts.
- **Overlay**: The indicator plots directly on the price chart (overlay = `true`).
- **Precision**: Values are displayed with 2 decimal points.
---
### **Key Components**
1. **Keltner Channels**:
- Defined by `ma`, `upper`, and `lower` bands.
- Uses an exponential moving average (EMA) as the basis (`ma`).
- The upper and lower bands are derived from the range of highs and lows over the specified `length` (default is 100), multiplied by a factor (`mult`, default is 0.5).
2. **RSI Stochastic Oscillator**:
- Combines RSI and Stochastic calculations to create `%K` and `%D` lines:
- RSI is calculated over `lengthRSI` (default 14) using the specified source (`close` by default).
- Stochastic uses `lengthStoch` (default 14) smoothed by `smoothK` and `smoothD`.
- `%K` and `%D` are used for overbought/oversold signals and crossovers.
3. **Highs, Lows, and Alerts**:
- Identifies:
- **Highs (HH)** when `%K > 80`.
- **Lows (LL)** when `%K < 20`.
- Generates `red` and `green` points based on crossovers of `%K` with overbought/oversold levels.
- A 36-period EMA is plotted as an additional trend indicator.
4. **Additional Plots**:
- `ta.linreg(close, 21, 0)`: Short-term linear regression line.
- `ta.linreg(close, 375, 0)`: Long-term linear regression line.
- Plots for `red` and `green` points for potential reversal levels.
- Buy and Sell signal markers:
- **Buy**: Appears below the bar when `condi1` is true.
- **Sell**: Appears above the bar when `condi2` is true.
5. **Alerts**:
- Triggered when:
- `%K` crosses `%D` with specific conditions (e.g., close above `green` or below `red`).
- Defined via `alertcondition`.
---
### **Trading Logic**
1. **Buy Signal (condi1)**:
- EMA is above the upper Keltner Channel.
- Red marker (`red`) is above the EMA, and:
- Current or past candles open and close above the marker.
- `%K` is below 20, and `%K` crosses `%D`.
2. **Sell Signal (condi2)**:
- EMA is below the lower Keltner Channel.
- Green marker (`green`) is below the EMA, and:
- Current or past candles open below the marker.
- `%K` is above 80, and `%K` crosses under `%D`.
---
### **Visualization**
- **Keltner Channel**: Blue bands for upper and lower limits, with a gray center line.
- **Trend Lines**:
- Orange for short-term linear regression.
- White for long-term linear regression and EMA.
- **Markers**:
- Green for buy signals.
- Red for sell signals.
- **Cross Points**:
- Green dots (`green`) for potential buy reversals.
- Red dots (`red`) for potential sell reversals.
---
### **Use Case**
Traders can use this indicator for:
- Identifying overbought/oversold conditions.
- Spotting trend reversals and continuation patterns.
- Generating buy/sell alerts based on multi-condition logic.
It is versatile and integrates several technical analysis concepts into a single script.
HH||LL||KCThis script is written in Pine Script version 5, designed for TradingView. It defines a custom trading indicator named **HH||LL||KC**. Here's a breakdown of its components and functionality:
---
### **Indicator Overview**
- **Purpose**: Combines multiple technical analysis tools to generate trading signals, including Keltner Channels, RSI-based stochastic oscillator, and conditions for buy and sell alerts.
- **Overlay**: The indicator plots directly on the price chart (overlay = `true`).
- **Precision**: Values are displayed with 2 decimal points.
---
### **Key Components**
1. **Keltner Channels**:
- Defined by `ma`, `upper`, and `lower` bands.
- Uses an exponential moving average (EMA) as the basis (`ma`).
- The upper and lower bands are derived from the range of highs and lows over the specified `length` (default is 100), multiplied by a factor (`mult`, default is 0.5).
2. **RSI Stochastic Oscillator**:
- Combines RSI and Stochastic calculations to create `%K` and `%D` lines:
- RSI is calculated over `lengthRSI` (default 14) using the specified source (`close` by default).
- Stochastic uses `lengthStoch` (default 14) smoothed by `smoothK` and `smoothD`.
- `%K` and `%D` are used for overbought/oversold signals and crossovers.
3. **Highs, Lows, and Alerts**:
- Identifies:
- **Highs (HH)** when `%K > 80`.
- **Lows (LL)** when `%K < 20`.
- Generates `red` and `green` points based on crossovers of `%K` with overbought/oversold levels.
- A 36-period EMA is plotted as an additional trend indicator.
4. **Additional Plots**:
- `ta.linreg(close, 21, 0)`: Short-term linear regression line.
- `ta.linreg(close, 375, 0)`: Long-term linear regression line.
- Plots for `red` and `green` points for potential reversal levels.
- Buy and Sell signal markers:
- **Buy**: Appears below the bar when `condi1` is true.
- **Sell**: Appears above the bar when `condi2` is true.
5. **Alerts**:
- Triggered when:
- `%K` crosses `%D` with specific conditions (e.g., close above `green` or below `red`).
- Defined via `alertcondition`.
---
### **Trading Logic**
1. **Buy Signal (condi1)**:
- EMA is above the upper Keltner Channel.
- Red marker (`red`) is above the EMA, and:
- Current or past candles open and close above the marker.
- `%K` is below 20, and `%K` crosses `%D`.
2. **Sell Signal (condi2)**:
- EMA is below the lower Keltner Channel.
- Green marker (`green`) is below the EMA, and:
- Current or past candles open below the marker.
- `%K` is above 80, and `%K` crosses under `%D`.
---
### **Visualization**
- **Keltner Channel**: Blue bands for upper and lower limits, with a gray center line.
- **Trend Lines**:
- Orange for short-term linear regression.
- White for long-term linear regression and EMA.
- **Markers**:
- Green for buy signals.
- Red for sell signals.
- **Cross Points**:
- Green dots (`green`) for potential buy reversals.
- Red dots (`red`) for potential sell reversals.
---
### **Use Case**
Traders can use this indicator for:
- Identifying overbought/oversold conditions.
- Spotting trend reversals and continuation patterns.
- Generating buy/sell alerts based on multi-condition logic.
It is versatile and integrates several technical analysis concepts into a single script.
EMA 9 and 21 Crossovertrading ema 9 and 2 crossover and its all about to scalping suitable for 15 min and 5 min