Fuzzy SMA Trend Analyzer (experimental)[FibonacciFlux]Fuzzy SMA Trend Analyzer (Normalized): Advanced Market Trend Detection Using Fuzzy Logic Theory
Elevate your technical analysis with institutional-grade fuzzy logic implementation
Research Genesis & Conceptual Framework
This indicator represents the culmination of extensive research into applying fuzzy logic theory to financial markets. While traditional technical indicators often produce binary outcomes, market conditions exist on a continuous spectrum. The Fuzzy SMA Trend Analyzer addresses this limitation by implementing a sophisticated fuzzy logic system that captures the nuanced, multi-dimensional nature of market trends.
Core Fuzzy Logic Principles
At the heart of this indicator lies fuzzy logic theory - a mathematical framework designed to handle imprecision and uncertainty:
// Improved fuzzy_triangle function with guard clauses for NA and invalid parameters.
fuzzy_triangle(val, left, center, right) =>
if na(val) or na(left) or na(center) or na(right) or left > center or center > right // Guard checks
0.0
else if left == center and center == right // Crisp set (single point)
val == center ? 1.0 : 0.0
else if left == center // Left-shoulder shape (ramp down from 1 at center to 0 at right)
val >= right ? 0.0 : val <= center ? 1.0 : (right - val) / (right - center)
else if center == right // Right-shoulder shape (ramp up from 0 at left to 1 at center)
val <= left ? 0.0 : val >= center ? 1.0 : (val - left) / (center - left)
else // Standard triangle
math.max(0.0, math.min((val - left) / (center - left), (right - val) / (right - center)))
This implementation of triangular membership functions enables the indicator to transform crisp numerical values into degrees of membership in linguistic variables like "Large Positive" or "Small Negative," creating a more nuanced representation of market conditions.
Dynamic Percentile Normalization
A critical innovation in this indicator is the implementation of percentile-based normalization for SMA deviation:
// ----- Deviation Scale Estimation using Percentile -----
// Calculate the percentile rank of the *absolute* deviation over the lookback period.
// This gives an estimate of the 'typical maximum' deviation magnitude recently.
diff_abs_percentile = ta.percentile_linear_interpolation(math.abs(raw_diff), normLookback, percRank) + 1e-10
// ----- Normalize the Raw Deviation -----
// Divide the raw deviation by the estimated 'typical max' magnitude.
normalized_diff = raw_diff / diff_abs_percentile
// ----- Clamp the Normalized Deviation -----
normalized_diff_clamped = math.max(-3.0, math.min(3.0, normalized_diff))
This percentile normalization approach creates a self-adapting system that automatically calibrates to different assets and market regimes. Rather than using fixed thresholds, the indicator dynamically adjusts based on recent volatility patterns, significantly enhancing signal quality across diverse market environments.
Multi-Factor Fuzzy Rule System
The indicator implements a comprehensive fuzzy rule system that evaluates multiple technical factors:
SMA Deviation (Normalized): Measures price displacement from the Simple Moving Average
Rate of Change (ROC): Captures price momentum over a specified period
Relative Strength Index (RSI): Assesses overbought/oversold conditions
These factors are processed through a sophisticated fuzzy inference system with linguistic variables:
// ----- 3.1 Fuzzy Sets for Normalized Deviation -----
diffN_LP := fuzzy_triangle(normalized_diff_clamped, 0.7, 1.5, 3.0) // Large Positive (around/above percentile)
diffN_SP := fuzzy_triangle(normalized_diff_clamped, 0.1, 0.5, 0.9) // Small Positive
diffN_NZ := fuzzy_triangle(normalized_diff_clamped, -0.2, 0.0, 0.2) // Near Zero
diffN_SN := fuzzy_triangle(normalized_diff_clamped, -0.9, -0.5, -0.1) // Small Negative
diffN_LN := fuzzy_triangle(normalized_diff_clamped, -3.0, -1.5, -0.7) // Large Negative (around/below percentile)
// ----- 3.2 Fuzzy Sets for ROC -----
roc_HN := fuzzy_triangle(roc_val, -8.0, -5.0, -2.0)
roc_WN := fuzzy_triangle(roc_val, -3.0, -1.0, -0.1)
roc_NZ := fuzzy_triangle(roc_val, -0.3, 0.0, 0.3)
roc_WP := fuzzy_triangle(roc_val, 0.1, 1.0, 3.0)
roc_HP := fuzzy_triangle(roc_val, 2.0, 5.0, 8.0)
// ----- 3.3 Fuzzy Sets for RSI -----
rsi_L := fuzzy_triangle(rsi_val, 0.0, 25.0, 40.0)
rsi_M := fuzzy_triangle(rsi_val, 35.0, 50.0, 65.0)
rsi_H := fuzzy_triangle(rsi_val, 60.0, 75.0, 100.0)
Advanced Fuzzy Inference Rules
The indicator employs a comprehensive set of fuzzy rules that encode expert knowledge about market behavior:
// --- Fuzzy Rules using Normalized Deviation (diffN_*) ---
cond1 = math.min(diffN_LP, roc_HP, math.max(rsi_M, rsi_H)) // Strong Bullish: Large pos dev, strong pos roc, rsi ok
strength_SB := math.max(strength_SB, cond1)
cond2 = math.min(diffN_SP, roc_WP, rsi_M) // Weak Bullish: Small pos dev, weak pos roc, rsi mid
strength_WB := math.max(strength_WB, cond2)
cond3 = math.min(diffN_SP, roc_NZ, rsi_H) // Weakening Bullish: Small pos dev, flat roc, rsi high
strength_N := math.max(strength_N, cond3 * 0.6) // More neutral
strength_WB := math.max(strength_WB, cond3 * 0.2) // Less weak bullish
This rule system evaluates multiple conditions simultaneously, weighting them by their degree of membership to produce a comprehensive trend assessment. The rules are designed to identify various market conditions including strong trends, weakening trends, potential reversals, and neutral consolidations.
Defuzzification Process
The final step transforms the fuzzy result back into a crisp numerical value representing the overall trend strength:
// --- Step 6: Defuzzification ---
denominator = strength_SB + strength_WB + strength_N + strength_WBe + strength_SBe
if denominator > 1e-10 // Use small epsilon instead of != 0.0 for float comparison
fuzzyTrendScore := (strength_SB * STRONG_BULL +
strength_WB * WEAK_BULL +
strength_N * NEUTRAL +
strength_WBe * WEAK_BEAR +
strength_SBe * STRONG_BEAR) / denominator
The resulting FuzzyTrendScore ranges from -1 (strong bearish) to +1 (strong bullish), providing a smooth, continuous evaluation of market conditions that avoids the abrupt signal changes common in traditional indicators.
Advanced Visualization with Rainbow Gradient
The indicator incorporates sophisticated visualization using a rainbow gradient coloring system:
// Normalize score to for gradient function
normalizedScore = na(fuzzyTrendScore) ? 0.5 : math.max(0.0, math.min(1.0, (fuzzyTrendScore + 1) / 2))
// Get the color based on gradient setting and normalized score
final_color = get_gradient(normalizedScore, gradient_type)
This color-coding system provides intuitive visual feedback, with color intensity reflecting trend strength and direction. The gradient can be customized between Red-to-Green or Red-to-Blue configurations based on user preference.
Practical Applications
The Fuzzy SMA Trend Analyzer excels in several key applications:
Trend Identification: Precisely identifies market trend direction and strength with nuanced gradation
Market Regime Detection: Distinguishes between trending markets and consolidation phases
Divergence Analysis: Highlights potential reversals when price action and fuzzy trend score diverge
Filter for Trading Systems: Provides high-quality trend filtering for other trading strategies
Risk Management: Offers early warning of potential trend weakening or reversal
Parameter Customization
The indicator offers extensive customization options:
SMA Length: Adjusts the baseline moving average period
ROC Length: Controls momentum sensitivity
RSI Length: Configures overbought/oversold sensitivity
Normalization Lookback: Determines the adaptive calculation window for percentile normalization
Percentile Rank: Sets the statistical threshold for deviation normalization
Gradient Type: Selects the preferred color scheme for visualization
These parameters enable fine-tuning to specific market conditions, trading styles, and timeframes.
Acknowledgments
The rainbow gradient visualization component draws inspiration from LuxAlgo's "Rainbow Adaptive RSI" (used under CC BY-NC-SA 4.0 license). This implementation of fuzzy logic in technical analysis builds upon Fermi estimation principles to overcome the inherent limitations of crisp binary indicators.
This indicator is shared under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.
Remember that past performance does not guarantee future results. Always conduct thorough testing before implementing any technical indicator in live trading.
Scalping
MACD Volume Strategy (BBO + MACD State, Reversal Type)Overview
MACD Volume Strategy (BBO + MACD State, Reversal Type) is a momentum-based trading strategy designed to capture trend reversals with precision. It combines MACD crossover logic with volume confirmation to filter out false signals and ride strong moves with confidence.
Strategy Objectives
Detect early trend transitions with high accuracy
Filter entries using volume dynamics to confirm strength
Maintain full exposure using a reversal (flip) model
Enforce a 1:1.5 risk-to-reward ratio per trade
Key Features
Integrated MACD + volume-based entry filtering
Zero repainting logic (entries are confirmed on closed bars)
Auto-reverse mechanism for seamless directional transitions
SL/TP dynamically calculated from recent highs/lows
Trading Rules
Long Entry Conditions
MACD crosses above the zero line (BBO Buy arrow)
Volume oscillator is positive (short EMA > long EMA)
MACD is above the signal line
Close any existing short position, enter a new long
Short Entry Conditions
MACD crosses below the zero line (BBO Sell arrow)
Volume oscillator is positive
MACD is below the signal line
Close any existing long position, enter a new short
Exit Rules
Take Profit (TP): Entry ± (risk distance × 1.5)
Stop Loss (SL): Recent swing low (long) or swing high (short)
Early Exit: Triggered by reverse signal via flip logic
Risk Management Parameters
Pair: EUR/USD
Timeframe: 10-minute
Starting Capital: $7,000
Commission: 1 pip (round-trip)
Slippage: 1 pip
Risk per Trade: 10% of account equity (adjustable)
Total Trades: 385 (backtest)
Parameters & Configurations
MACD Type: Selectable (SMA or EMA for both source & signal)
MACD Periods: Fast = 11, Slow = 21, Signal = 10
Volume Oscillator: Short = 6, Long = 12
Risk-Reward: Fixed at 1:1.5
Swing Points: Based on last 10 bars' highs and lows
Visual Support
Green arrow: Long entry
Red arrow: Short entry
MACD + Signal lines with histogram
SL/TP levels plotted on the chart via exit markers
Strategic Advantages & Uniqueness
Volume filtering cuts out weak/low-participation signals
Market-structure-based SL/TP improves technical alignment
No repainting — all decisions are based on closed candle data
Reversal model ensures the strategy is always in the market
Inspirations & Attribution
This strategy is inspired by the outstanding work of the following creators:
Bitcoinblockchainonline – “BBO_Roxana_Signals MACD + vol”
Leveraging a smart combination of MACD zero-line cross and volume oscillator for highly intuitive signals. The BBO "arrow logic" is used as the primary trigger here.
HasanRifat – “MACD Fake Filter ”
Known for introducing a smart MACD signal filter based on average wave height. This concept has been incorporated to strengthen signal reliability and reduce noise.
Respect and gratitude to both authors.
This strategy is an evolution of their brilliant ideas into a more automated, risk-managed, and technically adaptive system.
Summary
MACD Volume Strategy is a sharp, structure-respecting, momentum-confirming automated system designed for traders who want logic-first entries without any lag or noise.
100% mechanical — no discretion needed
Built for traders who demand precision
Works as-is or can be further customized with session filters, alerts, or trailing stops
Highest High Line with Multi-Timeframe Supertrend and RSIOverview:
This powerful indicator combines three essential elements for traders:
Highest High Line – Tracks the highest price over a customizable lookback period across different timeframes.
Multi-Timeframe Supertrend – Displays Supertrend values and trend directions for multiple timeframes simultaneously.
Relative Strength Index (RSI) – Shows RSI values across different timeframes for momentum analysis.
Features:
✅ Customizable Highest High Line:
Selectable timeframes: Daily, Weekly, Monthly, Quarterly, Yearly
Adjustable lookback period
✅ Multi-Timeframe Supertrend:
Supports 1min, 5min, 10min, 15min, 30min, 1H, Daily, Weekly, Monthly, Quarterly, Yearly
ATR-based calculation with configurable ATR period and multiplier
Identifies bullish (green) & bearish (red) trends
✅ Multi-Timeframe RSI:
Calculates RSI for the same timeframes as Supertrend
Overbought (≥70) and Oversold (≤30) signals with color coding
✅ Comprehensive Table Display:
A clean, structured table in the bottom-right corner
Displays Supertrend direction, value, and RSI for all timeframes
Helps traders quickly assess trend and momentum alignment
How to Use:
Use the Highest High Line to identify key resistance zones.
Confirm trend direction with Multi-Timeframe Supertrend.
Check RSI values to avoid overbought/oversold conditions before entering trades.
Align multiple timeframes for stronger confirmation of trend shifts.
Ideal For:
✅ Scalpers (lower timeframes: 1m–30m)
✅ Swing Traders (higher timeframes: 1H–D)
✅ Position Traders (Weekly, Monthly, Quarterly)
💡 Tip: Look for Supertrend & RSI confluence across multiple timeframes for higher probability setups.
Dual Volume Divergence LineDual Volume Divergence Line (DVD/Line)
🔹 Overview
The Dual Volume Divergence Line (DVD/Line) is a custom Pine Script™ indicator designed to identify potential trend reversals and continuations by analyzing volume and price divergences. This script is inspired by the original concept of the Dual Volume Divergence Index (DVDI) by DonovanWall and has been modified and enhanced by keremertem. Special thanks to DonovanWall for the original concept. The indicator combines volume-based calculations with price action to generate signals for bullish and bearish divergences, both normal and hidden. Below is a detailed breakdown of its components and functionality.
🔹 Key Features of the DVD/Line Indicator
1. Dual Volume Divergence Calculation:
- The indicator calculates two primary volume-based indices: the Positive Volume Index (PVI) and the Negative Volume Index (NVI).
- PVI measures the impact of volume on price when the price increases, while NVI measures the impact when the price decreases.
- These indices are used to detect divergences between volume and price, which can signal potential reversals or continuations.
2. Customizable Inputs:
- DVD Sampling Period: Adjusts the sensitivity of the indicator by controlling the lookback period for calculating the volume-weighted moving averages (VWMA) of PVI and NVI.
- Band Width: Defines the range for calculating the upper and lower bands, which act as dynamic support and resistance levels.
- Source: Allows users to select the price source (e.g., `hlc3`, `close`, etc.) for calculations.
3. Volume-Weighted Moving Averages (VWMA):
- Instead of using traditional moving averages, the script employs VWMA to smooth the PVI and NVI signals. This ensures that the indicator is more responsive to changes in volume.
4. Upper and Lower Bands:
- The upper and lower bands are calculated using the Root Mean Square (RMS) of the highest and lowest values of the DVD line over a user-defined period. These bands help identify overbought and oversold conditions.
5. Divergence Detection:
- The script identifies four types of divergences:
- Normal Bullish Divergence: Occurs when price makes a lower low, but the DVD line makes a higher low.
- Hidden Bullish Divergence: Occurs when price makes a higher low, but the DVD line makes a lower low.
- Normal Bearish Divergence: Occurs when price makes a higher high, but the DVD line makes a lower high.
- Hidden Bearish Divergence: Occurs when price makes a lower high, but the DVD line makes a higher high.
- These divergences are visually highlighted on the chart using labels.
6. Customizable Divergence Selection:
- Users can choose between two types of divergence calculations:
- DVDI: Based on the raw divergence values.
- DVD Line: Based on the smoothed DVD line.
7. Visual Enhancements:
- The DVD line is plotted with a color-coded scheme: blue when the DVD line is above its signal line (bullish) and pink when it is below (bearish).
- The upper and lower bands are displayed as step lines, making it easier to identify key levels.
🔹 How the Indicator Works
1. Volume-Based Calculations:
- The script starts by calculating the PVI and NVI based on the selected price source and volume data.
- PVI increases when the price rises, while NVI decreases when the price falls. These indices are then smoothed using VWMA to generate signals.
2. DVD Line Calculation:
- The DVD line is derived by combining the divergences of PVI and NVI. It is further smoothed using a Weighted Moving Average (WMA) and a linear regression line for trend analysis.
3. Divergence Detection:
- The script identifies pivot points in the DVD line and compares them with price action to detect divergences.
- Normal divergences indicate potential reversals, while hidden divergences suggest trend continuations.
4. Dynamic Bands:
- The upper and lower bands are calculated using RMS, which provides a more accurate representation of volatility compared to standard deviation or fixed-width bands.
5. Labeling:
- Divergences are labeled directly on the chart with clear text and color coding:
🟢 Bullish Divergence: Green label with "Bull".
🟩 Bearish Divergence: Red label with "Bear".
🔴 Hidden Bullish Divergence: Lime label with "hid.".
🟧 Hidden Bearish Divergence: Orange label with "hid.".
🔹 Unique Aspects of This Script
1. Volume-Weighted Smoothing:
- Unlike traditional divergence indicators that rely on simple moving averages, this script uses VWMA and WMA to ensure that volume plays a significant role in signal generation.
2. Dynamic Bands with RMS:
- The use of RMS for calculating bands provides a more adaptive and accurate representation of market conditions, especially in volatile markets.
3. Flexible Divergence Selection:
- Users can choose between raw divergence values (DVDI) or smoothed values (DVD Line), allowing for greater customization based on trading style.
4. Comprehensive Divergence Detection:
- The script detects both normal and hidden divergences, providing a complete picture of potential trend reversals and continuations.
5. User-Friendly Visuals:
- The color-coded DVD line and cross-style bands make it easy to interpret the indicator at a glance.
🔹 How to Use the Indicator
1. Trend Identification:
- Use the Middle Band and its color to identify the current trend. A green line suggests bullish momentum, while a red line indicates bearish momentum. Additionally, a bullish momentum may be indicated when the DVD line crosses up, and a bearish momentum may be indicated when it crosses down the Middle Band.
2. Divergence Trading:
- Look for divergences between the DVD line and price action. Normal divergences can be used for counter-trend trades, while hidden divergences can confirm trend continuations.
3. Band Breakouts:
- Monitor the upper and lower bands for potential breakout or reversal signals. A break above the upper band may indicate overbought conditions, while a break below the lower band may suggest oversold conditions.
4. Customization:
- Adjust the sampling period and band width to suit different timeframes and trading strategies. Shorter periods are more sensitive, while longer periods provide smoother signals.
🔹 Conclusion
The Dual Volume Divergence Line (DVD/Line) is a powerful and versatile indicator that combines volume analysis with price action to generate actionable trading signals. Its unique use of volume-weighted smoothing, dynamic bands, and comprehensive divergence detection sets it apart from traditional divergence indicators. Whether you're a day trader or a long-term investor, this tool can help you identify high-probability trading opportunities with greater accuracy and confidence.
📌 Disclaimer: This script is for educational purposes only and does not constitute financial advice. Always conduct your own analysis before making trading decisions.
Dynamic Buy/Sell VisualizationDynamic Trend Visualization Indicator
Description:
This simple and easy to use indicator has helped me stay in trades longer.
This indicator is designed to visually represent potential buy and sell signals based on the crossover of two Simple Moving Averages (SMA). It's crafted to assist traders in identifying trend directions in a straightforward manner, making it an excellent tool for both beginners and experienced traders.
Features:
Customizable Moving Averages: Users can adjust the period length for both short-term (default: 10) and long-term (default: 50) SMAs to suit their trading strategy.
Visual Signals: Dynamic lines appear at the points of SMA crossover, with labels to indicate 'BUY' or 'SELL' opportunities.
Color and Style Customization: Customize the appearance of the buy and sell lines for better chart readability.
Alert Functionality: Alerts are set up to notify users when a crossover indicating a buy or sell condition occurs.
How It Works:
A 'BUY' signal is generated when the short-term SMA crosses above the long-term SMA, suggesting an upward trend.
A 'SELL' signal is indicated when the short-term SMA crosses below the long-term SMA, pointing to a potential downward trend.
Use Cases:
Trend Following: Ideal for markets with clear trends. For example, if trading EUR/USD on a daily chart, setting the short SMA to 10 days and the long SMA to 50 days might help in capturing longer-term trends.
Scalping: In a volatile market, setting shorter periods (e.g., 5 for short SMA and 20 for long SMA) might catch quicker trend changes, suitable for scalping.
Examples of how to use
* Short-term for Quick Trades:
SMA 5 and SMA 21:
Purpose: This combination is tailored for day traders or those looking to engage in scalping. The 5 SMA will react rapidly to price changes, providing early signals for buy or sell opportunities. The 21 SMA, being a Fibonacci number, offers a slightly longer-term view to confirm the short-term trend, helping to filter out minor fluctuations that might lead to false signals.
* Middle-term for Swing Trading:
SMA 10 and SMA 50:
Purpose: Suited for swing traders who aim to capitalize on medium-term trends. The 10 SMA picks up on immediate market movements, while the 50 SMA gives insight into the medium-term direction. This setup helps in identifying when a short-term trend aligns with a longer-term trend, providing a good balance for trades that might last several days to a couple of weeks.
* Long-term Trading:
SMA 50 and SMA 200:
Purpose: Investors focusing on long-term trends would benefit from this pair. The crossover of the 50 SMA over the 200 SMA can indicate the beginning or end of major market trends, ideal for making decisions about long-term holdings that might span months or years.
Example Strategy if not using the Buy / Sell Label Alerts:
Entry Signal: Enter a long position when the shorter SMA crosses above the longer SMA. For example:
SMA 10 crosses above SMA 50 for a medium-term bullish signal.
Exit Signal: Consider exiting or initiating a short position when:
SMA 10 crosses below SMA 50, suggesting a bearish turn in the medium-term trend.
Confirmation: Use these crossovers in conjunction with other indicators like volume or momentum indicators for better confirmation. For instance, if you're using the 5/21 combination, look for volume spikes on crossovers to confirm the move's strength.
When Not to Use:
Sideways or Range-Bound Markets: The indicator might generate many false signals in a non-trending market, leading to potential losses.
High Volatility Without Clear Trends: Rapid price movements without a consistent direction can result in misleading crossovers.
As a Standalone Tool: It should not be used in isolation. Combining with other indicators like RSI or MACD for confirmation can enhance trading decisions.
Practical Example:
Buy Signal: If you're watching Apple Inc. (AAPL) on a weekly chart, a crossover where the 10-week SMA moves above the 50-week SMA could suggest a buying opportunity, especially if confirmed by volume increase or other technical indicators.
Sell Signal: Conversely, if the 10-week SMA dips below the 50-week SMA, it might be time to consider selling, particularly if other bearish signals are present.
Conclusion:
The "Dynamic Trend Visualization" indicator provides a visual aid for trend-following strategies, offering customization and alert features to streamline the trading process. However, it's crucial to use this in conjunction with other analysis methods to mitigate the risks of false signals or market anomalies.
Legal Disclaimer:
This indicator is for educational purposes only. It does not guarantee profits or provide investment advice. Trading involves risk; please conduct thorough or consult with a financial advisor. The creator is not responsible for any losses incurred. By using this indicator, you agree to these terms.
Scalping Entry/Exit Indicator by DiGetImagine having a tool that not only spots high-probability entry signals but also visually marks them on your chart with color-coded cues and automated alerts. The Scalping Entry/Exit Indicator by DiGet does exactly that—by fusing a range of classic candlestick patterns (such as Bullish Hammers, Engulfing patterns, and Morning/Evening Stars) with dynamic risk management levels, this script empowers you to make swift and informed trading decisions. Whether you're an active trader or an algorithm enthusiast, this indicator offers both precision and clarity in identifying scalp opportunities, making your chart analysis more efficient and visually engaging.
Indicator Breakdown
Input Parameters:
The indicator accepts a customizable risk-reward ratio, an ATR period for volatility measurement, and a lookback period to scan for valid candlestick patterns.
ATR & Candle Calculations:
It computes the Average True Range (ATR) to dynamically set stop-loss and take-profit levels. Additionally, it determines the body and wick sizes of each candlestick to help identify key reversal patterns.
Pattern Detection:
Multiple bullish patterns (Hammer, Engulfing, Morning Star) and bearish patterns (Shooting Star, Engulfing, Evening Star) are detected. There’s also a simplified version of the Head & Shoulders pattern, offering further validation for reversal signals.
Signal Generation & Trade Levels:
The script consolidates the pattern signals into combined “buy” and “sell” triggers. It then calculates the respective stop-loss (SL) and take-profit (TP) levels based on the current price and ATR, providing a robust risk management framework.
Visual Aids & Alerts:
To enhance usability, the indicator changes the chart’s background color to green for buy signals and red for sell signals. It also draws labels, lines (representing SL and TP), and markers directly on the chart, along with alert conditions to notify traders of actionable signals.
This indicator is an excellent addition to your TradingView toolkit—ideal for scalpers and short-term traders seeking clarity, precision, and automated signal generation on their charts.
Enjoy trading with confidence and precision!
Quarterly Theory ICT 03 [TradingFinder] Precision Swing Points🔵 Introduction
Precision Swing Point (PSP) is a divergence pattern in the closing of candles between two correlated assets, which can indicate a potential trend reversal. This structure appears at market turning points and highlights discrepancies between the price behavior of two related assets.
PSP typically forms in key timeframes such as 5-minute, 15-minute, and 90-minute charts, and is often used in combination with Smart Money Concepts (SMT) to confirm trade entries.
PSP is categorized into Bearish PSP and Bullish PSP :
Bearish PSP : Occurs when an asset breaks its previous high, and its middle candle closes bullish, while the correlated asset closes bearish at the same level. This divergence signals weakness in the uptrend and a potential price reversal downward.
Bullish PSP : Occurs when an asset breaks its previous low, and its middle candle closes bearish, while the correlated asset closes bullish at the same level. This suggests weakness in the downtrend and a potential price increase.
🟣 Trading Strategies Using Precision Swing Point (PSP)
PSP can be integrated into various trading strategies to improve entry accuracy and filter out false signals. One common method is combining PSP with SMT (divergence between correlated assets), where traders identify divergence and enter a trade only after PSP confirms the move.
Additionally, PSP can act as a liquidity gap, meaning that price tends to react to the wick of the PSP candle, making it a favorable entry point with a tight stop-loss and high risk-to-reward ratio. Furthermore, PSP combined with Order Blocks and Fair Value Gaps in higher timeframes allows traders to identify stronger reversal zones.
In lower timeframes, such as 5-minute or 15-minute charts, PSP can serve as a confirmation for more precise entries in the direction of the higher timeframe trend. This is particularly useful in scalping and intraday trading, helping traders execute smarter entries while minimizing unnecessary stop-outs.
🔵 How to Use
PSP is a trading pattern based on divergence in candle closures between two correlated assets. This divergence signals a difference in trend strength and can be used to identify precise market turning points. PSP is divided into Bullish PSP and Bearish PSP, each applicable for long and short trades.
🟣 Bullish PSP
A Bullish PSP forms when, at a market turning point, the middle candle of one asset closes bearish while the correlated asset closes bullish. This discrepancy indicates weakness in the downtrend and a potential price reversal upward.
Traders can use this as a signal for long (buy) trades. The best approach is to wait for price to return to the wick of the PSP candle, as this area typically acts as a liquidity level.
f PSP forms within an Order Block or Fair Value Gap in a higher timeframe, its reliability increases, allowing for entries with tight stop-loss and optimal risk-to-reward ratios.
🟣 Bearish PSP
A Bearish PSP forms when, at a market turning point, the middle candle of one asset closes bullish while the correlated asset closes bearish. This indicates weakness in the uptrend and a potential price decline.
Traders use this pattern to enter short (sell) trades. The best entry occurs when price retests the wick of the PSP candle, as this level often acts as a resistance zone, pushing price lower.
If PSP aligns with a significant liquidity area or Order Block in a higher timeframe, traders can enter with greater confidence and place their stop-loss just above the PSP wick.
Overall, PSP is a highly effective tool for filtering false signals and improving trade entry precision. Combining PSP with SMT, Order Blocks, and Fair Value Gaps across multiple timeframes allows traders to execute higher-accuracy trades with lower risk.
🔵 Settings
Mode :
2 Symbol : Identifies PSP and PCP between two correlated assets.
3 Symbol : Compares three assets to detect more complex divergences and stronger confirmation signals.
Second Symbol : The second asset used in PSP and correlation calculations.
Third Symbol : Used in three-symbol mode for deeper PSP and PCP analysis.
Filter Precision X Point : Enables or disables filtering for more precise PSP and PCP detection. This filter only identifies PSP and PCP when the base asset's candle qualifies as a Pin Bar.
Trend Effect : By changing the Trend Effect status to "Off," all Pin bars, whether bullish or bearish, are displayed regardless of the current market trend. If the status remains "On," only Pin bars in the direction of the main market trend are shown.
Bullish Pin Bar Setting : Using the "Ratio Lower Shadow to Body" and "Ratio Lower Shadow to Higher Shadow" settings, you can customize your bullish Pin bar candles. Larger numbers impose stricter conditions for identifying bullish Pin bars.
Bearish Pin Bar Setting : Using the "Ratio Higher Shadow to Body" and "Ratio Higher Shadow to Lower Shadow" settings, you can customize your bearish Pin bar candles. Larger numbers impose stricter conditions for identifying bearish Pin bars.
🔵 Conclusion
Precision Swing Point (PSP) is a powerful analytical tool in Smart Money trading strategies, helping traders identify precise market turning points by detecting divergences in candle closures between correlated assets. PSP is classified into Bullish PSP and Bearish PSP, each playing a crucial role in detecting trend weaknesses and determining optimal entry points for long and short trades.
Using the PSP wick as a key liquidity level, integrating it with SMT, Order Blocks, and Fair Value Gaps, and analyzing higher timeframes are effective techniques to enhance trade entries. Ultimately, PSP serves as a complementary tool for improving entry accuracy and reducing unnecessary stop-outs, making it a valuable addition to Smart Money trading methodologies.
AO Smart Scalper – 5M Dynamic SL Edition📈 AO Signals with Fixed and Dynamic SL – Optimized for 5-Minute Charts 📉
This indicator is built for 5-minute timeframe trading, combining powerful momentum signals from the Awesome Oscillator (AO) with both Fixed and Dynamic Stop Loss (SL) levels to enhance trade management and risk control.
✅ Buy/Sell Signals:
The indicator generates clear BUY and SELL signals based on the AO crossing above or below the zero line, helping traders capture momentum shifts early.
🛑 Fixed Stop Loss:
Each trade signal comes with a Fixed SL, calculated based on the high (for shorts) or low (for longs) of the previous candle, with a customizable percentage offset. This SL is plotted with a red line, providing a clear initial risk level.
⚡ Dynamic Stop Loss: Continuous Presence, Strategic Use:
A secondary Dynamic SL line is plotted, which is continuously present on the chart. This dynamic level responds to market conditions and can serve as a trailing stop or key decision point.
💡 Recommended Use: It is recommended to actively start using the Dynamic SL once the trade has moved into profit. This allows protecting obtained profits and minimizing the risk of losses in case of a market reversal.
🛡️ Enhanced Dynamic Stop-Loss Strategy:
🔒 Initial Protection: Utilize the Fixed SL as the initial stop-loss, placed below relevant lows (for longs) or above relevant highs (for shorts), or as provided by the fixed SL indicator.
🛤️ Dynamic Tracking:
🟢 Long Trades: Once in profit, the Dynamic SL will dynamically adjust, moving upwards as higher lows are formed, effectively trailing the price and securing profits.
🔴 Short Trades: Conversely, in short trades, once in profit, the Dynamic SL will move downwards as lower highs are formed, protecting gains.
🔄 Alternatively the dynamic stop loss will follow the dynamic SL line provided by the indicator.
🚪 Exiting Trades: When the price crosses below the Dynamic SL line in a LONG trade, or above it in a SHORT trade, the recommended action is to exit the trade.
↩️ Re-entry Consideration: You may consider re-entering only if the price clearly returns above the Dynamic SL (for longs) or below it (for shorts).
⚠️ IMPORTANT - 5-Minute Strategy Guidance ⏱️
This tool is specifically optimized for the 5-minute timeframe. This approach helps filter out weak setups and maintain discipline in volatile market conditions.
✨ Additional Features:
👁️ Visual and editable SL levels
📊 200-period SMA for trend context
💻 Simple and effective interface for intraday trading setups
🎯 Ideal for traders seeking a clean, rule-based system that combines momentum entry signals with layered stop loss protection.
🔑 Key Changes:
It was emphasized that the Dynamic SL is always present, but its active use is recommended once the trade is in profit.
It was clarified the use of the Fixed SL, giving the option to use the one provided by the indicator, or to place it according to the price action.
Uwen FX: UWEN StrategyThis Pine Script defines a trading indicator called "Uwen FX: UWEN Strategy" Where ideas coming from Arab Syaukani and modified by Fiki Hafana. It combines a CCI-based T3 Smoothed Indicator with a MACD overlay. Here's a breakdown of what it does:
Key Components of the Script:
1. CCI (Commodity Channel Index) with T3 Smoothing
Uses a T3 smoothing algorithm on the CCI to generate a smoother momentum signal. The smoothing formula is applied iteratively using weighted averages. The final result (xccir) is plotted as a histogram, colored green for bullish signals and red for bearish signals.
2. MACD (Moving Average Convergence Divergence)
The MACD is scaled to match the range of the smoothed CCI for better visualization. Signal Line and MACD Line are plotted if showMACD is enabled. The normalization ensures that MACD values align with the CCI-based indicator.
3. Bar Coloring for Trend Indication
Green bars indicate a positive trend (pos = 1).
Red bars indicate a negative trend (pos = -1).
Blue bars appear when the trend is neutral.
How It Can Be Used:
Buy Signal: When the xccir (smoothed CCI) turns green, indicating bullish momentum.
Sell Signal: When xccir turns red, indicating bearish momentum.
MACD Confirmation: Helps confirm the trend direction by aligning with xccir.
I will add more interesting features if this indicator seems profitable
Ivan Gomes StrategyIG Signals+ - Ivan Gomes Strategy
This script is designed for scalping and binary options trading, generating buy and sell signals at the beginning of each candle. Although it is mainly optimized for short-term operations, it can also be used for medium and long-term strategies with appropriate adjustments.
How It Works
• The indicator provides buy or sell signals at the start of the candle, based on a statistical probability of candle patterns, depending on the timeframe.
• It is essential to enter the trade immediately after the signal appears and exit at the end of the same candle.
• If the first operation results in a loss (Loss), the script will send another trade signal at the start of the next candle. However, if the first trade results in a win (Gain), no new signal will be generated.
• The signals follow cycles of 3 candles, regardless of the timeframe. However, if a Doji candle appears, the cycle is interrupted, and no signals will be generated until the next valid cycle starts.
• The strategy consists of up to two trades per cycle: if the first trade is not successful, the second trade serves as an additional attempt to recover.
Key Points to Consider
1. Avoid trading in sideways markets – If price levels do not fluctuate significantly, the accuracy of the signals may decrease.
2. Trade in the direction of the trend – Using Ichimoku clouds or other trend indicators can help confirm trend direction and improve signal reliability. If the market is in an uptrend (bullish trend) and the indicator generates a sell signal, the most prudent decision would be to wait for a buy signal that aligns with the main trend. The same applies to downtrends, where buy signals may be riskier.
These decisions should be based on chart reading and supported by other technical analysis tools, such as support and resistance levels, which indicate zones where price might face obstacles or reverse direction. Additionally, Fibonacci retracement levels can help identify possible pullback points within a trend. Moving averages are also useful for visualizing the general market direction and confirming whether an indicator signal aligns with the overall price structure. Combining these tools can increase trade accuracy and prevent unnecessary trades against the main trend, reducing risks.
3. Works based on probability statistics – The algorithm analyzes candle formations and their statistical probabilities depending on the timeframe to optimize trade entries.
4. Best suited for scalping and binary options – This strategy performs best in 1-minute and 5-minute timeframes, allowing for multiple trades throughout the day.
Technical Details
• The script detects the candle cycle and assigns an index to each candle to identify patterns and possible reversals.
• It recognizes reference candles, stores their colors, and compares them with subsequent candles to determine if a signal should be triggered.
• Doji candle rules are implemented to avoid false signals in indecisive market conditions. When a Doji appears, the script does not generate signals for that cycle.
• The indicator displays visual alerts and notifications, ensuring fast execution of trades.
Disclaimer
The IG Signals+ indicator was created to assist traders who struggle to analyze the market by providing objective trade signals. However, no strategy is foolproof, and this script does not guarantee profits.
Trading involves significant financial risk, and users should test it in a demo account before trading with real money. Proper risk management is crucial for long-term success.
kurd fx Dynamic EMA StrategyDynamic EMA Strategy Explanation
This TradingView Pine Script indicator, "Dynamic EMA Strategy," is designed to plot Exponential Moving Averages (EMAs) dynamically based on the selected timeframe. It adjusts the EMA periods depending on whether the trader is scalping, swing trading, or position trading.
Functionality
1. Defining EMA Periods Based on Timeframe
The script determines appropriate EMA values based on the selected chart timeframe:
Scalping (1m, 3m, 5m)
Uses EMA 9, EMA 21, and EMA 50 for fast-moving market conditions.
Swing Trading (15m, 30m, 45m)
Uses EMA 50 and EMA 100, suitable for medium-term trend identification.
EMA 3 is disabled (na) in this mode.
Position Trading (1H and higher)
Uses EMA 100 and EMA 200 to identify long-term trends.
EMA 3 is disabled (na) in this mode.
2. EMA Calculation
The script calculates EMA values dynamically:
emaLine1 = ta.ema(close, ema1): Computes the first EMA.
emaLine2 = ta.ema(close, ema2): Computes the second EMA.
emaLine3 = not na(ema3) ? ta.ema(close, ema3) : na: Computes the third EMA only if applicable.
3. Plotting the EMAs
The script overlays the EMAs on the chart:
Blue Line (EMA 1) → Represents the fastest EMA.
Orange Line (EMA 2) → Represents the medium EMA.
Red Line (EMA 3) → Represents the slowest EMA (if applicable).
Each EMA is plotted using plot() with a specific color, linewidth of 2, and plot.style_line for a clean visualization.
Use Case
Scalpers can identify short-term momentum changes.
Swing traders can detect medium-term trends.
Position traders can spot long-term market trends.
This strategy helps traders adjust their EMA settings dynamically without manually changing them for different timeframes.
Multi-Indicator Signals with Selectable Options by DiGetMulti-Indicator Signals with Selectable Options
Script Overview
This Pine Script is a multi-indicator trading strategy designed to generate buy/sell signals based on combinations of popular technical indicators: RSI (Relative Strength Index) , CCI (Commodity Channel Index) , and Stochastic Oscillator . The script allows you to select which combination of signals to display, making it highly customizable and adaptable to different trading styles.
The primary goal of this script is to provide clear and actionable entry/exit points by visualizing buy/sell signals with arrows , labels , and vertical lines directly on the chart. It also includes input validation, dynamic signal plotting, and clutter-free line management to ensure a clean and professional user experience.
Key Features
1. Customizable Signal Types
You can choose from five signal types:
RSI & CCI : Combines RSI and CCI signals for confirmation.
RSI & Stochastic : Combines RSI and Stochastic signals.
CCI & Stochastic : Combines CCI and Stochastic signals.
RSI & CCI & Stochastic : Requires all three indicators to align for a signal.
All Signals : Displays individual signals from each indicator separately.
This flexibility allows you to test and use the combination that works best for your trading strategy.
2. Clear Buy/Sell Indicators
Arrows : Buy signals are marked with upward arrows (green/lime/yellow) below the candles, while sell signals are marked with downward arrows (red/fuchsia/gray) above the candles.
Labels : Each signal is accompanied by a label ("BUY" or "SELL") near the arrow for clarity.
Vertical Lines : A vertical line is drawn at the exact bar where the signal occurs, extending from the low to the high of the candle. This ensures you can pinpoint the exact entry point without ambiguity.
3. Dynamic Overbought/Oversold Levels
You can customize the overbought and oversold levels for each indicator:
RSI: Default values are 70 (overbought) and 30 (oversold).
CCI: Default values are +100 (overbought) and -100 (oversold).
Stochastic: Default values are 80 (overbought) and 20 (oversold).
These levels can be adjusted to suit your trading preferences or market conditions.
4. Input Validation
The script includes built-in validation to ensure that oversold levels are always lower than overbought levels for each indicator. If the inputs are invalid, an error message will appear, preventing incorrect configurations.
5. Clean Chart Design
To avoid clutter, the script dynamically manages vertical lines:
Only the most recent 50 buy/sell lines are displayed. Older lines are automatically deleted to keep the chart clean.
Labels and arrows are placed strategically to avoid overlapping with candles.
6. ATR-Based Offset
The vertical lines and labels are offset using the Average True Range (ATR) to ensure they don’t overlap with the price action. This makes the signals easier to see, especially during volatile market conditions.
7. Scalable and Professional
The script uses arrays to manage multiple vertical lines, ensuring scalability and performance even when many signals are generated.
It adheres to Pine Script v6 standards, ensuring compatibility and reliability.
How It Works
Indicator Calculations :
The script calculates the values of RSI, CCI, and Stochastic Oscillator based on user-defined lengths and smoothing parameters.
It then checks for crossover/crossunder conditions relative to the overbought/oversold levels to generate individual signals.
Combined Signals :
Depending on the selected signal type, the script combines the individual signals logically:
For example, a "RSI & CCI" buy signal requires both RSI and CCI to cross into their respective oversold zones simultaneously.
Signal Plotting :
When a signal is generated, the script:
Plots an arrow (upward for buy, downward for sell) at the corresponding bar.
Adds a label ("BUY" or "SELL") near the arrow for clarity.
Draws a vertical line extending from the low to the high of the candle to mark the exact entry point.
Line Management :
To prevent clutter, the script stores up to 50 vertical lines in arrays (buy_lines and sell_lines). Older lines are automatically deleted when the limit is exceeded.
Why Use This Script?
Versatility : Whether you're a scalper, swing trader, or long-term investor, this script can be tailored to your needs by selecting the appropriate signal type and adjusting the indicator parameters.
Clarity : The combination of arrows, labels, and vertical lines ensures that signals are easy to spot and interpret, even in fast-moving markets.
Customization : With adjustable overbought/oversold levels and multiple signal options, you can fine-tune the script to match your trading strategy.
Professional Design : The script avoids clutter by limiting the number of lines displayed and using ATR-based offsets for better visibility.
How to Use This Script
Add the Script to Your Chart :
Copy and paste the script into the Pine Editor in TradingView.
Save and add it to your chart.
Select Signal Type :
Use the "Signal Type" dropdown menu to choose the combination of indicators you want to use.
Adjust Parameters :
Customize the lengths of RSI, CCI, and Stochastic, as well as their overbought/oversold levels, to match your trading preferences.
Interpret Signals :
Look for green arrows and "BUY" labels for buy signals, and red arrows and "SELL" labels for sell signals.
Vertical lines will help you identify the exact bar where the signal occurred.
Tips for Traders
Backtest Thoroughly : Before using this script in live trading, backtest it on historical data to ensure it aligns with your strategy.
Combine with Other Tools : While this script provides reliable signals, consider combining it with other tools like support/resistance levels or volume analysis for additional confirmation.
Avoid Overloading the Chart : If you notice too many signals, try tightening the overbought/oversold levels or switching to a combined signal type (e.g., "RSI & CCI & Stochastic") for fewer but higher-confidence signals.
Static price-range projection by symbolThis indicator shows you a predefined range to the right of the last candle of your chart. This range is custom and can be changed for a handful of symbols that you can choose. This scale will help you determining if the market is providing a reasonable range before you enter a trade or if the market isn't actually moving as much as you might think. This is particularly useful if you are into scalping and have to consider commission or spread in your trades.
Since all symbols have different price ranges in which they move this indicator doesn't make sense to just have "a one size fits all" approach. That's why you can choose up to 6 symbols and set the range that you want to have shown for each when you pull it up on the chart. Using my default values that means for when the NQ (Nasdaq future) is on the chart you will see a range of 20 handles projected. When you change the the ES (S&P500 future) you will instead see 5 handles. While the number is different that is somewhat of an equal move in both symbols.
There also is an option to set a default price range for all other symbols that are not selected if it is needed. However the display of the scale on anything else than the 6 selected symbols can also be turned off.
There are options provided on how exactly you want to indicator to determine if the chart symbol matches one of the selected symbols.
You can enable it to make sure the exchange/broker is the exact same as selected.
It can check for only the symbol root to match the selection. Specifically for futures this means that while ES1! might be selected, anything ES (ES1!, ES2!, ESH2025, ESM2025, ESM2022, ...) will be a match to the selection)
On the painted scale it is possible to not just show this range extended into each direction once. Per default you will have 3 segments of it in each direction. This can be reduced to just 1 or increased.
If you chose a high number of segments or a large range make sure to use the "Scale price chart only" option on your chart scale to not have the symbols price candles squished together by the charts auto scaling.
And last but not least the indicator options provide some possibilities to change the appearance of the printed price range scale in case you disagree with my design.
Price Action Trend and Margin EquityThe Price Action Trend and Margin Equity indicator is a multifunctional market analysis tool that combines elements of money management and price pattern analysis. The indicator helps traders identify key price action patterns and determine optimal entry, exit and stop loss levels based on the current trend.
The main components of the indicator:
Money Management:
Allows the trader to set risk management parameters such as the percentage of possible loss on the position, the use of fixed leverage and the total capital.
Calculates the required leverage level to achieve a specified percentage of loss.
Price Action:
Correctly identifies various price patterns such as Pin Bar, Engulfing Bar, PPR Bar and Inside Bar.
Displays these patterns on the chart with the ability to customize candle colors and display styles.
Allows the trader to customize take profit and stop loss points to display them on the chart.
The ability to display patterns only in the direction of the trend.
Trend: (some code taken from ChartPrime)
Uses a trend cloud to visualize the current market direction.
The trend cloud is displayed on the chart and helps traders determine whether the market is in an uptrend or a downtrend.
Alert:
Allows you to set an alert that will be triggered when the pattern is formed.
Example of use:
Let's say a trader uses the indicator to trade the crypto market. He sets the money management parameters, setting the maximum loss per position to 5% and using a fixed leverage of 1:100. The indicator automatically calculates the required position size to meet these parameters ($: on the label). Or displays the leverage (X: on the label) to achieve the required risk.
The trader receives an alert when a Pin Bar is formed. The indicator displays the entry, exit, and stop loss levels based on this pattern. The trader opens a position for the recommended amount in the direction indicated by the indicator and sets the stop loss and take profit at the recommended levels.
General Settings:
Position Loss Percentage: Sets the maximum loss percentage you are willing to take on a single position.
Use Fixed Leverage: Enables or disables the use of fixed leverage.
Fixed Leverage: Sets the fixed leverage level.
Total Equity: Specifies the total equity you are using for trading. (Required for calculation when using fixed leverage)
Turn Patterns On/Off: You can turn on or off the display of various price patterns such as Pin Bar, Outside Bar (Engulfing), Inside Bar, and PPR Bar.
Pattern Colors: Sets the colors for displaying each pattern on the chart.
Candle Color: Allows you to set a neutral color for candles that do not match the price action.
Show Lines: Allows you to turn on or off the display of labels and lines.
Line Length: Sets the length of the stop, entry, and take profit lines.
Label color: One color for all labels (configured below) or the color of the labels in the color of the candle pattern.
Pin entry: Select the entry point for the pin bar: candle head, bar close, or 50% of the candle.
Coefficients for stop and take lines.
Use trend for price action: When enabled, will show price action signals only in the direction of the trend.
Display trend cloud: Enables or disables the display of the trend cloud.
Cloud calculation period: Sets the period for which the maximum and minimum values for the cloud are calculated. The longer the period, the smoother the cloud will be.
Cloud colors: Sets the colors for uptrends and downtrends, as well as the transparency of the cloud.
The logic of the indicator:
Pin Bar is a candle with a long upper or lower shadow and a short body.
Logic: If the length of one shadow is twice the body and the opposite shadow of the candle, it is considered a Pin Bar.
An Inside Bar is a candle that is completely engulfed by the previous candle.
Logic: If the high and low of the current candle are inside the previous candle, it is an Inside Bar.
An Outside Bar or Engulfing is a candle that completely engulfs the previous candle.
Logic: If the high and low of the current candle are outside the previous candle and close outside the previous candle, it is an Outside Bar.
A PPR Bar is a candle that closes above or below the previous candle.
Logic: If the current candle closes above the high of the previous candle or below its low, it is a PPR Bar.
Stop Loss Levels: Calculated based on the specified ratios. If set to 1.0, it shows the correct stop for the pattern by pushing away from the entry point.
Take Profit Levels: Calculated based on the specified ratios.
Create a Label: The label is created at the stop loss level and contains information about the potential leverage and loss.
The formula for calculating the $ value is:
=(Total Capital x (Maximum Loss Percentage on Position/100)) / (Difference between Entry Level and Stop Loss Level × Ratio that sets the stop loss level relative to the length of the candlestick shadow × Fixed Leverage Value) .
Labels contain the following information:
The percentage of price change from the recommended entry point to the stop loss level.
Required Leverage (X: ): The amount of leverage required to achieve the specified loss percentage. (Or a fixed value if selected).
Required Capital ($: ): The amount of capital required to open a position with the specified leverage and loss percentage (only displayed when using fixed leverage).
The trend cloud identifies the maximum and minimum price values for the specified period.
The cloud value is set depending on whether the current price is equal to the high or low values.
If the current closing price is equal to the high value, the cloud is set at the low value, and vice versa.
RU
Индикатор "Price Action Trend and Margin Equity" представляет собой многофункциональный инструмент для анализа рынка, объединяющий в себе элементы управления капиталом и анализа ценовых паттернов. Индикатор помогает трейдерам идентифицировать ключевые прайс экшн паттерны и определять оптимальные уровни входа, выхода и стоп-лосс на основе текущего тренда.
Основные компоненты индикатора:
Управление капиталом:
Позволяет трейдеру задавать параметры управления рисками, такие как процент возможного убытка по позиции, использование фиксированного плеча и общий капитал.
Рассчитывает необходимый уровень плеча для достижения заданного процента убытка.
Price Action:
Правильно идентифицирует различные ценовые паттерны, такие как Pin Bar, Поглащение Бар, PPR Bar и Внутренний Бар.
Отображает эти паттерны на графике с возможностью настройки цветов свечей и стилей отображения.
Позволяет трейдеру настраивать точки тейк профита и стоп лосса для отображения их на графике.
Возможность отображения паттернов только в натправлении тренда.
Trend: (часть кода взята у ChartPrime)
Использует облако тренда для визуализации текущего направления рынка.
Облако тренда отображается на графике и помогает трейдерам определить, находится ли рынок в восходящем или нисходящем тренде.
Оповещение:
Дает возможность установить оповещение которое будет срабатывать при формировании паттерна.
Пример применения:
Предположим, трейдер использует индикатор для торговли на крипто рынке. Он настраивает параметры управления капиталом, устанавливая максимальный убыток по позиции в 5% и используя фиксированное плечо 1:100. Индикатор автоматически рассчитывает необходимый объем позиции для соблюдения этих параметров ($: на лейбле). Или отображает плечо (Х: на лейбле) для достижения необходимого риска.
Трейдер получает оповещение о формировании Pin Bar. Индикатор отображает уровни входа, выхода и стоп-лосс, основанные на этом паттерне. Трейдер открывает позицию на рекомендуемую сумму в направлении, указанном индикатором, и устанавливает стоп-лосс и тейк-профит на рекомендованных уровнях.
Общие настройки:
Процент убытка по позиции: Устанавливает максимальный процент убытка, который вы готовы понести по одной позиции.
Использовать фиксированное плечо: Включает или отключает использование фиксированного плеча.
Уровень фиксированного плеча: Задает уровень фиксированного плеча.
Общий капитал: Указывает общий капитал, который вы используете для торговли. (Необходим для расчета при использовании фиксированного плеча)
Включение/отключение паттернов: Вы можете включить или отключить отображение различных ценовых паттернов, таких как Pin Bar, Outside Bar (Поглощение), Inside Bar и PPR Bar.
Цвета паттернов: Задает цвета для отображения каждого паттерна на графике.
Цвет свечей: Позволяет задать нейтральный цвет для свечей неподходящих под прйс экшн.
Показывать линии: Позволяет включить или отключить отображение лейблов и линий.
Длинна линий: Настройка длинны линий стопа, линии входа и тейк профита.
Цвет лейбла: Один цвет для всех лейблов (настраивается ниже) или цвет лейблов в цвет паттерна свечи.
Вход в пин: Выбор точки входа для пин бара: голова свечи, точка закрытия бара или 50% свечи.
Коэффиценты для стоп и тейк линий.
Использовать тренд для прайс экшна: При включении будет показывать прайс экшн сигналы только в направлении тренда.
Отображение облака тренда: Включает или отключает отображение облака тренда.
Период расчета облака: Устанавливает период, за который рассчитываются максимальные и минимальные значения для облака. Чем больше период, тем более сглаженным будет облако.
Цвета облака: Задает цвета для восходящего и нисходящего трендов, а также прозрачность облака.
Логика работы индикатора:
Pin Bar — это свеча с длинной верхней или нижней тенью и коротким телом.
Логика: Если длина одной тени вдвое больше тела и противоположной тени свечи, считается, что это Pin Bar.
Inside Bar — это свеча, полностью поглощенная предыдущей свечой.
Логика: Если максимум и минимум текущей свечи находятся внутри предыдущей свечи, это Inside Bar.
Outside Bar или Поглощение — это свеча, которая полностью поглощает предыдущую свечу.
Логика: Если максимум и минимум текущей свечи выходят за пределы предыдущей свечи и закрывается за пределами предыдущей свечи, это Outside Bar.
PPR Bar — это свеча, которая закрывается выше или ниже предыдущей свечи.
Логика: Если текущая свеча закрывается выше максимума предыдущей свечи или ниже ее минимума, это PPR Bar.
Уровни стоп-лосс: Рассчитываются на основе заданных коэффициентов. При значении 1.0 показывает правильный стоп для паттерна отталкиваясь от точки входа.
Уровки тейк-профита: Рассчитываются на основе заданных коэффициентов.
Создание метки: Метка создается на уровне стоп-лосс и содержит информацию о потенциальном плече и убытке.
Формула для вычисления значения $:
=(Общий капитал x (Максимальный процент убытка по позиции/100)) / (Разница между уровнем входа и уровнем стоп-лосс × Коэффициент, задающий уровень стоп-лосс относительно длины тени свечи × Значение фиксированного плеча).
Метки содержат следующую информацию:
Процент изменения цены от рекомендованной точки входа до уровня стоп-лосс.
Необходимое плечо (Х: ): Уровень плеча, необходимый для достижения заданного процента убытка. (Или фиксированное значение если оно выбрано).
Необходимый капитал ($: ): Сумма капитала, необходимая для открытия позиции с заданным плечом и процентом убытка (отображается только при использовании фиксированного плеча).
Облако тренда определяет максимальные и минимальные значения цены за указанный период.
Значение облака устанавливается в зависимости от того, совпадает ли текущая цена с максимальными или минимальными значениями.
Если текущая цена закрытия равна максимальному значению, облако устанавливается на уровне минимального значения, и наоборот.
Sideways Scalper Peak and BottomUnderstanding the Indicator
This indicator is designed to identify potential peaks (tops) and bottoms (bottoms) within a market, which can be particularly useful in a sideways or range-bound market where price oscillates between support and resistance levels without a clear trend. Here's how it works:
RSI (Relative Strength Index): Measures the speed and change of price movements to identify overbought (above 70) and oversold (below 30) conditions. In a sideways market, RSI can help signal when the price might be due for a reversal within its range.
Moving Averages (MAs): The Fast MA and Slow MA provide a sense of the short-term and longer-term average price movements. In a sideways market, these can help confirm if the price is at the upper or lower extremes of its range.
Volume Spike: Looks for significant increases in trading volume, which might indicate a stronger move or a potential reversal point when combined with other conditions.
Divergence: RSI divergence occurs when the price makes a new high or low, but the RSI does not, suggesting momentum is weakening, which can be a precursor to a reversal.
How to Use in a Sideways Market
Identify the Range: First, visually identify the upper resistance and lower support levels of the sideways market on your chart. This indicator can help you spot these levels more precisely by signaling potential peaks and bottoms.
Peak Signal :
When to Look: When the price approaches the upper part of the range.
Conditions: The indicator will give a 'Peak' signal when:
RSI is over 70, indicating overbought conditions.
There's bearish divergence (price makes a higher high, but RSI doesn't).
Volume spikes, suggesting strong selling interest.
Price is above both Fast MA and Slow MA, indicating it's at a potentially high point in the range.
Action: This signal suggests that the price might be at or near the top of its range and could reverse downwards. A trader might consider selling or shorting here, expecting the price to move towards the lower part of the range.
Bottom Signal:
When to Look: When the price approaches the lower part of the range.
Conditions: The indicator will give a 'Bottom' signal when:
RSI is below 30, indicating oversold conditions.
There's bullish divergence (price makes a lower low, but RSI doesn't).
Volume spikes, suggesting strong buying interest.
Price is below both Fast MA and Slow MA, indicating it's at a potentially low point in the range.
Action: This signal suggests that the price might be at or near the bottom of its range and could reverse upwards. A trader might consider buying here, expecting the price to move towards the upper part of the range.
Confirmation: In a sideways market, false signals can occur due to the lack of a strong trend. Always look for confirmation:
Volume Confirmation: A significant volume spike can add confidence to the signal.
Price Action: Look for price action like candlestick patterns (e.g., doji, engulfing patterns) that confirm the reversal.
Time Frame: Consider using this indicator on multiple time frames. A signal on a shorter time frame (like 15m or 1h) might be confirmed by similar conditions on a longer time frame (4h or daily).
Risk Management: Since this is designed for scalping in a sideways market:
Set Tight Stop-Losses: Due to the quick nature of reversals in range-bound markets, place stop-losses close to your entry to minimize loss.
Take Profit Levels: Set profit targets near the opposite end of the range or use a trailing stop to capture as much of the move as possible before it reverses again.
Practice: Before trading with real money, practice with this indicator on historical data or in a paper trading environment to understand how it behaves in different sideways market scenarios.
Key Points for New Traders
Patience: Wait for all conditions to align before taking a trade. Sideways markets require patience as the price might hover around these levels for a while.
Not All Signals Are Equal: Sometimes, even with all conditions met, the market might not reverse immediately. Look for additional context or confirmation.
Continuous Learning: Understand that this indicator, like any tool, isn't foolproof. Learn from each trade, whether it's a win or a loss, and adjust your strategy accordingly.
By following these guidelines
Ultimate T3 Fibonacci for BTC Scalping. Look at backtest report!Hey Everyone!
I created another script to add to my growing library of strategies and indicators that I use for automated crypto trading! This strategy is for BITCOIN on the 30 minute chart since I designed it to be a scalping strategy. I calculated for trading fees, and use a small amount of capital in the backtest report. But feel free to modify the capital and how much per order to see how it changes the results:)
It is called the "Ultimate T3 Fibonacci Indicator by NHBprod" that computes and displays two T3-based moving averages derived from price data. The t3_function calculates the Tilson T3 indicator by applying a series of exponential moving averages to a combined price metric and then blending these results with specific coefficients derived from an input factor.
The script accepts several user inputs that toggle the use of the T3 filter, select the buy signal method, and set parameters like lengths and volume factors for two variations of the T3 calculation. Two T3 lines, T3 and T32, are computed with different parameters, and their colors change dynamically (green/red for T3 and blue/purple for T32) based on whether the lines are trending upward or downward. Depending on the selected signal method, the script generates buy signals either when T32 crosses over T3 or when the closing price is above T3, and similarly, sell signals are generated on the respective conditions for crossing under or closing below. Finally, the indicator plots the T3 lines on the chart, adds visual buy/sell markers, and sets alert conditions to notify users when the respective trading signals occur.
The user has the ability to tune the parameters using TP/SL, date timerames for analyses, and the actual parameters of the T3 function including the buy/sell signal! Lastly, the user has the option of trading this long, short, or both!
Let me know your thoughts and check out the backtest report!
AI Volume Breakout for scalpingPurpose of the Indicator
This script is designed for trading, specifically for scalping, which involves making numerous trades within a very short time frame to take advantage of small price movements. The indicator looks for volume breakouts, which are moments when trading volume significantly increases, potentially signaling the start of a new price movement.
Key Components:
Parameters:
Volume Threshold (volumeThreshold): Determines how much volume must increase from one bar to the next for it to be considered significant. Set at 4.0, meaning volume must quadruplicate for a breakout signal.
Price Change Threshold (priceChangeThreshold): Defines the minimum price change required for a breakout signal. Here, it's 1.5% of the bar's opening price.
SMA Length (smaLength): The period for the Simple Moving Average, which helps confirm the trend direction. Here, it's set to 20.
Cooldown Period (cooldownPeriod): Prevents signals from being too close together, set to 10 bars.
ATR Period (atrPeriod): The period for calculating Average True Range (ATR), used to measure market volatility.
Volatility Threshold (volatilityThreshold): If ATR divided by the close price exceeds this, the market is considered too volatile for trading according to this strategy.
Calculations:
SMA (Simple Moving Average): Used for trend confirmation. A bullish signal is more likely if the price is above this average.
ATR (Average True Range): Measures market volatility. Lower volatility (below the threshold) is preferred for this strategy.
Signal Generation:
The indicator checks if:
Volume has increased significantly (volumeDelta > 0 and volume / volume >= volumeThreshold).
There's enough price change (math.abs(priceDelta / open) >= priceChangeThreshold).
The market isn't too volatile (lowVolatility).
The trend supports the direction of the price change (trendUp for bullish, trendDown for bearish).
If all these conditions are met, it predicts:
1 (Bullish) if conditions suggest buying.
0 (Bearish) if conditions suggest selling.
Cooldown Mechanism:
After a signal, the script waits for a number of bars (cooldownPeriod) before considering another signal to avoid over-trading.
Visual Feedback:
Labels are placed on the chart:
Green label for bullish breakouts below the low price.
Red label for bearish breakouts above the high price.
How to Use:
Entry Points: Look for the labels on your chart to decide when to enter trades.
Risk Management: Since this is for scalping, ensure each trade has tight stop-losses to manage risk due to the quick, small movements.
Market Conditions: This strategy might work best in markets with consistent volume and price changes but not extreme volatility.
Caveats:
This isn't real AI; it's a heuristic based on volume and price. Actual AI would involve machine learning algorithms trained on historical data.
Always backtest any strategy, and consider how it behaves in different market conditions, not just the ones it was designed for.
Ultimate Stochastics Strategy by NHBprod Use to Day Trade BTCHey All!
Here's a new script I worked on that's super simple but at the same time useful. Check out the backtest results. The backtest results include slippage and fees/commission, and is still quite profitable. Obviously the profitability magnitude depends on how much capital you begin with, and how much the user utilizes per order, but in any event it seems to be profitable according to backtests.
This is different because it allows you full functionality over the stochastics calculations which is designed for random datasets. This script allows you to:
Designate ANY period of time to analyze and study
Choose between Long trading, short trading, and Long & Short trading
It allows you to enter trades based on the stochastics calculations
It allows you to EXIT trades using the stochastics calculations or take profit, or stop loss, Or any combination of those, which is nice because then the user can see how one variable effects the overall performance.
As for the actual stochastics formula, you get control, and get to SEE the plot lines for slow K, slow D, and fast K, which is usually not considered.
You also get the chance to modify the smoothing method, which has not been done with regular stochastics indicators. You get to choose the standard simple moving average (SMA) method, but I also allow you to choose other MA's such as the HMA and WMA.
Lastly, the user gets the option of using a custom trade extender, which essentially allows a buy or sell signal to exist for X amount of candles after the initial signal. For example, you can use "max bars since signal" to 1, and this will allow the indicator to produce an extra sequential buy signal when a buy signal is generated. This can be useful because it is possible that you use a small take profit (TP) and quickly exit a profitable trade. With the max bars since signal variable, you're able to reenter on the next candle and allow for another opportunity.
Let me know if you have any questions! Please take a look at the performance report and let me know your thoughts! :)
Multi Stochastic AlertHello Everyone,
I have created a Multi Stochastic Alert based on Scalping Strategy
The Strategy uses below 4 Stochastic indicator:
1. Stochastic (9,3)
2. Stochastic (14,3)
3. Stochastic (40,4)
4. Stochastic (60,10)
Trade entry become active when all of these goes below 20 or above 80, In this indicator you don't need to use all 4, this will show red and green background whenever all of them goes below 20 or above 80.
As shown in picture below, it works better when script is making a channel, Our indicator shows green or red signal, we wait for RSI Divergence and we enter. We book when blue line (9,3) goes above 80, as shown by arrow, and trail rest at breakeven or your own trailing method
Same Situation shown for Short side. We book 50% when Blue line (9,3) Goes below 20 and trail rest at breakeven or your own trailing method
Happy trading, Let me know if any improvements required.
Scalping trading system based on 4 ema linesScalping Trading System Based on 4 EMA Lines
Overview:
This is a scalping trading strategy built on signals from 4 EMA moving averages: EMA(8), EMA(12), EMA(24) and EMA(72).
Conditions:
- Time frame: H1 (1 hour).
- Trading assets: Applicable to major currency pairs with high volatility
- Risk management: Use a maximum of 1-2% of capital for each transaction. The order holding time can be from a few hours to a few days, depending on the price fluctuation amplitude.
Trading rules:
Determine the main trend:
Uptrend: EMA(8), EMA(12) and EMA(24) are above EMA(72).
Downtrend: EMA(8), EMA(12) and EMA(24) are below EMA(72).
Trade in the direction of the main trend** (buy in an uptrend and sell in a downtrend).
Entry conditions:
- Only trade in a clearly trending market.
Uptrend:
- Wait for the price to correct to the EMA(24).
- Enter a buy order when the price closes above the EMA(24).
- Place a stop loss below the bottom of the EMA(24) candle that has just been swept.
Downtrend:
- Wait for the price to correct to the EMA(24).
- Enter a sell order when the price closes below the EMA(24).
- Place a stop loss above the top of the EMA(24) candle that has just been swept.
Take profit and order management:
- Take profit when the price moves 20 to 40 pips in the direction of the trade.
Use Trailing Stop to optimize profits instead of setting a fixed Take Profit.
Note:
- Do not trade within 30 minutes before and after the announcement of important economic news, as the price may fluctuate abnormally.
Additional filters:
To increase the success rate and reduce noise, this strategy uses additional conditions:
1. The price is calculated only when the candle closes (no repaint).
2. When sweeping through EMA(24), the price needs to close above EMA(24).
3. The closing price must be higher than 50% of the candle's length.
4. **The bottom of the candle sweeping through EMA(24) must be lower than the bottom of the previous candle (liquidity sweep).
---
Alert function:
When the EMA(24) sweep conditions are met, the system will trigger an alert if you have set it up.
- Entry point: The closing price of the candle sweeping through EMA(24).
- Stop Loss:
- Buy Order: Place at the bottom of the sweep candle.
- Sell Order: Place at the top of the sweep candle.
---
Note:
This strategy is designed to help traders identify profitable trading opportunities based on trends. However, no strategy is 100% guaranteed to be successful. Please test it thoroughly on a demo account before using it.
[COG] Advanced School Run StrategyAdvanced School Run Strategy (ASRS) – Explanation
Overview: The Advanced School Run Strategy (ASRS) is an intraday trading approach designed to identify breakout opportunities based on specific time and price patterns. This script applies the concepts of the Advanced School Run Strategy as outlined in Tom Hougaard's research, adapted to work seamlessly on TradingView charts. It leverages 5-minute candlestick data to set actionable breakout levels and provides traders with visual cues and alerts to make informed decisions.
Features:
Dynamic Breakout Levels: Automatically calculates high and low levels based on the market's behavior during the initial trading minutes.
Custom Visualization: Highlights breakout zones with customizable colors and transparency, providing clear visual feedback for bullish and bearish breakouts.
Configurable Alerts: Includes alert conditions for both bullish and bearish breakouts, ensuring traders never miss a trading opportunity.
Reset Logic: Resets breakout levels daily at the market open to ensure accurate signal generation for each session.
How It Works:
The script identifies key levels (high and low) after a configurable number of minutes from the market open (default: 25 minutes).
If the price breaks above the high level or below the low level, a corresponding breakout is detected.
The script draws breakout zones on the chart and triggers alerts based on the breakout direction.
All levels and signals reset at the start of each new trading session, maintaining relevance to current market conditions.
Customization Options:
Line and box colors for bullish and bearish breakouts.
Transparency levels for breakout visualizations.
Alert settings to receive notifications for detected breakouts.
Acknowledgment: This script is inspired by Tom Hougaard's Advanced School Run Strategy. The methodology has been translated into Pine Script for TradingView users, adhering to TradingView’s policies and community guidelines. This script does not redistribute proprietary content from the original research but implements the principles for educational and analytical purposes.
Adaptive Fractal Grid Scalping StrategyThis Pine Script v6 component implements an "Adaptive Fractal Grid Scalping Strategy" with an added volatility threshold feature.
Here's how it works:
Fractal Break Detection: Uses ta.pivothigh and ta.pivotlow to identify local highs and lows.
Volatility Clustering: Measures volatility using the Average True Range (ATR).
Adaptive Grid Levels: Dynamically adjusts grid levels based on ATR and user-defined multipliers.
Directional Bias Filter: Uses a Simple Moving Average (SMA) to determine trend direction.
Volatility Threshold: Introduces a new input to specify a minimum ATR value required to activate the strategy.
Trade Execution Logic: Places limit orders at grid levels based on trend direction and fractal levels, but only when ATR exceeds the volatility threshold.
Profit-Taking and Stop-Loss: Implements profit-taking at grid levels and a trailing stop-loss based on ATR.
How to Use
Inputs: Customize the ATR length, SMA length, grid multipliers, trailing stop multiplier, and volatility threshold through the input settings.
Visuals: The script plots fractal points and grid levels on the chart for easy visualization.
Trade Signals: The strategy automatically places buy/sell orders based on the detected fractals, trend direction, and volatility threshold.
Profit and Risk Management: The script includes logic for taking profits and setting stop-loss levels to manage trades effectively.
This strategy is designed to capitalize on micro-movements during high volatility and avoid overtrading during low-volatility trends. Adjust the input parameters to suit your trading style and market conditions.
Bondar Drive v2.1Title: Bondar Drive v2.1 — Real-time print and delta tick volume visualization
Description:
Bondar Drive v2.1 is a tool for visualizing real-time order flow data. It highlights price movements and volume deltas in an intuitive, easy-to-read format. Indicator can be used in conjunction with the Anchored Volume Profile and Volume Footprint (Type: Total).
Features:
Real-Time Print Visualization:
Displays order flow prints with delta colors for buy/sell dominance.
Adjustable size and transparency for varying order thresholds.
Volume Delta Analysis:
Categorizes orders into Tiny, Small, Session, Large, and Huge based on user-defined thresholds.
Provides a tooltip showing order time and price.
Customizable Time Range:
Keeps prints visible for a specified duration (in seconds).
Flexible User Inputs:
Adjustable time zones, print sizes, starting bar index, and volume thresholds.
Visual Enhancements:
Line connections between prints show progression of orders and market direction.
How It Works:
The indicator gathers volume delta and price data in real time.
It dynamically displays circular labels with varying sizes and colors, reflecting the size and type of orders. Labels and lines are automatically removed after the specified time range, ensuring a clean and uncluttered chart.
Customization Options:
Number of Prints: Control how many prints are displayed.
Order Size Filters: Exclude small trades to highlight significant orders.
Color Options: Customize print colors, text, and connecting lines.
Time Offset: Adjust for your local time zone.
Use Cases:
Identify order flow imbalances and price levels dominated by buyers or sellers.
Track the progression of large orders for better trade execution.
Spot market reversals and momentum shifts using real-time prints and delta.
Precision Trading Strategy: Golden EdgeThe PTS: Golden Edge strategy is designed for scalping Gold (XAU/USD) on lower timeframes, such as the 1-minute chart. It captures high-probability trade setups by aligning with strong trends and momentum, while filtering out low-quality trades during consolidation or low-volatility periods.
The strategy uses a combination of technical indicators to identify optimal entry points:
1. Exponential Moving Averages (EMAs): A fast EMA (3-period) and a slow EMA (33-period) are used to detect short-term trend reversals via crossover signals.
2. Hull Moving Average (HMA): A 66-period HMA acts as a higher-timeframe trend filter to ensure trades align with the overall market direction.
3. Relative Strength Index (RSI): A 12-period RSI identifies momentum. The strategy requires RSI > 55 for long trades and RSI < 45 for short trades, ensuring entries are backed by strong buying or selling pressure.
4. Average True Range (ATR): A 14-period ATR ensures trades occur only during volatile conditions, avoiding choppy or low-movement markets.
By combining these tools, the PTS: Golden Edge strategy creates a precise framework for scalping and offers a systematic approach to capitalize on Gold’s price movements efficiently.