Color Code Overlay StrategyColor Code Overlay Strategy
This strategy utilizes a custom color-coded overlay to provide accurate buy and sell signals based on dynamic color changes of the candles. The indicator works by calculating a color shift between bullish (green) and bearish (red) candles, with the color change logic driven by both price movement and volatility.
How the Color Change is Calculated:
The color change is determined by comparing the closing price relative to the opening price of each candle, as is typical with a traditional bullish or bearish candle. However, to make this strategy more adaptive to market conditions, the color change is further refined by incorporating the Average True Range (ATR).
Volatility Adjusted Color Shift: The strategy calculates a dynamic threshold based on the ATR value, which represents market volatility. If the price movement between the open and close of the candle exceeds a specific percentage of the ATR, the color of the candle shifts from red (bearish) to green (bullish) or vice versa.
Threshold Calculation: A fixed percentage (e.g., 1%) of the ATR range is used to define the minimum price movement required for a color change. This ensures that only significant price movements, adjusted for volatility, trigger the color shift. The larger the ATR (higher volatility), the greater the price movement required to cause a change in color.
Bullish to Bearish (Green to Red): When the candle closes lower than the open, and the price movement exceeds the dynamic threshold based on ATR, the candle color changes from green to red, signaling a potential bearish reversal.
Bearish to Bullish (Red to Green): When the candle closes higher than the open, and the price movement exceeds the ATR-based threshold, the candle color shifts from red to green, signaling a potential bullish reversal.
Key Features:
Dynamic Color Change: The strategy identifies key color changes from bullish to bearish (green to red) and from bearish to bullish (red to green) based on specific thresholds in candle size.
Customizable Timeframe: You can specify a custom trading window to restrict the strategy’s actions to specific hours of the day.
Stop Loss and Take Profit: The strategy incorporates risk management features, allowing you to set a stop loss and take profit based on the price in pips.
Flexible Trade Types: Choose between "Both" (long and short), "Long Only," or "Short Only" trading options to suit your preferred trading style.
Visual Alerts: Receive visual alerts with arrows when color changes occur, signaling potential trade opportunities. Green arrows indicate a bullish shift, while red arrows show a bearish shift.
This strategy is ideal for traders who prefer a color-coded overlay to easily visualize price action and make informed decisions based on bullish or bearish trends. Whether you’re looking for quick, short-term opportunities or analyzing market reversals, this strategy offers an intuitive approach to identifying trade signals.
Chart patterns
Vertical Lines at Specific Times### **Script Description**
This **Pine Script v6** indicator for **TradingView** plots **vertical dotted lines** at user-specified times, marking key time ranges during the day. It is designed to help traders visually track market movements within specific timeframes.
#### **Features:**
✔ **Custom Timeframes:**
- Two separate time ranges can be defined:
- **Morning Session:** (Default: 9 AM - 10 AM, New York Time)
- **Evening Session:** (Default: 9 PM - 10 PM, New York Time)
✔ **Adjustable Line Properties:**
- **Line Width:** Users can change the thickness of the vertical lines.
- **Line Colors:** Users can select different colors for morning and evening session lines.
✔ **New York Local Time Support:**
- Ensures that the vertical lines appear correctly based on **Eastern Time (ET)**.
✔ **Full-Height Vertical Lines:**
- Lines extend across the **entire chart**, from the highest high to the lowest low, for clear visibility.
- Uses **dotted line style** to avoid cluttering the chart.
#### **How It Works:**
1. The script retrieves the **current date** (year, month, day) in **New York time**.
2. Converts the **user-defined input times** into **timestamps** for accurate placement.
3. When the current time matches a specified session time, a **dotted vertical line** is drawn.
4. The script **repeats this process daily**, ensuring automatic updates.
#### **Customization Options (Inputs):**
- **Morning Start & End Time** (Default: 9 AM - 10 AM)
- **Evening Start & End Time** (Default: 9 PM - 10 PM)
- **Line Width** (Default: 2)
- **Morning Line Color** (Default: Blue)
- **Evening Line Color** (Default: Green)
#### **Use Case Scenarios:**
📈 Marking market **open & close** hours.
📊 Highlighting **key trading sessions** for day traders.
🔎 Identifying time-based **price action patterns**.
Percentage Based ZigZag█ OVERVIEW
The Percentage-Based ZigZag indicator is a custom technical analysis tool designed to highlight significant price reversals while filtering out market noise. Unlike many standard zigzag tools that rely solely on fixed price moves or generic trend-following methods, this indicator uses a configurable percentage threshold to dynamically determine meaningful pivot points. This approach not only adapts to different market conditions but also helps traders distinguish between minor fluctuations and truly significant trend shifts—whether scalping on shorter timeframes or analyzing longer-term trends.
█ KEY FEATURES & ORIGINALITY
Dynamic Pivot Detection
The indicator identifies pivot points by measuring the percentage change from the previous extreme (high or low). Only when this change exceeds a user-defined threshold is a new pivot recognized. This method ensures that only substantial moves are considered, making the indicator robust in volatile or noisy markets.
Enhanced ZigZag Visualization
By connecting significant highs and lows with a continuous line, the indicator creates a clear visual map of price swings. Each pivot point is labelled with the corresponding price and the percentage change from the previous pivot, providing immediate quantitative insight into the magnitude of the move.
Trend Reversal Projections
In addition to marking completed reversals, the script computes and displays potential future reversal points based on the current trend’s momentum. This forecasting element gives traders an advanced look at possible turning points, which can be particularly useful for short-term scalping strategies.
Customizable Visual Settings
Users can tailor the appearance by:
• Setting the percentage threshold to control sensitivity.
• Customizing colors for bullish (e.g., green) and bearish (e.g., red) reversals.
• Enabling optional background color changes that visually indicate the prevailing trend.
█ UNDERLYING METHODOLOGY & CALCULATIONS
Percentage-Based Filtering
The script continuously monitors price action and calculates the relative percentage change from the last identified pivot. A new pivot is confirmed only when the price moves a preset percentage away from this pivot, ensuring that minor fluctuations do not trigger false signals.
Pivot Point Logic
The indicator tracks the highest high and the lowest low since the last pivot. When the price reverses by the required percentage from these extremes, the algorithm:
1 — Labels the point as a significant high or low.
2 — Draws a connecting line from the previous pivot to the current one.
3 — Resets the extreme-tracking for detecting the next move.
Real-Time Reversal Estimation
Building on traditional zigzag methods, the script incorporates a projection calculation. By analyzing the current trend’s strength and recent percentage moves, it estimates where a future reversal might occur, offering traders actionable foresight.
█ HOW TO USE THE INDICATOR
1 — Apply the Indicator
• Add the Percentage-Based ZigZag indicator to your trading chart.
2 — Adjust Settings for Your Market
• Percentage Move – Set a threshold that matches your trading style:
- Lower values for sensitive, high-frequency analysis (ideal for scalping).
- Higher values for filtering out noise on longer timeframes.
• Visual Customization – Choose your preferred colors for bullish and bearish signals and enable background color changes for visual trend cues.
• Reversal Projection – Enable or disable the projection feature to display potential upcoming reversal points.
3 — Interpret the Signals
• ZigZag Lines – White lines trace significant high-to-low or low-to-high movements, visually connecting key swing points.
• Pivot Labels – Each pivot is annotated with the exact price level and percentage change, providing quantitative insight into market momentum.
• Trend Projections – When enabled, projected reversal levels offer insight into where the current trend might change.
4 — Integrate with Your Trading Strategy
• Use the indicator to identify support and resistance zones derived from significant pivots.
• Combine the quantitative data (percentage changes) with your risk management strategy to set optimal stop-loss and take-profit levels.
• Experiment with different threshold settings to adapt the indicator for various instruments or market conditions.
█ CONCLUSION
The Percentage-Based ZigZag indicator goes beyond traditional trend-following tools by filtering out market noise and providing clear, quantifiable insights into price action. With its percentage threshold for pivot detection and real-time reversal projections, this original methodology and customizable feature set offer traders a versatile edge for making informed trading decisions.
Anchor Buy Sell LevelsDaily Validity:
The indicator generates a single horizontal line (either a Buy Level or a Sell Level) that remains valid throughout the entire trading day.
Source of the Signal:
The level (buy or sell) is determined using candles that were generated before the day in question.
Selection Logic:
When determining the level, the indicator checks past candles in descending order (from the most recent backward).
The very first candle encountered that meets the respective logic (either the buy or sell condition) sets the level.
Buy and Sell Logic:
Buy Signal: Generated when a candle’s close is lower than both the previous candle’s close and the next candle’s close (i.e., a local minimum). The Buy Level is drawn at the low of that qualifying candle.
Sell Signal: Generated when a candle’s close is higher than both the previous candle’s close and the next candle’s close (i.e., a local maximum). The Sell Level is drawn at the high of that qualifying candle.
One Signal per Day:
For any given day, the indicator will display either a Buy Level or a Sell Level—not both. The decision is based on which qualifying candle (and its corresponding condition) is found first when scanning the historical data in descending order.
Marubozu and Strong Candle DetectorMarubozu and Strong Candle Detector - Indicator Description
This TradingView Pine Script indicator identifies powerful price action signals by detecting two key candle types that can signal strong market momentum:
What It Detects
1. Marubozu Candles: These are candles with little to no wicks, where the body makes up almost the entire candle. Marubozu means "bald head" or "shaved head" in Japanese, referring to the absence of shadows (wicks).
o Bullish Marubozu: A green/up candle with minimal wicks, showing buyers controlled the entire session
o Bearish Marubozu: A red/down candle with minimal wicks, showing sellers dominated the session
2. Strong Candles: These are candles that are significantly larger than the recent average, suggesting exceptional momentum.
o Strong Bullish: Large green/up candles showing powerful buying pressure
o Strong Bearish: Large red/down candles showing powerful selling pressure
Trading Significance
• Bullish Marubozu/Strong Bullish Candles: Often signal the beginning of bullish trends or strong continuation of existing uptrends. These can be excellent entry points for long positions.
• Bearish Marubozu/Strong Bearish Candles: Often indicate the start of bearish trends or powerful continuation of existing downtrends. These can be good entry points for short positions or exit points for long positions.
Key Features
• Customizable Parameters: Adjust sensitivity for body ratio threshold and size comparison
• Visual Indicators: Easy-to-spot markers appear on your charts
• Information Display: Shows key metrics about the current candle
• Alert System: Set notifications for when significant candles form
How To Use This Indicator
1. For Entry Signals:
o Look for bullish Marubozu/strong bullish candles at support levels or after pullbacks
o Look for bearish Marubozu/strong bearish candles at resistance levels or after rallies
2. For Exit Signals:
o Consider taking profits on long positions when bearish Marubozu/strong bearish candles appear
o Consider taking profits on short positions when bullish Marubozu/strong bullish candles appear
3. For Trend Confirmation:
o Multiple signals in the same direction strengthen the case for a trend
This indicator works best on larger timeframes (1H, 4H, Daily) where candle formations have more significance, but can be applied to any timeframe based on your trading style.
Custom Buy and Sell Signal with Body Ratio and RSI
Indicator Overview:
Name: Custom Buy and Sell Signal with Body Ratio and RSI
Description: This indicator is designed to detect buy and sell opportunities by analyzing the body size and wicks of candles in combination with the RSI indicator and volume. It helps identify trend reversals under high-volume market conditions, which enhances the reliability of the signals.
Indicator Features:
RSI (Relative Strength Index): The RSI indicator is used to assess oversold (RSI < 40) or overbought (RSI > 60) conditions. These zones signal potential reversals when combined with other technical signals.
Candle Body Analysis:
The indicator compares the size of the current and previous candles to validate signals.
For a buy signal, the current candle must be bullish and have a body size proportional to that of the previous bearish candle.
Similarly, for a sell signal, the current candle must be bearish with a body size comparable to the previous bullish candle.
Wick Validation:
The indicator analyzes the wick length to reinforce or exclude signals.
For a buy signal, the lower wick of the bullish candle must be shorter than that of the previous bearish candle.
For a sell signal, the upper wick of the bearish candle must be shorter than that of the previous bullish candle and smaller than 30% of the candle's body.
High Volume:
Signals are only generated when the volume exceeds a certain threshold, ensuring that signals are issued in active market conditions.
The minimum volume should be adjusted based on the asset. For example, for gold, a minimum volume of 9000 is recommended.
Trading Strategy:
Buy Signals:
A bearish (red) candle is followed by a bullish (green) candle with a body size that is comparable to the previous candle (0.9 to 3 times the body size).
The lower wick of the bullish candle is shorter than that of the previous bearish candle, confirming the validity of the signal.
The RSI must be below 40, indicating an oversold condition.
The volume must exceed the defined threshold (e.g., > 9000 for gold) to confirm an active market.
Sell Signals:
A bullish (green) candle is followed by a bearish (red) candle with a comparable body size.
The upper wick of the bearish candle must be shorter than that of the previous bullish candle and must not exceed 30% of the body size.
The RSI must be above 60, indicating an overbought condition.
The volume must also exceed the minimum threshold for a valid signal.
Usage Guidelines:
Volume Adjustment: It is crucial to adjust the volume threshold depending on the asset you're trading. For example, for assets like gold, a minimum volume of 9000 is recommended to filter out weak signals. Each asset has a different volume dynamic, so test different thresholds on historical data to find the optimal setting.
Time Frame:
It is recommended to use this indicator on a 1-hour (1H) chart for the best signal relevance. This time frame provides a good balance between reactivity and filtering false signals.
Confluence:
Combine the signals from this indicator with other tools like support and resistance levels, moving averages, or chart patterns to increase your chances of success. Confluence of indicators improves the reliability of signals.
Risk Management:
Implement strict risk management. Use stop-losses based on volatility, such as ATR (Average True Range), or the wick size to determine exit points.
Backtesting:
Before using it live, conduct backtesting on various assets to fine-tune the parameters, especially the volume threshold, and to verify performance across different market conditions.
This indicator is an excellent tool for traders looking to identify trend reversals based on solid technical criteria such as RSI, candle structure, and volume. It is particularly effective on volatile assets with precise volume adjustment.
Multi-Ticker RS vs SPYThis Pine Script, titled "Multi-Ticker RS vs SPY," is a clean and efficient indicator designed for TradingView, enabling traders to monitor the relative strength (RS) of up to 10 ticker symbols compared to the S&P 500 ETF (SPY) on a single chart. Ideal for options traders, such as those managing a $1,400 account, it provides a simple way to assess which stocks are outperforming or underperforming the broader market. As of February 26, 2025, the script supports any chart timeframe, such as 5-minute or daily intervals, and calculates RS based on a user-defined lookback period, defaulting to 1 bar for real-time insights.
Users can input ticker symbols via customizable settings, with defaults set to popular stocks like AAPL, TSLA, NVDA, GOOGL, AMZN, MSFT, FB, NFLX, INTC, and PYPL. The script fetches closing prices for each ticker and SPY, computes their percentage changes over the lookback period, and determines RS as the ratio of each ticker’s change to SPY’s change, handling division by zero gracefully. It displays each ticker’s current RS score in a vertical column of labels on the chart’s top-left corner, updated on the last bar to avoid clutter. Users can adjust label size (tiny, small, normal, large) and text color for visibility, ensuring a tailored, error-free experience for quick market analysis.
Mile Runner - Swing Trade LONGMile Runner - Swing Trade LONG Indicator - By @jerolourenco
Overview
The Mile Runner - Swing Trade LONG indicator is designed for swing traders who focus on LONG positions in stocks, BDRs (Brazilian Depositary Receipts), and ETFs. It provides clear entry signals, stop loss, and take profit levels, helping traders identify optimal buying opportunities with a robust set of technical filters. The indicator is optimized for daily candlestick charts and combines multiple technical analysis tools to ensure high-probability trades.
Key Features
Entry Signals: Visualized as green triangles below the price bars, indicating a potential LONG entry.
Stop Loss and Take Profit Levels: Automatically plotted on the chart for easy reference.
Stop Loss: Based on the most recent pivot low (support level).
Take Profit: Calculated using a Fibonacci-based projection from the entry price to the stop loss.
Trend and Momentum Filters: Ensures trades align with the prevailing trend and have sufficient momentum.
Volume and Volatility Confirmation: Verifies market interest and price movement potential.
How It Works
The indicator uses a combination of technical tools to filter and confirm trade setups:
Exponential Moving Averages (EMAs):
A short EMA (default: 9 periods) and a long EMA (default: 21 periods) identify the trend.
A bullish crossover (EMA9 crosses above EMA21) signals a potential upward trend.
Money Flow Index (MFI):
Confirms buying pressure when MFI > 50.
Average True Range (ATR):
Ensures sufficient volatility by checking if ATR exceeds its 20-period moving average.
Volume:
Confirms market interest when volume exceeds its 20-period moving average.
Pivot Lows:
Identifies recent support levels (pivot lows) to set the stop loss.
Ensures the pivot low is recent (within the last 10 bars by default).
Additional Trend Filter:
Confirms the long EMA is rising, reinforcing the bullish trend.
Inputs and Customization
The indicator is highly customizable, allowing traders to tailor it to their strategies:
EMA Periods: Adjust the short and long EMA lengths.
ATR and MFI Periods: Modify lookback periods for volatility and momentum.
Pivot Lookback: Control the sensitivity of pivot low detection.
Fibonacci Level: Adjust the Fibonacci retracement level for take profit.
Take Profit Multiplier: Fine-tune the aggressiveness of the take profit target.
Max Pivot Age: Set the maximum bars since the last pivot low for relevance.
Usage Instructions
Apply the Indicator:
Add the "Mile Runner - Swing Trade LONG" indicator to your TradingView chart.
Best used on daily charts for swing trading.
Look for Entry Signals:
A green triangle below the price bar signals a potential LONG entry.
Set Stop Loss and Take Profit:
Stop Loss: Red dashed line indicating the stop loss level.
Take Profit: Purple dashed line showing the take profit level.
Monitor the Trade:
The entry price is marked with a green dashed line for reference.
Adjust trade management based on the plotted levels.
Set Alerts:
Use the built-in alert condition to get notified of new LONG entry signals.
Important Notes
For LONG Positions Only : Designed exclusively for swing trading LONG positions.
Timeframe: Optimized for daily charts but can be tested on other timeframes.
Asset Types: Works best with stocks, BDRs, and ETFs.
Risk Management: Always align stop loss and take profit levels with your risk tolerance.
Why Use Mile Runner?
The Mile Runner indicator simplifies swing trading by integrating trend, momentum, volume, and volatility filters into one user-friendly tool. It helps traders:
Identify high-probability entry points.
Establish clear stop loss and take profit levels.
Avoid low-volatility or low-volume markets.
Focus on assets with strong buying pressure and recent support.
By following its signals and levels, traders can make informed decisions and enhance their swing trading performance. Customize the inputs and test it on your favorite assets—happy trading!
Breakout and Retest Signals [AlgoAlpha]OVERVIEW
This script detects breakout and retest signals by identifying key pivot points in price action and analyzing their relationship with historical swing highs and lows. It highlights breakout structures using ATR-based tolerance levels and volume analysis to confirm potential trend continuations or reversals. The script marks significant price levels with dynamic boxes and dashed lines to help traders visualize breakout and retest areas effectively.
CONCEPTS
The script relies on pivot point analysis, a technique used to identify significant price levels where the market has previously reversed. It dynamically tracks a set number of recent swing highs and lows, allowing traders to see if the price is revisiting a previously significant level. The concept of breakouts and retests is widely used in technical analysis to determine potential entry points. A breakout occurs when the price moves beyond a resistance or support level, and a retest happens when the price returns to test that level before continuing in the breakout direction. This script enhances that analysis by incorporating ATR-based tolerance levels, ensuring that price zones are not too large.
FEATURES
Breakout and Retest Markings : Highlights breakout and retest areas with shaded boxes, allowing traders to visualize where price action is confirming key levels.
Volume Delta and Ratio : Analyzes volume at breakout levels to gauge the strength of the move, displaying volume delta information for additional context. The script also displays the ratio of selling to buying at the retest along traders to make better judgement on their entries.
Multi-Timeframe Adaptability : Dynamically adjusts volume analysis to align with the appropriate lower timeframe, ensuring reliable volume comparisons.
Alerts for Breakout and Retest Events : Traders can receive real-time notifications when bullish or bearish breakout retests are detected.
USAGE
This script is best suited for traders looking to identify strong breakout and retest setups across different timeframes. Users can customize the pivot detection period and swing point memory to adjust sensitivity based on their trading style. The ATR length and multiplier allow further refinement of breakout tolerance, reducing noise in volatile markets. The breakout zones are displayed as shaded boxes, where traders can assess whether a price retest is occurring under favorable conditions. Alerts can be set to notify traders of potential trade opportunities.
Impulse MACD enhancedThis indicator is designed to provide robust trade entry signals by combining multiple technical filters. Here’s a summary of its key components:
Impulse MACD Calculation:
Uses a Zero-Lag EMA (ZLEMA) based approach to generate a momentum indicator (with a signal line and histogram) that identifies shifts in market momentum.
Simulated Higher Timeframe (HTF) Trend Filter:
Computes an SMA over a multiplied period to simulate a higher timeframe trend. It requires the price to be in line with this broader trend before signaling an entry.
RSI Filter:
Ensures that for bullish entries the RSI is above a set threshold (indicating momentum) and for bearish entries it’s below a threshold.
ADX Filter:
Uses a manually calculated ADX to confirm that the market is in a strong trend (ADX > 30) to reduce false signals in weakly trending or sideways markets.
Volume Filter:
Compares the current volume to a 20‑bar SMA of volume, requiring volume to be significantly higher (by a user-defined percentage) to confirm the strength of the move.
VWAP Confirmation:
Uses the Volume-Weighted Average Price as an extra layer of confirmation: bullish signals require the price to be above VWAP, bearish signals below.
Optional Long-Term & Short-Term MA Filters:
These filters can be enabled to ensure the price is trading above (or below) longer-term and shorter-term moving averages, further aligning the trade with the prevailing trend.
ATR Volatility Filter:
Checks that volatility (as measured by the ATR relative to price) is below a maximum threshold, which helps avoid taking trades in overly volatile conditions.
Price Action Filter:
Ensures that for a bullish signal the current close is above the highest high over a specified lookback period (and vice versa for bearish), indicating a clear breakout.
Signal Throttling:
Signals are limited to one every 10 bars to prevent excessive trading.
When all these conditions are met, the indicator outputs an entry signal for either a bullish or bearish trade.
This multi-filter approach aims to increase win rate by reducing false signals and aligning trades with strong, confirmed trends while filtering out noise.
[COG]TMS Crossfire 🔍 TMS Crossfire: Guide to Parameters
📊 Core Parameters
🔸 Stochastic Settings (K, D, Period)
- **What it does**: These control how the first stochastic oscillator works. Think of it as measuring momentum speed.
- **K**: Determines how smooth the main stochastic line is. Lower values (1-3) react quickly, higher values (3-9) are smoother.
- **D**: Controls the smoothness of the signal line. Usually kept equal to or slightly higher than K.
- **Period**: How many candles are used to calculate the stochastic. Standard is 14 days, lower for faster signals.
- **For beginners**: Start with the defaults (K:3, D:3, Period:14) until you understand how they work.
🔸 Second Stochastic (K2, D2, Period2)
- **What it does**: Creates a second, independent stochastic for stronger confirmation.
- **How to use**: Can be set identical to the first one, or with slightly different values for dual confirmation.
- **For beginners**: Start with the same values as the first stochastic, then experiment.
🔸 RSI Length
- **What it does**: Controls the period for the RSI calculation, which measures buying/selling pressure.
- **Lower values** (7-9): More sensitive, good for short-term trading
- **Higher values** (14-21): More stable, better for swing trading
- **For beginners**: The default of 11 is a good balance between speed and reliability.
🔸 Cross Level
- **What it does**: The centerline where crosses generate signals (default is 50).
- **Traditional levels**: Stochastics typically use 20/80, but 50 works well for this combined indicator.
- **For beginners**: Keep at 50 to focus on trend following strategies.
🔸 Source
- **What it does**: Determines which price data is used for calculations.
- **Common options**:
- Close: Most common and reliable
- Open: Less common
- High/Low: Used for specialized indicators
- **For beginners**: Stick with "close" as it's most commonly used and reliable.
🎨 Visual Theme Settings
🔸 Bullish/Bearish Main
- **What it does**: Sets the overall color scheme for bullish (up) and bearish (down) movements.
- **For beginners**: Green for bullish and red for bearish is intuitive, but choose any colors that are easy for you to distinguish.
🔸 Bullish/Bearish Entry
- **What it does**: Colors for the entry signals shown directly on the chart.
- **For beginners**: Use bright, attention-grabbing colors that stand out from your chart background.
🌈 Line Colors
🔸 K1, K2, RSI (Bullish/Bearish)
- **What it does**: Controls the colors of each indicator line based on market direction.
- **For beginners**: Use different colors for each line so you can quickly identify which line is which.
⏱️ HTF (Higher Timeframe) Settings
🔸 HTF Timeframe
- **What it does**: Sets which higher timeframe to use for filtering (e.g., 240 = 4 hour chart).
- **How to choose**: Should be at least 4x your current chart timeframe (e.g., if trading on 15min, use 60min or higher).
- **For beginners**: Start with a timeframe 4x higher than your trading chart.
🔸 Use HTF Filter
- **What it does**: Toggles whether the higher timeframe filter is applied or not.
- **For beginners**: Keep enabled to reduce false signals, especially when learning.
🔸 HTF Confirmation Bars
- **What it does**: How many bars must confirm a trend change on higher timeframe.
- **Higher values**: More reliable but slower to react
- **Lower values**: Faster signals but more false positives
- **For beginners**: Start with 2-3 bars for a good balance.
📈 EMA Settings
🔸 Use EMA Filter
- **What it does**: Toggles price filtering with an Exponential Moving Average.
- **For beginners**: Keep enabled for better trend confirmation.
🔸 EMA Period
- **What it does**: Length of the EMA for filtering (shorter = faster reactions).
- **Common values**:
- 5-13: Short-term trends
- 21-50: Medium-term trends
- 100-200: Long-term trends
- **For beginners**: 5-10 is good for short-term trading, 21 for swing trading.
🔸 EMA Offset
- **What it does**: Shifts the EMA forward or backward on the chart.
- **For beginners**: Start with 0 and adjust only if needed for visual clarity.
🔸 Show EMA on Chart
- **What it does**: Toggles whether the EMA appears on your main price chart.
- **For beginners**: Keep enabled to see how price relates to the EMA.
🔸 EMA Color, Style, Width, Transparency
- **What it does**: Customizes how the EMA line looks on your chart.
- **For beginners**: Choose settings that make the EMA visible but not distracting.
🌊 Trend Filter Settings
🔸 Use EMA Trend Filter
- **What it does**: Enables a multi-EMA system that defines the overall market trend.
- **For beginners**: Keep enabled for stronger trend confirmation.
🔸 Show Trend EMAs
- **What it does**: Toggles visibility of the trend EMAs on your chart.
- **For beginners**: Enable to see how price moves relative to multiple EMAs.
🔸 EMA Line Thickness
- **What it does**: Controls how the thickness of EMA lines is determined.
- **Options**:
- Uniform: All EMAs have the same thickness
- Variable: Each EMA has its own custom thickness
- Hierarchical: Automatically sized based on period (longer periods = thicker)
- **For beginners**: "Hierarchical" is most intuitive as longer-term EMAs appear more dominant.
🔸 EMA Line Style
- **What it does**: Sets the line style (solid, dotted, dashed) for all EMAs.
- **For beginners**: "Solid" is usually clearest unless you have many lines overlapping.
🎭 Trend Filter Colors/Width
🔸 EMA Colors (8, 21, 34, 55)
- **What it does**: Sets the color for each individual trend EMA.
- **For beginners**: Use a logical progression (e.g., shorter EMAs brighter, longer EMAs darker).
🔸 EMA Width Settings
- **What it does**: Controls the thickness of each EMA line.
- **For beginners**: Thicker lines for longer EMAs make them easier to distinguish.
🔔 How These Parameters Work Together
The power of this indicator comes from how these components interact:
1. **Base Oscillator**: The stochastic and RSI components create the main oscillator
2. **HTF Filter**: The higher timeframe filter prevents trading against larger trends
3. **EMA Filter**: The EMA filter confirms signals with price action
4. **Trend System**: The multi-EMA system identifies the overall market environment
Think of it as multiple layers of confirmation, each adding more reliability to your trading signals.
💡 Tips for Beginners
1. **Start with defaults**: Use the default settings first and understand what each element does
2. **One change at a time**: When customizing, change only one parameter at a time
3. **Keep notes**: Write down how each change affects your results
4. **Backtest thoroughly**: Test any changes on historical data before trading real money
5. **Less is more**: Sometimes simpler settings work better than complicated ones
Remember, no indicator is perfect - always combine this with proper risk management and other forms of analysis!
3cfThis indicator identifies and signals the points of swing highs and swing lows on the price chart using an algorithm based on market structure. Local highs and lows are highlighted with a colored dot, making it easier to perform technical analysis and recognize trend reversals.
The indicator analyzes a predefined number of bars (e.g., 5 candles) to determine relative highs and lows:
Swing High (Local High) → The current candle has a higher high compared to the previous and subsequent candle.
Swing Low (Local Low) → The current candle has a lower low compared to the previous and subsequent candle.
When a candle meets one of these conditions, a visual dot is placed to indicate the potential reversal point.
IBS (Internal Bar Strength) Trading Strategy for SPY and NDQImplementation by AlgoTradeKit
Overview
The IBS Trading Strategy is a daily bars long-only trading system, based on the concept of Internal Bar Strength (IBS). The strategy aims to identify potential reversals by monitoring how the previous bar’s close positions itself within its high-low range. It is suitable for stock and US indices. The default parameters are optimized for SPY/SPX and NDQ/QQQ
Strategy Concept
The Internal Bar Strength (IBS) is calculated using the formula:
IBS = (Previous Close - Previous Low) / (Previous High - Previous Low)
This value always lies between 0 and 1. An IBS value below 0.2 is typically interpreted as an oversold condition, while a value above 0.9 suggests an overbought state.
Trading Rules
- Long Entry :
- Condition 1 : IBS is below the user-defined entry threshold (default is 0.2).
- Condition 2 : The current price is above an N-period Exponential Moving Average (EMA) (default period is 252).
- Note : You can disable the EMA condition by setting the EMA period to 0.
- Long Exit
- The position is closed when IBS rises above the user-defined exit threshold (default is 0.9).
Customization Options
- IBS Entry Threshold : Adjust to set the sensitivity for entering a long trade based on oversold conditions.
- IBS Exit Threshold : Customize to define the exit point when the market becomes overbought.
- EMA Period : Set the lookback period for the EMA to align with your trend bias; disable this condition by setting the period to 0.
Risk Management & Trading Considerations
- Designed for daily charts, the strategy captures higher timeframe trends and minimizes noise.
- The entry and exit conditions are straightforward, aiming to avoid over-trading while letting clear signals dictate trade management.
- Always use proper risk management techniques and test the strategy thoroughly on historical data and in a simulated environment before applying it in live markets.
Disclaimer
This strategy is for educational and informational purposes only and does not constitute financial advice. Trading involves risk, and past performance is not indicative of future results. Always conduct your own research and consider your risk tolerance before making any trades.
18:00 Wick Gap Rectangles18:00 wick gaps, the upper and lower wick gaps are marked out on each 18:00 candle with a customization feature to have all 18:00 wick gaps spanning over a certain time period on your chart.
Candle Range-BarsThe Candle Range Bars indicator visually represents the range of each candlestick in either pips or ticks, depending on your preference. It plots vertical bars to show the size of each candle, making it easy to identify periods of high or low volatility. The indicator also displays the exact range value (in pips or ticks) above each bar, with customizable text size and color for better readability.
Key Features
Pips or Ticks Mode:
Choose to display the candle range in pips (for forex traders) or ticks (for other instruments).
Customizable Text:
Adjust the text color and text size (Tiny, Small, Normal, Large) to suit your chart style.
Clear Visuals:
Bars are colored green for bullish candles and red for bearish candles, making it easy to distinguish between up and down moves.
Flexible Use:
Ideal for analyzing volatility, identifying consolidation zones, and comparing candle ranges across different timeframes.
How to Use:
Add the indicator to your chart.
Customize the settings:
Choose between pips or ticks.
Adjust the text color and text size for the range values.
Observe the bars and their corresponding range values to analyze market volatility.
Why Use This Indicator?:
Simplify Range Analysis: Quickly see the size of each candlestick without manual calculations.
Customizable: Tailor the appearance to match your trading style.
Versatile: Works on any instrument and timeframe.
Settings:
Show Pips (Otherwise Ticks): Toggle between pips and ticks mode.
Text Color: Choose the color of the range value text.
Text Size: Select the size of the range value text (Tiny, Small, Normal, Large).
Ideal For:
Forex, stocks, commodities, and crypto traders.
Traders who focus on volatility and range analysis.
Anyone looking for a clear and customizable way to visualize candle ranges.
This description highlights the key features, benefits, and usability of your indicator, making it appealing to other TradingView members. Let me know if you'd like to tweak it further! 😊
AstroTrading_SpecialLevelsOverview
This Pine Script™ (version 5) indicator is designed to detect and mark key price levels using pivot points and Fibonacci extensions. It looks back over a user-defined number of bars to identify significant pivot highs and lows, then searches for specific patterns—either a bullish “dip–peak–dip” or a bearish “peak–dip–peak” formation. Once such a pattern is found, the script calculates Fibonacci-based levels (including STOP, Entry, and multiple target levels) and displays them on the chart with horizontal lines and labels.
Key Components
Input Parameters and Setup:
Bars Settings:
left_bars and right_bars define the number of bars to look left and right when calculating pivots.
lookback determines how many bars back (from the current bar) to search for potential pattern points.
Arrays for Pivot Points:
Two sets of arrays are created to store pivot lows and pivot highs along with their corresponding bar indices.
Pivot Point Calculation:
The script calculates pivot lows using ta.pivotlow(left_bars, right_bars) and pivot highs using ta.pivothigh(left_bars, right_bars).
When a valid pivot is detected (i.e. not na), its bar index (adjusted by right_bars) and value are pushed into the respective arrays.
Filtering by Lookback Period:
The code defines a start (bar_index - lookback) and end bar (bar_index - 1) to limit the search for pattern points.
It filters both pivot low and high arrays so that only points within this historical range are considered.
Pattern Detection – Bullish Formation (Dip–Peak–Dip):
The script searches for a sequence where:
Dip1: A pivot low is found.
Peak: A subsequent pivot high occurs after Dip1.
Dip2: A later pivot low occurs after the Peak.
Once these points are identified, it calculates the difference between the peak and the first dip.
It then creates arrays of Fibonacci multipliers ( ), corresponding level labels ("STOP", "Entry", "1. Target", "2. Target", "3. Target"), and associated colors.
For each multiplier, the price level is computed using the formula:
priceLevel = dip2 + (peak – dip1) × multiplier
Horizontal lines are drawn at these price levels (extending to the right), and labels are placed to show both the level name and its numeric value.
Pattern Detection – Bearish Formation (Peak–Dip–Peak):
If no bullish sequence is found, the script then looks for the opposite pattern:
Peak1: A pivot high.
Dip: A subsequent pivot low after Peak1.
Peak2: A later pivot high after the Dip.
The difference is computed as:
diff = peak1 – dip
Using the same Fibonacci multipliers and labels, the price level is now calculated as:
priceLevel = peak2 – diff × multiplier
Lines and labels are drawn similarly to indicate STOP, Entry, and multiple target levels.
Fallback:
If neither bullish nor bearish patterns are found within the lookback period, the script creates a label on the chart to inform the user that no valid sequence was detected.
Trading Implications
By identifying these patterns and plotting Fibonacci extension levels, the indicator provides traders with potential areas for:
Stops: Price levels where a reversal might occur.
Entry Points: Levels at which to consider initiating a trade.
Targets: One or more levels for taking profits.
Traders can use these levels in conjunction with other technical analysis tools to help time entries and exits more effectively.
This explanation is written to meet TradingView’s guidelines by clearly detailing each part of the script and its purpose without unnecessary commentary.
AstroTrading_DragonCombine1. Table Setup and User Inputs
Table Position and Font Size:
The script begins by asking the user to select a table position (e.g. Top Right) and a font size (Small, Medium, Large, Huge) via input options.
pinescript
Kopyala
positionInput = input.string("Sağ Üst Köşe", title="Tablo Konumu", options= )
fontSizeInput = input.string("Orta", title="Yazı Punto Büyüklüğü", options= )
Table Creation:
A table is created using table.new with 6 rows and 4 columns. The location of the table is determined by the selected input. This table will later display the name, entry, target, and stop levels for each of the five strategies.
2. Variable Declarations
The script defines several persistent variables to store levels for each indicator. These include:
Entry, target, and stop levels for each of the five sub-indicators (labeled as _1, _2, _3, _4, and _5).
Examples include targetLevel_1, fibLow_1, lastEntry_1, lastTarget_1, etc.
3. Indicator 1 – AstroTrading_AlphaBalance
Logic:
This part examines the previous candle’s high and low to compute its range. It then defines two conditions:
conditionUp_1: When the current close exceeds the previous high by at least 50% of the previous range.
conditionDown_1: When the current close falls below the previous low by 50% of the previous range.
Action:
Depending on whether the move is upward or downward, the script sets:
For an upward move:
fibLow_1 is set to the current low.
The entry level is taken as the current high.
The target is computed by taking the high and subtracting –0.786 times the range (this negative multiplier inverts the move).
The stop is set at the previous low.
For a downward move, similar logic applies with reversed roles.
Purpose:
This module generates a primary signal (AlphaBalance) based on extreme candle movements relative to the prior candle’s range.
4. Indicator 2 – AstroTrading_CandleElongation
Higher Timeframe Data:
The script uses the request.security function to obtain high, low, close, and open values from a user-specified timeframe.
Fibonacci Extension Calculation:
A function fiboExtension calculates two Fibonacci extension levels (approximately 0.786 and 1.618 multipliers) based on three price points.
Signal Conditions:
It checks if the previous candle (two bars ago) meets certain criteria relative to its open, and if the current candle’s close confirms an elongation move.
Output:
If conditions are met, the script sets:
candleEntry_2 to the lower Fibonacci level,
candleTarget_2 to the higher Fibonacci extension,
candleStop_2 to the current low (for a bullish setup) or high (for bearish).
Purpose:
This sub-indicator looks to capture significant candle elongation moves by using Fibonacci extension levels to define entry, target, and stop.
5. Indicator 3 – AstroTrading_FlaGama
Similar to a Flag Formation:
Like the previous “FlaGama” indicator, it checks if the current close is more than 50% beyond the previous candle’s high (conditionUp_3) or below the previous low (conditionDown_3).
Bar Coloring:
If either condition is met, the bar is colored orange to signal an extreme move.
Signal Generation:
Depending on the move’s direction:
Bullish Setup:
Calculates a Fibonacci level at 78.6% from the current low to high.
Sets the entry at this Fibonacci level.
The target is computed by adding the difference between the current high and the Fibonacci level to the current high.
The stop is set at the current low.
Bearish Setup:
Mirrors the Fibonacci calculation to derive a level for short entry.
The target is set below the current low, and the stop is at the current high.
Purpose:
The FlaGama section provides confirmation signals when extreme moves occur, helping traders decide on potential reversals.
6. Indicator 4 – AstroTrading_HermDown
EMA Crossover:
An EMA (111-period) is calculated. A crossover of the EMA above the close triggers a “kesilme” (cutoff) event.
First Candle Identification:
Once a crossover is detected, the next candle’s close is monitored. If that candle’s close remains below the cutoff level, it is considered the “first candle” of the HermDown setup.
Fibonacci Retracement:
It then calculates the highest high over the last 30 bars and derives a target level (fibNeg0618_4) at about 48.6% retracement from that high.
Signal Levels:
The entry is the cutoff close, the target is the calculated Fibonacci level, and the stop is the low of the cutoff candle.
Purpose:
This module aims to capture bearish reversals (HermDown) when the price drops sharply below an EMA, using Fibonacci retracement as a guide.
7. Indicator 5 – AstroTrading_HermUp
EMA Crossunder:
Similarly, an EMA (111-period) is used. A crossunder (EMA crossing below the close) signals a potential bullish reversal.
First Candle Confirmation:
The next candle’s close is checked to confirm the move.
Fibonacci Level:
A Fibonacci extension (approximately 61.8% of the distance from the cutoff close to the high) is computed to serve as the target.
Signal Levels:
The entry is set at the cutoff close, the target is the Fibonacci level, and the stop is set at the low.
Purpose:
This section captures bullish reversal signals (HermUp) when the price moves above an EMA.
8. Displaying Levels in a Table
Aggregating Data:
The script gathers the entry, target, and stop levels from all five sub-indicators.
Table Layout:
The table displays five rows (one for each indicator) with four columns:
Indicator name (e.g., “AlphaBalance”, “CandleElongation”, “FlaGama”, “HermDown”, “HermUp”)
Entry level
Target level
Stop level
Color Coding:
Entry cells have a blue background.
Target cells are colored green if above the current close or red if below.
Stop cells are given a gray background.
Purpose:
This consolidated view allows traders to quickly assess all key levels from different strategies on the chart.
Summary
The “AstroTrading_DragonCombine” indicator is a multi-faceted tool that merges five distinct trading setups into one comprehensive display. Each sub-indicator utilizes a unique method—ranging from extreme candle moves and Fibonacci extensions to EMA crossovers—to determine entry, target, and stop levels. These levels are then neatly summarized in a table overlay on the chart. By combining these approaches, traders can gain a broader perspective on market conditions and potential reversal points, enhancing their decision-making process while adhering to sound risk management principles.
This explanation is written to meet TradingView’s script publication standards, providing a clear, objective, and detailed overview of the indicator’s functionality and logic.
AstroTrading_FlaGamaOverview
This Pine Script™ indicator (version 5) is designed to detect a specific “flag formation” pattern based on aggressive price movements relative to the previous candle’s range. When the current candle’s closing price deviates significantly—by at least 50% of the previous candle’s range—above its high or below its low, the script marks the bar in orange. It then attempts to identify a confirmation pattern when a subsequent (second) orange candle appears, and based on the relationship between the closes of the two orange candles, it dynamically plots Fibonacci-based levels along with entry, stop, and target signals for potential long or short trades.
Key Components and Logic
Previous Candle Data Calculation:
prevHigh and prevLow:
The script captures the high and low of the previous bar (high and low ).
prevRange:
The range of the previous candle is computed as the difference between prevHigh and prevLow. This range is later used to calculate the threshold for a significant move.
Defining Significant Price Movements (Orange Bars):
conditionUp:
This condition checks if the current candle’s close is greater than the previous candle’s high plus 50% of the previous range. When true, it indicates a strong bullish move (a “green” scenario, but the indicator colors the bar orange to highlight the extreme move).
conditionDown:
Similarly, this condition checks if the current candle’s close is lower than the previous candle’s low minus 50% of the previous range. When true, it signals a strong bearish move.
barcolor:
If either condition is met, the script colors the bar orange. This visual cue allows traders to easily identify candles that have moved beyond the typical range of the prior session.
Tracking “Orange” Candles:
The script uses persistent (var) variables to store data from the first detected orange candle:
prevOrangeClose, prevOrangeLow, prevOrangeHigh: These hold the closing, low, and high values of the first extreme (orange) candle.
secondOrangeExists: A Boolean flag that is set to true once an orange candle is recorded.
Confirmation and Fibonacci Level Calculation:
When a new (second) orange candle is detected (i.e., when the current candle meets the condition and the flag secondOrangeExists is true), the script differentiates between two scenarios:
Bullish Confirmation (Long Setup):
Condition: The current candle’s close is higher than the first orange candle’s close.
Fibonacci Calculation:
The script calculates a Fibonacci retracement level at 78.6% (0.786) of the range between the current high and low. This level is considered as a potential long entry level.
Visual Elements:
A green dotted line is drawn at the Fibonacci level.
A long target line is plotted above the current high by the distance between the current high and the first orange candle’s low.
Labels are added to indicate the “LONG TARGET,” “LONG STOP” (placed at the first orange candle’s low), and “LONG Entry Level” (the Fibonacci level).
Bearish Confirmation (Short Setup):
Condition: The current candle’s close is lower than the first orange candle’s close.
Fibonacci Calculation:
In this case, the Fibonacci level is calculated in a mirrored manner (using –0.786), suggesting a short entry level.
Visual Elements:
A red dotted line is drawn at the calculated Fibonacci level.
A short target line is plotted below the current low by the distance between the first orange candle’s high and the current low.
Labels are added for “SHORT TARGET,” “SHORT STOP” (placed at the first orange candle’s high), and “SHORT Entry Level.”
Resetting the Indicator State:
If a candle does not meet the extreme move criteria (i.e., not orange), the flag secondOrangeExists is reset. This ensures that the indicator only considers consecutive extreme moves for generating trade signals.
Trading Strategy Implications
This indicator is designed to capture extreme moves that may lead to sharp reversals (either a short squeeze in a bullish scenario or a long squeeze in a bearish one). By:
Highlighting Price Extremes:
The orange bar color quickly alerts traders to significant deviations from the previous candle’s range.
Confirming with Consecutive Moves:
The use of a second extreme candle as a confirmation helps filter out false signals.
Employing Fibonacci Levels:
The dynamic Fibonacci level serves as a logical entry point, while the first extreme candle’s high or low acts as a stop-loss reference. A target level is also plotted based on the measured move.
Traders can integrate this setup into a broader risk management and technical analysis framework to time entries and exits more effectively.
Compliance with TradingView Script Publishing Rules
This explanation adheres to TradingView’s guidelines by clearly stating the functionality, describing each component and its purpose, and ensuring that the explanation is objective, detailed, and does not include promotional language. The script itself is annotated with comments (in both English and Turkish) and uses standard Pine Script™ functions (e.g., indicator(), line.new(), label.new(), etc.) to maintain clarity and reproducibility.
This detailed explanation should help traders understand how the “AstroTrading_FlaGama” indicator works, how it generates signals, and how it might be integrated into a comprehensive trading strategy.
Supertrend with 1% Target and 1% StoplossSupertrend Calculation: The Supertrend indicator is calculated using the Average True Range (ATR) and a factor. The factor and ATR length can be adjusted in the inputs.
Long and Short Conditions: The strategy enters a long position when the price crosses above the Supertrend line and a short position when the price crosses below it.
Target and Stop Loss: The strategy places a 1% target and a 1% stop loss for both long and short positions.
Visuals: The stop loss and take profit levels are plotted on the chart for better visibility.
MH Strategy – Hull Moving Average-Based Trading StrategyThe MH Strategy is a TradingView strategy that leverages the Hull Moving Average (HullMA) to generate precise buy and sell signals. This strategy is designed to identify trend reversals and momentum shifts using a combination of weighted moving averages and HullMA-based calculations.
Key Features:
✅ Hull Moving Average-Based Signals – Uses a modified HullMA calculation to detect trend changes.
✅ Dynamic Support & Resistance – The strategy plots adaptive levels that act as dynamic entry and exit points.
✅ Trend-Based Entries & Exits – Generates long (buy) signals when the price moves above the calculated Hull retraction level and short (sell) signals when the price moves below it.
✅ Automated Trade Execution – Integrates with TradingView’s strategy function to open and close trades automatically based on signal conditions.
✅ Customizable Parameters – Allows users to adjust the HullMA period and price data source to optimize performance across different markets and timeframes.
How It Works:
HullMA Calculation: The strategy calculates a smoothed Hull Moving Average (HullMA) using a two-step weighted moving average method.
Trend Confirmation: The difference between the HullMA values helps determine trend direction and retraction levels.
Entry Conditions:
A buy signal is generated when the price is above the retraction level, and the previous price confirms the trend.
A sell signal is triggered when the price is below the retraction level with trend confirmation.
Exit Conditions:
The strategy closes long trades when the price drops below a threshold.
It closes short trades when the price rises above a set level.
Ideal Use Cases:
🔹 Swing & trend traders looking for momentum-based entries and exits.
🔹 Traders aiming for reduced lag compared to traditional moving averages.
🔹 Markets with strong price trends, such as forex, stocks, and crypto.
Try the MH Strategy and enhance your trading decisions with a refined HullMA-based trend detection system! 🚀
Electronic Trading Hours Session/CandlesThis indicator visually distinguishes the electronic trading session, spanning from the prior day's close (e.g., 5:00 PM EST) through the overnight period until the next day's opening bell (e.g., 9:30 AM EST).
It can be customized to highlight this period with a shaded zone or colored candles depending on the trader’s preference.
The overnight levels that create the opening range gap often act as critical zones of liquidity.
The indicator provides a clear visual cue of potential price magnets that smart money (institutional traders) may target during the opening bell session to trigger liquidity sweeps.
Enhanced Doji Candle StrategyYour trading strategy is a Doji Candlestick Reversal Strategy designed to identify potential market reversals using Doji candlestick patterns. These candles indicate indecision in the market, and when detected, your strategy uses a Simple Moving Average (SMA) with a short period of 20 to confirm the overall market trend. If the price is above the SMA, the trend is considered bullish; if it's below, the trend is bearish.
Once a Doji is detected, the strategy waits for one or two consecutive confirmation candles that align with the market trend. For a bullish confirmation, the candles must close higher than their opening price without significant bottom wicks. Conversely, for a bearish confirmation, the candles must close lower without noticeable top wicks. When these conditions are met, a trade is entered at the market price.
The risk management aspect of your strategy is clearly defined. A stop loss is automatically placed at the nearest recent swing high or low, with a tighter distance of 5 pips to allow for more trading opportunities. A take-profit level is set using a 2:1 reward-to-risk ratio, meaning the potential reward is twice the size of the risk on each trade.
Additionally, the strategy incorporates an early exit mechanism. If a reversal Doji forms in the opposite direction of your trade, the position is closed immediately to minimize losses. This strategy has been optimized to increase trade frequency by loosening the strictness of Doji detection and confirmation conditions while still maintaining sound risk management principles.
The strategy is coded in Pine Script for use on TradingView and uses built-in indicators like the SMA for trend detection. You also have flexible parameters to adjust risk levels, take-profit targets, and stop-loss placements, allowing you to tailor the strategy to different market conditions.
Trend CounterTREND COUNTER is a Trend Exhaustion Indicator that tracks the persistence of price movements over a series of bars, helping traders identify potential trend exhaustion and reversals.
It compares each bar's value (typically the closing price) to a previous bar from a set lookback period (the lookback bar), counting consecutive bullish or bearish price movements.
The count resets when the trend reverses, signaling a potential shift in momentum.
• Price movement is considered bullish if the current price exceeds the lookback bar's price, incrementing the bullish count with each consecutive occurrence.
• Price movement is considered bearish if the current price is lower than the lookback bar's price, incrementing the bearish count with each consecutive occurrence.
• The count resets when the trend reverses.
• The user sets the threshold for sequence resets by defining the maximum number of consecutive occurrences.
• The count may reset before a trend reversal if it surpasses the user-defined threshold.
This type of indicator is useful for detecting trends, trend exhaustion, overbought or oversold conditions, and potential reversal points, helping traders anticipate market turns.
• Sequential occurrences gauge trend strength.
A long sequence of bullish bars suggests strong upward momentum, while consecutive bearish bars indicate sustained downward pressure.
This helps traders assess whether a trend is likely to continue or weaken.
• Identify thresholds for potential reversal points.
Counting consecutive bullish or bearish price movements can highlight overextended trends.
A trend reaching a predefined threshold may signal an upcoming reversal or momentum slowdown.
• Identify potential entry or exit points.
If trends are showing signs of exhaustion after a certain number of consecutive price movements, traders may use this for timing adjustments to their position.
• Assess risk.
Understanding trend strength helps traders better adjust stop-loss or take-profit levels.
Sequential counting provides a structured approach to trade management.
Visualization & Customization
The Sequential Momentum indicator visually represents consecutive bullish or bearish price movements to define trends and highlight key shifts.
• The bullish/bearish bar sequences are based on user-defined thresholds.
• Customizable bar coloring, labels, and plot shapes enhanced trend visualization.
• Dynamic color transitions make trend shifts easily identifiable.
Tracking consecutive bullish or bearish price movements can be effective when combined with other indicators or applied in specific market conditions (e.g., trending or volatile markets).
However, its reliability depends on market conditions and the trader’s interpretation.
This indicator is best used as a complementary tool rather than a standalone signal, helping traders visualize and quantify market momentum within a broader strategy.