MACD-Based Strategy inspired by Saud and ShakyaThis strategy uses the classic MACD crossover approach to generate buy and sell signals:
- Buy Signal: Triggered when the MACD Line crosses above the Signal Line, indicating bullish momentum.
- Sell Signal: Triggered when the MACD Line crosses below the Signal Line, signaling bearish momentum.
The strategy is based on research by Arjun Singh Saud and Subarna Shakya (2024), which highlights the MACD's effectiveness in predicting trading signals. Their work explores enhancing classical MACD signals using machine learning models to reduce false signals and improve decision-making accuracy. While this implementation focuses on the traditional crossover logic, it serves as a solid foundation for both beginners and experienced traders.
I will enhance the strategy in the future, adding a Stop-Loss management as well as the possibility to take Short positions as their is some potential in it.
This Strategy is the first of a series of strategies I want to publish based on research papers, so if you are interested in seeing more scientificaly researched strategies being brought into day light give me a follow.
Göstergeler ve stratejiler
Bedtime BackgroundJust a simple script to indicate when we wont be able to trade, a little help for manual backtesting to get more accurate results
WaveTrend Ignacio indicador de compra y venta simple, para mediano a largo plazo, con sobre compra y sobre venta como factor de explicacion
Long/Short - Juju & JojôFuncionalidades:
Sinais de Compra ("Long"): Gerados quando o RSI suavizado cruza acima da banda dinâmica de suporte.
Sinais de Venda ("Short"): Gerados quando o RSI suavizado cruza abaixo da banda dinâmica de resistência.
Alertas Integrados: Notificações automáticas ao identificar sinais de compra ou venda.
Personalização: Parâmetros ajustáveis para o RSI, suavização, sensibilidade do QQE e limiar de volatilidade.
Last Candle Close Above/Below AlertHow it works:
The script calculates whether the close of each candle is above or below the close of the previous candle, same as the initial code.
isLastBar is checked and the last candle to be created is the only one that will receive the condition from this variable.
If a highlight is needed it will use this criteria and apply the correct color for the last candle only, and any other candle will not be colored.
If alerts are enabled they will only work for the last bar too.
How to Use:
Add this script to your TradingView chart.
Use the inputs to set the desired timeframe to analyze, whether you want an alert for candles closing above or closing below and the background colors.
The last candle will highlight yellow when the close is higher or lower than the previous candle.
Alerts will be triggered on the last candle if you enable the alert conditions.
Key Features:
Timeframe Selection: You can choose a different timeframe in the settings.
Candle Highlight: Candles that close above or below the previous candle are highlighted in yellow.
Alerts: Alerts are configurable to trigger for "Close Above" or "Close Below" conditions, based on your selection in the settings.
Helicopter Volatility Detector v4This Indicator designed to measure market volatility specifically during reversal phases, while ignoring periods of strong trending movements. It helps traders identify when the market is experiencing frequent and significant price reversals, which are often accompanied by increased volatility.
This indicator is suitable for those who want to understand when there is high volatility in the market, such as when Jerome Powell speaks or economic data is released. It can help identify periods when large leveraged positions are likely to be liquidated.
Candle Emotion Index (CEI)The Candle Emotion Index (CEI) is a comprehensive sentiment analysis indicator that combines three sub-oscillators—Indecision Oscillator, Fear Oscillator, and Greed Oscillator—to provide a single, unified measure of market sentiment. By analyzing bullish, bearish, and indecisive candlestick patterns, the CEI delivers a holistic view of market emotions and helps traders identify key turning points.
How It Works
Indecision Oscillator: Measures market uncertainty using Doji and Spinning Top candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Fear Oscillator: Measures bearish sentiment using Shooting Star, Hanging Man, and Bearish Engulfing candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Greed Oscillator: Measures bullish sentiment using Marubozu, Bullish Engulfing, Hammer, and Three White Soldiers candlestick patterns. Scores their presence and normalizes the results over a user-defined lookback period.
Candle Emotion Index Calculation: The CEI is calculated as the average of the Indecision, Fear, and Greed Oscillators: CEI = (Indecision Oscillator + Fear Oscillator + Greed Oscillator) / 3
Plotting: The CEI is plotted as a single line on the chart, representing overall market sentiment.
Reference lines are added to indicate Low Emotion, Neutral, and High Emotion levels.
The Candle Emotion Index provides a unified perspective on market sentiment by blending indecision, fear, and greed into one easy-to-interpret metric. It serves as a powerful tool for traders seeking to gauge market psychology and identify high-probability trading opportunities. For best results, use the CEI in conjunction with other technical indicators to confirm signals.
Greed OscillatorThis Pine Script v6 component calculates and plots a "Greed Oscillator" based on the presence of bullish candlestick patterns (Marubozu, Bullish Engulfing, Hammer, and Three White Soldiers) over a user-defined lookback period.
How It Works:
User Inputs: length - The lookback period for calculating the oscillator, marubozuThreshold - The threshold for identifying Marubozu patterns, engulfingThreshold - The threshold for identifying Bullish Engulfing patterns, hammerThreshold - The threshold for identifying Hammer patterns, threeWhiteSoldiersThreshold - The threshold for identifying Three White Soldiers patterns.
Pattern Detection: The script defines functions to detect Marubozu, Bullish Engulfing, Hammer, and Three White Soldiers patterns. Patterns are identified based on the size of the body, wicks, and specific threshold criteria.
Score Calculation: The script calculates scores for each bullish pattern over the lookback period. These scores are normalized by dividing by the total number of candles in the period.
Greed Oscillator: The oscillator is calculated as the average of the normalized scores for the four bullish patterns.
Plotting: The Greed Oscillator is plotted on the chart, with reference lines for "Low Greed" and "High Greed" levels.
This indicator provides a visual representation of market greed, making it a useful tool for traders to assess bullish sentiment and identify potential reversal points or areas of heightened bullish activity. It works best in conjunction with other technical analysis tools to confirm signals.
Сила быков против силы медведейСила быков против силы медведейвввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввввв
CMO - Dot and Background - Jan 11, 2025This Pine Script indicator is designed to analyze and visualize momentum dynamics using multiple Chande Momentum Oscillator (CMO) lines with different configurations. Here’s a brief breakdown of what it does:
CMO Calculation:
Computes CMO values for multiple lines (Blue, Green, Orange, Purple) based on adjustable lengths, smoothing factors, and scaling values.
Aggregates and smooths these values for better trend representation.
Plotting:
Plots the scaled CMOs as separate lines with distinct colors on the chart.
Highlights momentum differences and includes a zero-line for reference.
Background Coloring:
Changes the chart background color based on specific conditions where the CMOs indicate strong bullish or bearish trends.
Alerts:
Sets up multiple alert conditions for key events, such as when lines cross zero, cross each other, or meet proximity thresholds.
Includes specific "dot" alerts and background-related alerts for visual emphasis.
Labels:
Adds visual markers (dots) on the chart to highlight significant events, such as strong bullish or bearish setups.
Advanced Features:
Includes proximity detection between specific CMOs for tighter momentum analysis.
Implements slope calculations for one of the CMOs to identify trend direction changes.
In essence, this script provides traders with a tool to monitor momentum dynamics, spot potential reversals or trends, and receive actionable alerts. It is highly customizable with adjustable input parameters.
Rolling CAGRRolling CAGR (Compound Annual Growth Rate) Indicator
This indicator calculates and plots the rolling Compound Annual Growth Rate (CAGR) for any selected data source. CAGR represents the mean annual growth rate of an investment over a specified time period, taking into account the effect of compounding.
Features:
• Customizable data source (default: close price)
• Adjustable time period in years
• Configurable trading days per year (252 for stocks, 365 for crypto)
• Results displayed as percentage values
• Works on daily timeframes
Input Parameters:
• Data Source: Select the price or indicator data to analyze
• Number of Years: Set the lookback period for CAGR calculation
• Trading Days in a Year: Adjust based on market type (252 for stocks, 365 for crypto)
Usage:
Perfect for analyzing long-term growth rates and comparing investment performance across different periods. The indicator provides a rolling view of compound growth, helping traders and investors understand the sustained growth rate of an asset over their chosen timeframe.
Note: This indicator is designed for daily timeframes as CAGR calculations are most meaningful over longer periods.
Formula Used:
CAGR = (End Value / Start Value)^(1/number of years) - 1
Fear OscillatorThis Pine Script v6 component calculates and plots a "Fear Oscillator" based on the presence of bearish candlestick patterns (Shooting Star, Hanging Man, and Bearish Engulfing) over a user-defined lookback period.
How It Works:
User Inputs: length - The lookback period for calculating the oscillator, shootingStarThreshold - The threshold for identifying Shooting Star patterns, hangingManThreshold - The threshold for identifying Hanging Man patterns, engulfingThreshold - The threshold for identifying Bearish Engulfing patterns.
Pattern Detection: The script defines functions to detect Shooting Star, Hanging Man, and Bearish Engulfing patterns based on wick and body size ratios. Each pattern is checked for the given thresholds.
Score Calculation: The script calculates scores for each bearish pattern over the lookback period. These scores are normalized by dividing by the total number of candles in the period.
Fear Oscillator: The oscillator is calculated as the average of the normalized scores for the three patterns.
Plotting: The Fear Oscillator is plotted on the chart, with reference lines for "Low Fear" and "High Fear" levels.
This indicator is designed to provide a visual representation of market fear, making it a valuable tool for traders to assess bearish sentiment and identify potential reversal points or areas of heightened market risk. It is best used in conjunction with other technical analysis tools to confirm signals.
Demand Zone FinderSwing Low Detection: The script identifies swing lows using the ta.lowest function over a user-defined period (length).
2. Demand Zone Range: A buffer is added to the swing low price to define the zone range.
3. Drawing Zones: Horizontal lines representing the demand zone are drawn on the chart and extended to the right.
4. Customization: You can adjust the swing length (length) and the buffer percentage (buffer) via inputs.
Indecision OscillatorThis Pine Script v6 component calculates and plots an "Indecision Oscillator" based on the presence of Doji and Spinning Top candlestick patterns over a user-defined lookback period.
Here's how it works:
User Inputs: length - the lookback period for calculating the oscillator, dojiThreshold - the threshold for identifying Doji patterns, spinningTopThreshold - the threshold for identifying Spinning Top patterns.
Pattern Detection: The script defines functions to detect Doji and Spinning Top patterns based on the body size relative to the total range of the candle.
Score Calculation: It calculates scores for Doji and Spinning Top patterns over the specified lookback period and normalizes these scores.
Indecision Oscillator: The oscillator is calculated as the average of the normalized Doji and Spinning Top scores.
Plotting: Only the Indecision Oscillator is plotted on the chart, with reference lines for neutral and indecision levels.
This component provides a visual representation of market indecision, which can be useful for traders looking to identify potential reversal points or periods of consolidation.
Independent Dynamic Trailing Stop Loss %% trailing stop loss lines. Green for long. Red for short trend lines. Default values of 5%,10% and 15% were given. When candle closes below long line, short line starts. when candle closes above short line, long line starts.
Quantitative Breakout Bands (AIBitcoinTrend)Quantitative Breakout Bands (AIBitcoinTrend) is an advanced indicator designed to adapt to dynamic market conditions by utilizing a Kalman filter for real-time data analysis and trend detection. This innovative tool empowers traders to identify price breakouts, evaluate trends, and refine their trading strategies with precision.
👽 What Are Quantitative Breakout Bands, and Why Are They Unique?
Quantitative Breakout Bands combine advanced filtering techniques (Kalman Filters) with statistical measures such as mean absolute error (MAE) to create adaptive price bands. These bands adjust to market conditions dynamically, providing insights into volatility, trend strength, and breakout opportunities.
What sets this indicator apart is its ability to incorporate both position (price) and velocity (rate of price change) into its calculations, making it highly responsive yet smooth. This dual consideration ensures traders get reliable signals without excessive lag or noise.
👽 The Math Behind the Indicator
👾 Kalman Filter Estimation:
At the core of the indicator is the Kalman Filter, a recursive algorithm used to predict the next state of a system based on past observations. It incorporates two primary elements:
State Prediction: The indicator predicts future price (position) and velocity based on previous values.
Error Covariance Adjustment: The process and measurement noise parameters refine the prediction's accuracy by balancing smoothness and responsiveness.
👾 Breakout Bands Calculation:
The breakout bands are derived from the mean absolute error (MAE) of price deviations relative to the filtered trendline:
float upperBand = kalmanPrice + bandMultiplier * mae
float lowerBand = kalmanPrice - bandMultiplier * mae
The multiplier allows traders to adjust the sensitivity of the bands to market volatility.
👾 Slope-Based Trend Detection:
A weighted slope calculation measures the gradient of the filtered price over a configurable window. This slope determines whether the market is trending bullish, bearish, or neutral.
👾 Trailing Stop Mechanism:
The trailing stop employs the Average True Range (ATR) to calculate dynamic stop levels. This ensures positions are protected during volatile moves while minimizing premature exits.
👽 How It Adapts to Price Movements
Dynamic Noise Calibration: By adjusting process and measurement noise inputs, the indicator balances smoothness (to reduce noise) with responsiveness (to adapt to sharp price changes).
Trend Responsiveness: The Kalman Filter ensures that trend changes are quickly identified, while the slope calculation adds confirmation.
Volatility Sensitivity: The MAE-based bands expand and contract in response to changes in market volatility, making them ideal for breakout detection.
👽 How Traders Can Use the Indicator
👾 Breakout Detection:
Bullish Breakouts: When the price moves above the upper band, it signals a potential upward breakout.
Bearish Breakouts: When the price moves below the lower band, it signals a potential downward breakout.
The trailing stop feature offers a dynamic way to lock in profits or minimize losses during trending moves.
👾 Trend Confirmation:
The color-coded Kalman line and slope provide visual cues:
Bullish Trend: Positive slope, green line.
Bearish Trend: Negative slope, red line.
👽 Why It’s Useful for Traders
Dynamic and Adaptive: The indicator adjusts to changing market conditions, ensuring relevance across timeframes and asset classes.
Noise Reduction: The Kalman Filter smooths price data, eliminating false signals caused by short-term noise.
Comprehensive Insights: By combining breakout detection, trend analysis, and risk management, it offers a holistic trading tool.
👽 Indicator Settings
Process Noise (Position & Velocity): Adjusts filter responsiveness to price changes.
Measurement Noise: Defines expected price noise for smoother trend detection.
Slope Window: Configures the lookback for slope calculation.
Lookback Period for MAE: Defines the sensitivity of the bands to volatility.
Band Multiplier: Controls the band width.
ATR Multiplier: Adjusts the sensitivity of the trailing stop.
Line Width: Customizes the appearance of the trailing stop line.
Disclaimer: This indicator is designed for educational purposes and does not constitute financial advice. Please consult a qualified financial advisor before making investment decisions.
DCA_Swing Strategy_YARІнструкція з використання DCA-Based Swing Strategy
Таймфрейм: Рекомендовано 4H або 1D.
Сигнали:
"BUY" – зелена мітка під свічкою (вхід при RSI < 30).
"SELL" – червона мітка над свічкою (тейк-профіт 3 ATR).
Лінії на графіку:
Синя – середня ціна входу.
Зелена пунктирна – тейк-профіт.
Ліміти:
До 4 покупок (Max Entries).
Загальний ризик – $200.
Choppiness IndexThis Pine Script v6 indicator calculates the Choppiness Index over a user-defined length and segments it based on user-defined thresholds for choppy and trending market conditions. The indicator allows users to toggle the visibility of choppy, trending, and neutral segments using checkboxes.
Here's how it works:
Inputs: Users can set the length for the Choppiness Index calculation and thresholds for choppy and trending conditions. They can also choose which segments to display.
Choppiness Index Calculation: The script calculates the Choppiness Index using the ATR and the highest-high and lowest-low over the specified length.
Segment Determination: The script determines which segment the current Choppiness Index value falls into based on the thresholds. The color changes exactly at the threshold values.
Dynamic Plotting: The Choppiness Index is plotted with a color that changes based on the segment. The plot is only visible if the segment is "turned on" by the user.
Threshold Lines: Dashed horizontal lines are plotted at the choppy and trending thresholds for reference.
This indicator helps traders visualize market conditions and identify potential transitions between choppy and trending phases, with precise color changes at the threshold values.
MACD DashboardThe MACD Dashboard is an addition to my collection of various dashboards that are designed to help traders make wiser decisions.
How to Use MACD Dashboard:
Timeframe Selection: Based on your trading style and preferences, choose the relevant timeframes. In the settings, enable or disable timeframes to focus on the most relevant ones for your strategy.
Dashboard Interpretation: The MACD Dashboard displays green (🟢) and red (🔴) symbols to indicate when the MACD is in green or in the red zone. You can also leverage the MACD values on the dashboard to better interpret sentiment and its changes.
Confirmation and Strategy: Consider MACD Dashboard signals as confirmation for your trading strategy. For instance, in an uptrend, look for long opportunities when the dashboard displays consistent green symbols. Conversely, in a downtrend, focus on short opportunities when red symbols dominate.
Risk Management: As with any indicator, use the MACD Dashboard in conjunction with proper risk management techniques. Avoid trading solely based on indicator signals; instead, integrate them into a comprehensive trading plan.
Candles Table in PercentShow table for different timeframes count in percent currant candle from previous. And oscillator for current timeframe.