Adaptive DEMA Momentum Oscillator (ADMO)Overview:
The Adaptive DEMA Momentum Oscillator (ADMO) is an open-source technical analysis tool developed to measure market momentum using a Double Exponential Moving Average (DEMA) and adaptive standard deviation. By dynamically combining price deviation from the moving average with normalized standard deviation, ADMO provides traders with a powerful way to interpret market conditions.
Key Features:
Double Exponential Moving Average (DEMA):
The core calculation of the indicator is based on DEMA, which is known for being more responsive to price changes compared to traditional moving averages. This makes the ADMO capable of capturing trend momentum effectively.
Standard Deviation Integration:
A normalized standard deviation is used to adaptively weight the oscillator. This makes the indicator more sensitive to market volatility, enhancing responsiveness during high volatility and reducing sensitivity during calmer periods.
Oscillator Representation:
The final oscillator value is derived from the combination of the DEMA-based Z-score and the normalized standard deviation. This final value is visualized as a color-coded histogram, reflecting bullish or bearish momentum.
Color-Coded Histogram:
Bullish Momentum: Values above zero are colored using a customizable bullish color (default: light green).
Bearish Momentum: Values below zero are colored using a customizable bearish color (default: red).
How It Works:
Inputs:
DEMA Length: Defines the period used for calculating the Double Exponential Moving Average. It can be adjusted from 1 to 200 to suit different trading styles.
Standard Deviation Length: Sets the lookback period for standard deviation calculations, which influences the responsiveness of the oscillator.
Standard Deviation Weight (StdDev Weight): Controls the weight given to the normalized standard deviation, allowing customization of the oscillator's sensitivity to volatility.
Calculation Steps:
Double Exponential Moving Average Calculation:
The DEMA is calculated using two exponential moving averages, which helps in reducing lag compared to a simple moving average.
Z-score Calculation:
The Z-score is derived by comparing the difference between the DEMA and its smoothed average (LSMA) to the standard deviation. This indicates how far the current value is from the mean in units of standard deviation.
Normalized Standard Deviation:
The standard deviation is normalized by subtracting the mean standard deviation and dividing by the standard deviation of the values. This helps to make the oscillator adaptive to recent changes in volatility.
Final Oscillator Value:
The final value is calculated by multiplying the Z-score with a factor based on the normalized standard deviation, resulting in a momentum indicator that adapts to different market conditions.
Visualization:
Histogram: The oscillator is plotted as a histogram, with color-coded bars showing the strength and direction of market momentum.
Positive (bullish) values are shown in green, indicating upward momentum.
Negative (bearish) values are shown in red, indicating downward momentum.
Zero Line: A zero line is plotted to provide a reference point, helping users quickly determine whether the current momentum is bullish or bearish.
Example Use Cases:
Momentum Identification:
ADMO helps identify the current market momentum by dynamically adapting to changes in market volatility. When the histogram is above zero and green, it indicates bullish conditions, whereas values below zero and red suggest bearish momentum.
Volatility-Adjusted Signals:
The normalized standard deviation weighting allows the ADMO to provide more reliable signals during different market conditions. This makes it particularly useful for traders who want to be responsive to market volatility while avoiding false signals.
Trend Confirmation and Divergence:
ADMO can be used to confirm the strength of a trend or identify potential divergences between price and momentum. This helps traders spot potential reversal points or continuation signals.
Summary:
The Adaptive DEMA Momentum Oscillator (ADMO) offers a unique approach by combining momentum analysis with adaptive standard deviation. The integration of DEMA makes it responsive to price changes, while the standard deviation adjustment helps it stay relevant in both high and low volatility environments. It's a versatile tool for traders who need an adaptive, momentum-based approach to technical analysis.
Feel free to explore the code and adapt it to your trading strategy. The open-source nature of this tool allows you to adjust the settings and visualize the output to fit your personal trading preferences.
ממוצעים נעים
Simple Moving Average with Regime Detection by iGrey.TradingThis indicator helps traders identify market regimes using the powerful combination of 50 and 200 SMAs. It provides clear visual signals and detailed metrics for trend-following strategies.
Key Features:
- Dual SMA System (50/200) for regime identification
- Colour-coded candles for easy trend visualisation
- Metrics dashboard
Core Signals:
- Bullish Regime: Price < 200 SMA
- Bearish Regime: Price > 200 SMA
- Additional confirmation: 50 SMA Cross-over or Cross-under (golden cross or death cross)
Metrics Dashboard:
- Current Regime Status (Bull/Bear)
- SMA Distance (% from price to 50 SMA)
- Regime Distance (% from price to 200 SMA)
- Regime Duration (bars in current regime)
Usage Instructions:
1. Apply the indicator to your chart
2. Configure the SMA lengths if desired (default: 50/200)
3. Monitor the color-coded candles:
- Green: Bullish regime
- Red: Bearish regime
4. Use the metrics dashboard for detailed analysis
Settings Guide:
- Length: Short-term SMA period (default: 50)
- Source: Price calculation source (default: close)
- Regime Filter Length: Long-term SMA period (default: 200)
- Regime Filter Source: Price source for regime calculation (default: close)
Trading Tips:
- Use bullish regimes for long positions
- Use bearish regimes for capital preservation or short positions
- Consider regime duration for trend strength
- Monitor distance metrics for potential reversals
- Combine with other systems for confluence
#trend-following #moving average #regime #sma #momentum
Risk Management:
- Not a standalone trading system
- Should be used with proper position sizing
- Consider market conditions and volatility
- Always use stop losses
Best Practices:
- Monitor multiple timeframes
- Use with other confirmation tools
- Consider fundamental factors
Version: 1.0
Created by: iGREY.Trading
Release Notes
// v1.1 Allows table overlay customisation
// v1.2 Update to v6 pinescript
Dual Strategy Selector V2 - CryptogyaniOverview:
This script provides traders with a dual-strategy system that they can toggle between using a simple dropdown menu in the input settings. It is designed to cater to different trading styles and needs, offering both simplicity and advanced filtering techniques. The strategies are built around moving average crossovers, enhanced by configurable risk management tools like take profit levels, trailing stops, and ATR-based stop-loss.
Key Features:
Two Strategies in One Script:
Strategy 1: A classic moving average crossover strategy for identifying entry signals based on trend reversals. Includes user-defined take profit and trailing stop-loss options for profit locking.
Strategy 2: An advanced trend-following system that incorporates:
A higher timeframe trend filter to confirm entry signals.
ATR-based stop-loss for dynamic risk management.
Configurable partial take profit to secure gains while letting the trade run.
Highly Customizable:
All key parameters such as SMA lengths, take profit levels, ATR multiplier, and timeframe for the trend filter are adjustable via the input settings.
Dynamic Toggle:
Traders can switch between Strategy 1 and Strategy 2 with a single dropdown, allowing them to adapt the strategy to market conditions.
How It Works:
Strategy 1:
Entry Logic: A long trade is triggered when the fast SMA crosses above the slow SMA.
Exit Logic: The trade exits at either a user-defined take profit level (percentage or pips) or via an optional trailing stop that dynamically adjusts based on price movement.
Strategy 2:
Entry Logic: Builds on the SMA crossover logic but adds a higher timeframe trend filter to align trades with the broader market direction.
Risk Management:
ATR-Based Stop-Loss: Protects against adverse moves with a volatility-adjusted stop-loss.
Partial Take Profit: Allows traders to secure a percentage of gains while keeping some exposure for extended trends.
How to Use:
Select Your Strategy:
Use the dropdown in the input settings to choose Strategy 1 or Strategy 2.
Configure Parameters:
Adjust SMA lengths, take profit, and risk management settings to align with your trading style.
For Strategy 2, specify the higher timeframe for trend filtering.
Deploy and Monitor:
Apply the script to your preferred asset and timeframe.
Use the backtest results to fine-tune settings for optimal performance.
Why Choose This Script?:
This script stands out due to its dual-strategy flexibility and enhanced features:
For beginners: Strategy 1 provides a simple yet effective trend-following system with minimal setup.
For advanced traders: Strategy 2 includes powerful tools like trend filters and ATR-based stop-loss, making it ideal for challenging market conditions.
By combining simplicity with advanced features, this script offers something for everyone while maintaining full transparency and user customization.
Default Settings:
Strategy 1:
Fast SMA: 21, Slow SMA: 49
Take Profit: 7% or 50 pips
Trailing Stop: Optional (disabled by default)
Strategy 2:
Fast SMA: 20, Slow SMA: 50
ATR Multiplier: 1.5
Partial Take Profit: 50%
Higher Timeframe: 1 Day (1D)
Stock_Cloud-EMA,VWAP,ST Indicator_V1Stock_Cloud V1 - EMA, VWAP, SuperTrend Strategy Indicator
This indicator combines three powerful technical indicators (EMA, VWAP, and SuperTrend) to create a comprehensive trading system that helps identify high-probability trading setups when all components align.
Strategy Components & Logic:
• EMA (Exponential Moving Average): Acts as a dynamic support/resistance and trend direction indicator
• VWAP (Volume Weighted Average Price): Provides important institutional price levels and volume-based trend strength
• SuperTrend: Offers trend direction and potential reversal points
Why These Components Work Together:
1. EMA filters out market noise while maintaining responsiveness to price changes
2. VWAP adds volume-based price validation, especially useful for intraday trading
3. SuperTrend confirms trend direction and potential reversal points
4. When all three indicators align, it creates a high-probability setup
Signal Generation:
• Bullish Signal: Generated when price crosses above all three indicators (EMA, VWAP, and SuperTrend turns bullish)
• Bearish Signal: Generated when price crosses below all three indicators (EMA, VWAP, and SuperTrend turns bearish)
• Background color changes help visualize the current market condition
Settings:
- EMA Length: 20 (default, adjustable)
- SuperTrend Period: 10 (default, adjustable)
- SuperTrend Multiplier: 3.0 (default, adjustable)
How to Use:
1. Look for potential entries when all three indicators align
2. Small triangles mark key entry points when alignment occurs
3. Use background color as additional confirmation
4. Monitor price action relative to all three indicators for exit signals
Best Timeframes:
Works well on all timeframes, but particularly effective on 5-minute to daily charts for stocks and indices.
Note: This indicator combines traditional technical analysis tools in a unique way to provide clear, actionable signals. Always use proper risk management and consider other factors like market conditions and support/resistance levels.
Created by Stock_Cloud
Version 2.0
Bitcoin Cycle High/Low with functional Alerts [heswaikcrypt]Introduction
Just as machines are fine-tuned for maximum efficiency, trading indicators must evolve to meet the demands of ever-changing markets.
Credit goes to the exiting creator of the Pi-cycle algorithm.
Philip Swift’s Pi Cycle Top Indicator is a brilliant example of leveraging mathematical relationships to signal critical turning points in Bitcoin’s price cycles. Historically, it has identified market and local tops with some relative accuracy, often within three days, as demonstrated in all the previous bull run cycles.
At its core, the Pi Cycle Indicator derives its name from the mathematical constant π (pi), achieved by using simple moving averages (MAs) in a specific ratio: 𝜋 = Long MA/short MA
...
I didn't really do much in this script; I only improved the existing Pi-cycle indicator with a functional alert for the cycle top, cycle bottom, and the potential bull phase switch.
Knowing when Bitcoin reaches its top—and receiving timely alerts about it—is crucial for successful trading. The indicator is designed to signal;
Potential Bitcoin tops: Purple label
Potential Bitcoin bottoms : green Label, and
Parabolic swing : Diamond shape (relating to the market switching to a potential bull mode)
"Please note: This indicator is tailored for Bitcoin using historical data analysis and should not be considered definitive. However accurate it might be."
Setting alerts
To set the alert conditions, select any alert function call
to get alert whenever the conditions are met. The script is configured on dialy TF; you can set it on 1D or weekly TF.
Enjoy and Trade smartly
simple swing indicator-KTRNSE:NIFTY
1. Pivot High/Low as Lines:
Purpose: Identifies local peaks (pivot highs) and troughs (pivot lows) in price and draws horizontal lines at these levels.
How it Works:
A pivot high occurs when the price is higher than the surrounding bars (based on the pivotLength parameter).
A pivot low occurs when the price is lower than the surrounding bars.
These pivots are drawn as horizontal lines at the price level of the pivot.
Visualization:
Pivot High: A red horizontal line is drawn at the price level of the pivot high.
Pivot Low: A green horizontal line is drawn at the price level of the pivot low.
Example:
Imagine the price is trending up, and at some point, it forms a peak. The script identifies this peak as a pivot high and draws a red line at the price of that peak. Similarly, if the price forms a trough, the script will draw a green line at the low point.
2. Moving Averages (20-day and 50-day):
Purpose: Plots the 20-day and 50-day simple moving averages (SMA) on the chart.
How it Works:
The 20-day SMA smooths the closing price over the last 20 days.
The 50-day SMA smooths the closing price over the last 50 days.
These lines provide an overview of short-term and long-term price trends.
Visualization:
20-day SMA: A blue line showing the 20-day moving average.
50-day SMA: An orange line showing the 50-day moving average.
Example:
When the price is above both moving averages, it indicates an uptrend. If the price crosses below these averages, it might signal a downtrend.
3. Supertrend:
Purpose: The Supertrend is an indicator based on the Average True Range (ATR) and is used to track the market trend.
How it Works:
When the market is in an uptrend, the Supertrend line will be green.
When the market is in a downtrend, the Supertrend line will be red.
Visualization:
Uptrend: The Supertrend line will be plotted in green.
Downtrend: The Supertrend line will be plotted in red.
Example:
If the price is above the Supertrend, the market is considered to be in an uptrend, and if the price is below the Supertrend, the market is in a downtrend.
4. Momentum (Rate of Change):
Purpose: Measures the rate at which the price changes over a set period, showing if the momentum is positive or negative.
How it Works:
The Rate of Change (ROC) measures how much the price has changed over a certain number of periods (e.g., 14).
Positive ROC indicates upward momentum, and negative ROC indicates downward momentum.
Visualization:
Positive ROC: A purple line is plotted above the zero line.
Negative ROC: A purple line is plotted below the zero line.
Example:
If the ROC line is above zero, it means the price is increasing, suggesting bullish momentum. If the ROC is below zero, it indicates bearish momentum.
5. Volume:
Purpose: Displays the volume of traded assets, giving insight into the strength of price movements.
How it Works:
The script will color the volume bars based on whether the price closed higher or lower than the previous bar.
Green bars indicate bullish volume (closing price higher than the previous bar), and red bars indicate bearish volume (closing price lower than the previous bar).
Visualization:
Bullish Volume: Green volume bars when the price closes higher.
Bearish Volume: Red volume bars when the price closes lower.
Example:
If you see a green volume bar, it suggests that the market is participating in an uptrend, and the price has closed higher than the previous period. Red bars indicate a downtrend or selling pressure.
6. MACD (Moving Average Convergence Divergence):
Purpose: The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of the price.
How it Works:
The MACD Line is the difference between the 12-period EMA (Exponential Moving Average) and the 26-period EMA.
The Signal Line is the 9-period EMA of the MACD Line.
The MACD Histogram shows the difference between the MACD line and the Signal line.
Visualization:
MACD Line: A blue line representing the difference between the 12-period and 26-period EMAs.
Signal Line: An orange line representing the 9-period EMA of the MACD line.
MACD Histogram: A red or green histogram that shows the difference between the MACD line and the Signal line.
Example:
When the MACD line crosses above the Signal line, it’s considered a bullish signal. When the MACD line crosses below the Signal line, it’s considered a bearish signal.
Full Chart Example:
Imagine you're looking at a price chart with all the indicators:
Pivot High/Low Lines are drawn as red and green horizontal lines.
20-day and 50-day SMAs are plotted as blue and orange lines, respectively.
Supertrend shows a green or red line indicating the trend.
Momentum (ROC) is shown as a purple line oscillating around zero.
Volume bars are green or red based on whether the close is higher or lower.
MACD appears as a blue line and orange line, with a red or green histogram showing the MACD vs. Signal line difference.
How the Indicators Work Together:
Trend Confirmation: If the price is above the Supertrend line and both SMAs are trending up, it indicates a strong bullish trend.
Momentum: If the ROC is positive and the MACD line is above the Signal line, it further confirms bullish momentum.
Volume: Increasing volume, especially with green bars, suggests that the trend is being supported by active participation.
By using these combined indicators, you can get a comprehensive view of the market's trend, momentum, and potential reversal points (via pivot highs and lows).
WBS-HMThis Indicator works on
RSI + WMA and EMA plotted.
Default Values Used :
RSI = 9
WMA = 21
EMA = 3
How it works ??
Buy : When RSI crossover WMA or any Type of Moving Average you choose,
Sell : When RSI crossunder WMA or any Type of Moving Average you choose,
also:
Buy : When EMA crossover WMA or any Type of Moving Average you choose,
Sell : When EMA crossunder WMA or any Type of Moving Average you choose,
also:
Buy : When RSI + EMA crossover WMA or any Type of Moving Average you choose at the Same time,
Sell : When RSI + EMA crossunder WMA or any Type of Moving Average you choose at the Same time,
and Much More...! hope so you like it,
SMA200 & RSI [Tarun]The SMA200 & RSI Signal Indicator is a powerful tool designed for traders who want to identify potential entry zones based on a combination of price action and momentum. This indicator combines two essential trading components:
SMA200 (Simple Moving Average): A widely used trend-following tool that highlights the overall direction of the market.
RSI (Relative Strength Index): A momentum oscillator that measures the speed and change of price movements.
How It Works:
Price Above SMA200: Indicates bullish market conditions.
RSI Between 40 and 20: Suggests that the asset is in a potential oversold or pullback zone within a bullish trend.
When both conditions are met, the indicator triggers:
Background Highlight: The chart background turns green to indicate a potential signal zone.
Disclaimer:
This indicator is not a standalone trading strategy. Use it in conjunction with other analysis methods such as support and resistance, candlestick patterns, or volume analysis. Always practice proper risk management.
Price vs SMA PercentageA simple "Rubber Band" indicator that displays how far price is stretched above/below a given SMA displayed as a percentage of last trade price.
M200 MultiplesThis script is designed to analyze price trends using moving averages and their multiples. Here's a brief description:
The script calculates and plots:
The 200-period Simple Moving Average (M200): A commonly used indicator to identify long-term trends.
Additionally, it generates multiple lines based on multipliers of the M200 to visualize potential support and resistance levels:
2x M200: Double the 200-period average.
1.5x M200, 1.68x M200, 2.236x M200, and 2.5x M200: Various multipliers to identify intermediate zones of interest.
Visualization
M200 is plotted in blue
Multipliers of M200 are plotted in gray with varying line widths for distinction.
Use Case
Identify key support and resistance levels derived from long-term moving averages.
Combine trend-following techniques with zone-based price action analysis.
This script works well on the daily time frame.
INDICADOR MAMADEIRA. Esse indicador funciona em qualquer tempo grafico, mas prefiro utilizar no D1. Ele utiliza padrões simples e indicador de compra e de venda, baseado em medias e configuravel mas minha indicação é utilizar ele com as seguintes configurações 2, 9, 50, 200. Ele é um indicador seguidor de tendência, é importa observar também que ele é excelente para operar no semanal. Ganho dinheiro nele 100% automatizado no forex, no METATRADER 5 mas aqui não disponibilizam para publicar o script para metatrader5.
BOA SORTE E BONS TRADERS.
BB+Trend MeterEsta estrategia de trading de medio plazo se basa en una combinación de indicadores técnicos para identificar oportunidades de compra y venta en un marco temporal de 30 minutos( funciona muy bien en temporalidades mayores). Aquí están los detalles:
Indicadores Utilizados:
EMA 50: Media Móvil Exponencial de 50 periodos para identificar la tendencia principal.
SMA 200: Media Móvil Simple de 200 periodos para una visión más amplia de la tendencia.
Bandas de Bollinger (20, 2): Para identificar la volatilidad y posibles puntos de reversión.
RSI (14): Índice de Fuerza Relativa para detectar condiciones de sobrecompra y sobreventa.
MACD (12, 26, 9): Convergencia y Divergencia de Medias Móviles para identificar cambios en el momentum.
Trend Meter: Un indicador compuesto configurado para ofrecer señales de compra/venta confiables:
MACD Crossover-Fast-8,21,5: Señal rápida de cruce del MACD.
CCI 20: Índice de Canal de Materias Primas para detectar condiciones de sobrecompra/sobreventa.
Stochastic Oscillator (14, 3, 3): Oscilador Estocástico para confirmar momentum.
Condiciones de Entrada en Largo (Compra):
Precio por encima de la EMA 50 y SMA 200.
RSI menor que 70.
Cruce positivo del MACD (línea MACD cruza sobre la línea de señal).
Precio por encima de la banda media de las Bandas de Bollinger.
Señales positivas del Trend Meter (MACD Crossover, CCI sin señal de sobreventa, Stochastic sin señal de sobreventa).
Condiciones de Entrada en Corto (Venta):
Precio por debajo de la EMA 50 y SMA 200.
RSI mayor que 30.
Cruce negativo del MACD (línea MACD cruza bajo la línea de señal).
Precio por debajo de la banda media de las Bandas de Bollinger.
Señales negativas del Trend Meter (MACD sin cruce, CCI sin señal de sobrecompra, Stochastic sin señal de sobrecompra).
Gestión del Riesgo:
Stop-Loss: Se coloca por debajo del último mínimo para operaciones largas y por encima del último máximo para operaciones cortas.
Take-Profit: Se establece con una relación riesgo/beneficio de 1:2.
Three-MA ( SMA ) Default:7-25-99 Version6 v6Fascinating Indicator
Its Three Simple Moving Average of (Default:7 - 25 - 99)
You can Change it
Its V6
Use it
EMA 21/50/100/200 by Learner_Chartist4 EMA's to help you drive trending markets.
21 EMA for short term trend
50 EMA for trend support
99 EMA for correction support
200 EMA for deep correction and last support
FRAMA Channel [BigBeluga]This is a trend-following indicator that utilizes the Fractal Adaptive Moving Average (FRAMA) to create a dynamic channel around the price. The FRAMA Channel helps identify uptrends, downtrends, and ranging markets by examining the relationship between the price and the channel's boundaries. It also marks trend changes with arrows, optionally displaying either price values or average volume at these key points.
🔵 IDEA
The core idea behind the FRAMA Channel indicator is to use the fractal nature of markets to adapt to different market conditions. By creating a channel around the FRAMA line, it not only tracks price trends but also adapts its sensitivity based on market volatility. When the price crosses the upper or lower bands of the channel, it signals a potential shift in trend direction. If the price remains within the channel and crosses over the upper or lower bands without a breakout, the market is likely in a ranging phase with low momentum. This adaptive approach makes the FRAMA Channel effective in both trending and ranging market environments.
🔵 KEY FEATURES & USAGE
◉ Dynamic FRAMA Channel with Trend Signals:
The FRAMA Channel uses a fractal-based moving average to create an adaptive channel around the price. When the price crosses above the upper band, it signals an uptrend and plots an upward arrow with the price (or average volume) value. Conversely, when the price crosses below the lower band, it signals a downtrend and marks the point with a downward arrow. This dynamic adaptation to market conditions helps traders identify key trend shifts effectively.
◉ Ranging Market Detection:
If the price remains within the channel, and only the high crosses the upper band or the low crosses the lower band, the indicator identifies a ranging market with low momentum. In this case, the channel turns gray, signaling a neutral trend. This is particularly useful for avoiding false signals during periods of market consolidation.
◉ Color-Coded Candles and Channel Bands:
Candles and channel bands are color-coded to reflect the current trend direction. Green indicates an upward trend, blue shows a downward trend, and gray signals a neutral or ranging market. This visual representation makes it easy to identify the market condition at a glance, helping traders make informed decisions quickly.
◉ Customizable Display of Price or Average Volume:
On trend change signals, the indicator allows users to choose whether to display the price at the point of trend change or the average volume of 10 bars. This flexibility enables traders to focus on the information that is most relevant to their strategy, whether it's the exact price entery or the volume context of the market shift. Displaying the average volume allows to see the strength of the trend change.
Price Data:
Average Volume of points:
🔵 CUSTOMIZATION
Length & Bands Distance: Adjust the length for the FRAMA calculation to control the sensitivity of the channel. A shorter length makes the channel more reactive to price changes, while a longer length smooths it out. The Bands Distance setting determines how far the bands are from the FRAMA line, helping to define the breakout and ranging conditions.
Signals Data: Choose between displaying the price or the average volume on trend change arrows. This allows traders to focus on either the exact price level of trend change or the market volume context.
Color Settings: Customize the colors for upward momentum, downward momentum, and neutral states to suit your charting preferences. You can also toggle whether to color the candles based on the momentum for a clearer visual of the trend direction.
The FRAMA Channel indicator adapts to market conditions, providing a versatile tool for identifying trends and ranging markets with clear visual cues.
Optimized Grid with KNN_2.0Strategy Overview
This strategy, named "Optimized Grid with KNN_2.0," is designed to optimize trading decisions using a combination of grid trading, K-Nearest Neighbors (KNN) algorithm, and a greedy algorithm. The strategy aims to maximize profits by dynamically adjusting entry and exit thresholds based on market conditions and historical data.
Key Components
Grid Trading:
The strategy uses a grid-based approach to place buy and sell orders at predefined price levels. This helps in capturing profits from market fluctuations.
K-Nearest Neighbors (KNN) Algorithm:
The KNN algorithm is used to optimize entry and exit points based on historical price data. It identifies the nearest neighbors (similar price movements) and adjusts the thresholds accordingly.
Greedy Algorithm:
The greedy algorithm is employed to dynamically adjust the stop-loss and take-profit levels. It ensures that the strategy captures maximum profits by adjusting thresholds based on recent price changes.
Detailed Explanation
Grid Trading:
The strategy defines a grid of price levels where buy and sell orders are placed. The openTh and closeTh parameters determine the thresholds for opening and closing positions.
The t3_fast and t3_slow indicators are used to generate trading signals based on the crossover and crossunder of these indicators.
KNN Algorithm:
The KNN algorithm is used to find the nearest neighbors (similar price movements) in the historical data. It calculates the distance between the current price and historical prices to identify the most similar price movements.
The algorithm then adjusts the entry and exit thresholds based on the average change in price of the nearest neighbors.
Greedy Algorithm:
The greedy algorithm dynamically adjusts the stop-loss and take-profit levels based on recent price changes. It ensures that the strategy captures maximum profits by adjusting thresholds in real-time.
The algorithm uses the average_change variable to calculate the average price change of the nearest neighbors and adjusts the thresholds accordingly.
Correlation Confluence Trend IndicatorCorrelation Confluence Trend Indicator
Overview
The Correlation Confluence Trend Indicator combines exponential moving averages (EMAs) and statistical correlation measures to identify high-confidence trend alignments between an asset and a benchmark. By filtering signals through correlation strength, this indicator highlights opportunities when the asset and benchmark move together. In other words, it defines a trend and then uses correlation strength and the trend of a second asset to identify high-confidence trends.
Key Features
Dual EMA Trend Analysis :
Calculates fast and slow EMAs for both the asset and the selected benchmark (e.g., SPY) to identify bullish and bearish trends.
Correlation Strength Filtering :
Evaluates correlation between the asset and benchmark, identifying stronger-than-average relationships based on the mean and standard deviation.
Background Color Coding :
- Green : Strong correlation, both asset and benchmark bullish.
- Aqua : Weak correlation, both asset and benchmark bullish.
- Red : Strong correlation, both asset and benchmark bearish.
- Fuchsia : Weak correlation, both asset and benchmark bearish.
- Orange : Strong correlation, benchmark bullish, asset bearish.
- Yellow : Weak correlation, benchmark bullish, asset bearish.
- Purple : Strong correlation, benchmark bearish, asset bullish.
- Lime : Weak correlation, benchmark bearish, asset bullish.
Visual Trend Indicators :
Plots fast and slow EMAs for the asset, dynamically colored based on aggregate trend signals. The color of this corresponds to the main trend signal.
Inputs
Benchmark Symbol : Symbol of the benchmark asset to compare against.
Fast EMA Length : Period for the fast EMA calculation.
Slow EMA Length : Period for the slow EMA calculation.
Correlation Length : Number of bars for correlation calculation.
Correlation Mean Length : Number of bars for mean and standard deviation calculation.
Std Dev Multiplier : Multiplier for standard deviation to define correlation strength. When the correlation is Std Dev Multiplier standard deviations above the mean, it counts as a strong correlation.
Set Background Color : Toggle background coloring on or off.
Notes
This indicator is primarily designed for trend-following strategies. By combining trend analysis and correlation filtering, it ensures that signals occur during aligned market conditions, reducing false signals.
Before incorporating this indicator into your trading strategy:
Always backtest on historical data to evaluate its performance before committing capital.
Use proper risk management to control position sizes and mitigate potential losses.
Remember that no indicator guarantees success. I'm quite proud of this one, but it's not the holy grail.
Weighted Average Strength Index (WASI)Weighted Average Strength Index (WASI)
The Weighted Average Strength Index (WASI) is a variation of the standard RSI. It uses the Weighted Moving Average (WMA) instead of the Running Moving Average (RMA), making it more responsive to recent price changes. The hypothesis is that this weighted calculation might better capture momentum shifts, providing traders with more timely insights.
How to Use:
Backtest WASI on your preferred assets and timeframes to evaluate its effectiveness for your strategy.
Use for trend following or mean reversion :
- Overbought/Oversold (OB/OS) levels can signal potential mean-reversion opportunities.
- Midline (50 level) crossovers can be used for trend-following strategies.
- WASI and its moving average (MA) crossovers offer additional trend-following or reversal signals.
Parameters and Their Functions:
WASI Length: Determines the number of periods for WASI calculation. A longer length smooths the indicator but increases lag, while a shorter length makes it more sensitive. (When in doubt, go longer).
Source: The price source for the calculation (e.g., close, open, high, or low).
MA Type: Specifies the type of moving average applied to the WASI (options include SMA, EMA, WMA, HMA, and others).
MA Length: The number of periods for the moving average used on the WASI. Higher will lead to a smoother moving average.
Indicator Features:
Dynamic OB/OS Levels: Default overbought (70) and oversold (30) levels help identify potential reversal zones.
Midline Crossover: WASI crossing above or below the 50 level may indicate a trend shift.
WASI-MA Crossover: Crossovers between WASI and its moving average can signal trend-following or mean-reversion opportunities.
Disclaimer:
This indicator is a tool for analysis and should be used in conjunction with other forms of analysis or confirmation. Past performance does not guarantee future results.
Non-repainting ticker
The objective here is to provide a "non-repainting" source to indicators, meaning being sure that data is stable and will not affect the results, w/o having to make any change into the indicators
To use it :
1- include this "NRT" indicators onto your page : nothing will be displayed, just keep it.
2- as an exemple, when running any other indicator onto this page, and willing to select "close" as a source, just select instead " NRT: close" into source input; your indicator will then run "non-repainting"
Available sources : open, high, low , close, hl2, hlc3, ohlc4, hlcc4
Daily MAs on Intraday ChartsThis is a very simple, yet powerful indicator, for intraday and swing traders.
The indicator plots price levels of key daily moving averages as horizontal lines onto intraday charts.
The key daily moving averages being:
5-day EMA
10-day EMA
21-day EMA
50-day SMA
100-day SMA
200-day SMA
The moving averages above can be toggled on and off to the users liking and different colours selected to show the locations of daily moving average price levels on intraday charts.
Below is a chart of the SPY on the 30-minute timeframe. The black line represents the price level of the SPY's 10-day EMA, and the blue line represents the price level of the SPY's 21-day EMA.
Key daily moving averages like those mentioned above can be areas of support or resistance for major indexes, ETFs, and individual stocks. Therefore, when using multiple timeframe analysis combining daily charts and intraday charts, it's useful to be aware of these key daily moving average levels for potential reversals.
This indicator clearly shows where the key daily moving average price levels are on intraday charts for the chosen ticker symbol, thus helping traders to identify potential points of interest for trading ideas - i.e., going long or pullbacks into key daily moving averages, or short on rallies into key daily moving averages subject to the trader's thoughts at the time.
By using the 'Daily MAs on Intraday Charts' the trader can now have a multi-chart layout and be easily aware of key price levels from daily moving averages when looking at various intraday timeframe charts such as the 1-minute, 5-minute, 15-minute, 30-minute, 1-hour etc. This can be essential information for opening long and short trading ideas.
3 Confirmation BearThe "3 Confirmation Bear" indicator is designed to help traders identify strong bearish market conditions with three key confirmations:
Price Below EMA15:
The price trading below the 15-period Exponential Moving Average (EMA) signals bearish momentum.
RSI Below a Threshold:
The Relative Strength Index (RSI) is below a user-defined threshold (default: 50), confirming a lack of bullish strength and momentum favoring the downside.
Downtrend Confirmation:
The indicator ensures the market is in a downtrend by checking for lower highs and lower lows over a specified lookback period.
Key Features:
Bearish Signals: Displays a red downward-pointing label above the price bar when all three conditions are met, making bearish setups easy to identify.
Customizable Inputs: Traders can adjust the EMA length, RSI threshold, and downtrend lookback period to suit their specific strategies.
Versatile Application: Ideal for short entries, trend validation, or avoiding long trades during bearish conditions.
How to Use:
Use the "3 Confirmation Bear" indicator to:
Confirm Short Trades: Enter bearish trades when the signal aligns with your strategy.
Validate Trends: Ensure a clear downtrend is present before committing to a position.
Filter Trades: Avoid long positions during bearish momentum.
This indicator simplifies decision-making by focusing on high-probability bearish setups. Perfect for day traders, swing traders, and those seeking clear confirmation before entering a trade.
3 Confirmation Bull This script is designed to help traders identify strong bullish conditions by providing a signal when three key confirmations align:
Price is Above the 15-period EMA:
This shows that the price is trading above a short-term average, a sign of bullish momentum.
RSI is Above a Threshold:
The Relative Strength Index (RSI) is used to measure the strength of price movements. When RSI is above the user-defined threshold (default 50), it indicates bullish momentum and avoids overbought zones.
Price is in an Uptrend:
An uptrend is confirmed when there are both higher highs and higher lows over a specified lookback period. This ensures that the price structure supports upward movement.
Key Features:
Visual Alerts: A green label appears below the price bar whenever all three conditions are met, making it easy to spot trading opportunities.
Customizable Settings: Adjust the EMA length, RSI threshold, and uptrend lookback period to match your trading style or timeframe.
Versatility: Suitable for intraday, swing, or positional trading in trending markets.
How to Use:
This indicator is ideal for traders looking to confirm a bullish setup. Use it to:
Enter Trades: As confirmation for long positions when the signal appears.
Validate Trends: Ensure conditions are favorable before committing to a trade.
Combine with Other Strategies: Enhance your trading system by pairing it with volume analysis, candlestick patterns, or support/resistance levels.
By combining these three confirmations, the script helps traders filter out false signals and focus on higher-probability setups, streamlining their decision-making process.