Dynamic High-Low TableThis Pine Script creates a dynamic high-low data table on the chart, displaying key price levels for multiple timeframes, including 52-week, 1-month, 1-week, and daily intervals. It also shows today's open price and current market price (CMP), handling holidays gracefully by displaying - when data is unavailable. The table features bold headers and contrasting colors for readability across light and dark themes.
Indicators and strategies
Non-stationary TPI StrategyTrend following strategy. it aggravates a multitude of indicators to produce a robust trend signal.
Advanced 5-Candle Pattern PredictorThis advanced indicator uses machine learning techniques and multiple analysis methods to predict potential bullish or bearish moves based on the last 5 candles. It combines volume analysis, momentum indicators, and pattern recognition to generate high-probability trading signals.
Key Features:
- Sophisticated 5-candle pattern analysis
- Volume-confirmed signals
- Multi-timeframe trend analysis
- Advanced momentum tracking
- Real-time probability scoring
How It Works:
The indicator analyzes multiple factors for each candle:
1. Body/wick ratios and relationships
2. Volume correlation with price movement
3. Momentum shifts between candles
4. Trend strength and direction
5. Technical indicator confluence (RSI, MACD)
Signals are generated only when:
- Pattern probability exceeds the threshold (default 75%)
- Volume confirms the movement
- Multiple technical factors align
- Trend strength supports the direction
Parameters:
- Probability Threshold: Minimum probability required for signal generation (0.6-1.0)
- Volume Threshold: Required volume multiplication factor (1.0-3.0)
Visual Feedback:
- Green line: Bullish probability
- Red line: Bearish probability
- Gray dashed line: Threshold level
- Large green/red arrows: High-probability signals
- Detailed information table showing current probabilities and signals
Usage Tips:
1. Higher threshold values generate fewer but potentially more reliable signals
2. Look for confluence between probability scores and volume confirmation
3. Use in conjunction with your regular trading strategy for confirmation
4. Best used on timeframes 15m and above for more reliable patterns
Warning:
Past performance does not guarantee future results. This indicator should be used as part of a complete trading strategy with proper risk management.
FCPO First 5-Min Candle Box [Arrukes]How It Works:
Session Detection:
Identifies the morning (10:30 AM to 12:30 PM), evening (2:30 PM to 6:00 PM), and night (9:00 PM to 11:30 PM) sessions based on FCPO market session.
First 5-Minute Candle: Important area to mark as support and resistance zone to entry or sell.
It captures the high and low of the first 5-minute candle in each session.
Box Creation:
After identifying the high and low, it plots a box (colored by session type) around the first 5-minute candle.
Blue for the morning session.
Orange for the evening session.
Red for the night session.
Reset at Session Start:
The high and low values are reset at the start of each session, ensuring the box is drawn only for the first 5 minutes of each.
EMA 10 & 21 with Dynamic Support & Resistance [Arrukes]Description :
This indicator combines two popular tools in technical analysis: Exponential Moving Averages (EMA) and dynamic Support & Resistance (S&R) levels. It's designed to help traders identify key trends, potential entry/exit points, and critical price levels for better decision-making.
Features :
Exponential Moving Averages (EMA):
Plots 10-period (blue) and 21-period (orange) EMAs to highlight the trend direction and crossover signals.
Dynamic Support & Resistance Lines:
Automatically detects and plots the highest high (resistance) and lowest low (support) over a customizable lookback period.
Resistance levels are shown as red lines for bearish areas.
Support levels are shown as green lines for bullish areas.
Customizable Settings:
Adjust the lookback period to tailor the sensitivity of the support and resistance levels.
Change colors and line thickness to suit your style.
Real-Time Updates:
Levels dynamically adjust to new price data, keeping your analysis relevant.
How to Use:
Trend Analysis:
Use the EMA lines to identify the market's direction.
Bullish when the 10 EMA is above the 21 EMA; bearish when the reverse occurs.
Key Price Levels:
Look for price reactions around the plotted support and resistance levels.
Breakouts or rejections at these levels can signal potential trades.
Combine with Other Tools:
Enhance this indicator by pairing it with oscillators, volume analysis, or candlestick patterns for confirmation.
Ideal For:
1.Swing traders looking for key price levels.
2.Day traders who need dynamic S&R updates.
3.Beginners learning to analyze trends and price action.
Mark 55 and 00 Minute Candles//@version=5
indicator("Mark 55 and 00 Minute Candles", overlay=true)
// Get current time in minutes
var color highlightColor = color.new(color.red, 80) // Adjust transparency as needed
minute = (hour(timenow) * 60) + minute(timenow)
// Check if it's the 55th or 00th minute
isSpecialCandle = (minute % 60 == 55) or (minute % 60 == 0)
// Highlight the special candles
bgcolor(isSpecialCandle ? highlightColor : na)
DeepSignalFilterHelpersLibrary "DeepSignalFilterHelpers"
filter_intraday_intensity(useIiiFilter)
Parameters:
useIiiFilter (bool)
filter_vwma(src, length, useVwmaFilter)
Parameters:
src (float)
length (int)
useVwmaFilter (bool)
filter_nvi(useNviFilter)
Parameters:
useNviFilter (bool)
filter_emv(length, emvThreshold, useEmvFilter, useMovingAvg)
EMV filter for filtering signals based on Ease of Movement
Parameters:
length (int) : The length of the EMV calculation
emvThreshold (float) : The EMV threshold
useEmvFilter (bool) : Whether to apply the EMV filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_adi(length, threshold, useAdiFilter, useMovingAvg)
ADI filter for filtering signals based on Accumulation/Distribution Index
Parameters:
length (int) : The length of the ADI moving average calculation
threshold (float) : The ADI threshold
useAdiFilter (bool) : Whether to apply the ADI filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_mfi(length, mfiThreshold, useMfiFilter, useMovingAvg)
MFI filter for filtering signals based on Money Flow Index
Parameters:
length (int) : The length of the MFI calculation
mfiThreshold (float) : The MFI threshold
useMfiFilter (bool) : Whether to apply the MFI filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
detect_obv_states(obvThresholdStrong, obvThresholdModerate, lookbackPeriod, obvMode)
detect_obv_states: Identify OBV states with three levels (Strong, Moderate, Weak) over a configurable period
Parameters:
obvThresholdStrong (float) : Threshold for strong OBV movements
obvThresholdModerate (float) : Threshold for moderate OBV movements
lookbackPeriod (int) : Number of periods to analyze OBV trends
obvMode (string) : OBV mode to filter ("Strong", "Moderate", "Weak")
Returns: OBV state ("Strong Up", "Moderate Up", "Weak Up", "Positive Divergence", "Negative Divergence", "Consolidation", "Weak Down", "Moderate Down", "Strong Down")
filter_obv(src, length, obvMode, threshold, useObvFilter, useMovingAvg)
filter_obv: Filter signals based on OBV states
Parameters:
src (float) : The source series (default: close)
length (int) : The length of the OBV moving average calculation
obvMode (string) : OBV mode to filter ("Strong", "Moderate", "Weak")
threshold (float) : Optional threshold for additional filtering
useObvFilter (bool) : Whether to apply the OBV filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_cmf(length, cmfThreshold, useCmfFilter, useMovingAvg)
CMF filter for filtering signals based on Chaikin Money Flow
Parameters:
length (int) : The length of the CMF calculation
cmfThreshold (float) : The CMF threshold
useCmfFilter (bool) : Whether to apply the CMF filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_vwap(useVwapFilter)
VWAP filter for filtering signals based on Volume-Weighted Average Price
Parameters:
useVwapFilter (bool) : Whether to apply the VWAP filter
Returns: Filtered result indicating whether the signal should be used
filter_pvt(length, pvtThreshold, usePvtFilter, useMovingAvg)
PVT filter for filtering signals based on Price Volume Trend
Parameters:
length (int) : The length of the PVT moving average calculation
pvtThreshold (float) : The PVT threshold
usePvtFilter (bool) : Whether to apply the PVT filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_vo(shortLength, longLength, voThreshold, useVoFilter, useMovingAvg)
VO filter for filtering signals based on Volume Oscillator
Parameters:
shortLength (int) : The length of the short-term volume moving average
longLength (int) : The length of the long-term volume moving average
voThreshold (float) : The Volume Oscillator threshold
useVoFilter (bool) : Whether to apply the VO filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_cho(shortLength, longLength, choThreshold, useChoFilter, useMovingAvg)
CHO filter for filtering signals based on Chaikin Oscillator
Parameters:
shortLength (int) : The length of the short-term ADI moving average
longLength (int) : The length of the long-term ADI moving average
choThreshold (float) : The Chaikin Oscillator threshold
useChoFilter (bool) : Whether to apply the CHO filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_fi(length, fiThreshold, useFiFilter, useMovingAvg)
FI filter for filtering signals based on Force Index
Parameters:
length (int) : The length of the FI calculation
fiThreshold (float) : The Force Index threshold
useFiFilter (bool) : Whether to apply the FI filter
useMovingAvg (bool) : Whether to use moving average as threshold
Returns: Filtered result indicating whether the signal should be used
filter_garman_klass_volatility(length, useGkFilter)
Parameters:
length (int)
useGkFilter (bool)
filter_frama(src, length, useFramaFilter)
Parameters:
src (float)
length (int)
useFramaFilter (bool)
filter_bollinger_bands(src, length, stdDev, useBollingerFilter)
Parameters:
src (float)
length (int)
stdDev (float)
useBollingerFilter (bool)
filter_keltner_channel(src, length, atrMult, useKeltnerFilter)
Parameters:
src (float)
length (simple int)
atrMult (float)
useKeltnerFilter (bool)
regime_filter(src, threshold, useRegimeFilter)
Regime filter for filtering signals based on trend strength
Parameters:
src (float) : The source series
threshold (float) : The threshold for the filter
useRegimeFilter (bool) : Whether to apply the regime filter
Returns: Filtered result indicating whether the signal should be used
regime_filter_v2(src, threshold, useRegimeFilter)
Regime filter for filtering signals based on trend strength
Parameters:
src (float) : The source series
threshold (float) : The threshold for the filter
useRegimeFilter (bool) : Whether to apply the regime filter
Returns: Filtered result indicating whether the signal should be used
filter_adx(src, length, adxThreshold, useAdxFilter)
ADX filter for filtering signals based on ADX strength
Parameters:
src (float) : The source series
length (simple int) : The length of the ADX calculation
adxThreshold (int) : The ADX threshold
useAdxFilter (bool) : Whether to apply the ADX filter
Returns: Filtered result indicating whether the signal should be used
filter_volatility(minLength, maxLength, useVolatilityFilter)
Volatility filter for filtering signals based on volatility
Parameters:
minLength (simple int) : The minimum length for ATR calculation
maxLength (simple int) : The maximum length for ATR calculation
useVolatilityFilter (bool) : Whether to apply the volatility filter
Returns: Filtered result indicating whether the signal should be used
filter_ulcer(src, length, ulcerThreshold, useUlcerFilter)
Ulcer Index filter for filtering signals based on Ulcer Index
Parameters:
src (float) : The source series
length (int) : The length of the Ulcer Index calculation
ulcerThreshold (float) : The Ulcer Index threshold (default: average Ulcer Index)
useUlcerFilter (bool) : Whether to apply the Ulcer Index filter
Returns: Filtered result indicating whether the signal should be used
filter_stddev(src, length, stdDevThreshold, useStdDevFilter)
Standard Deviation filter for filtering signals based on Standard Deviation
Parameters:
src (float) : The source series
length (int) : The length of the Standard Deviation calculation
stdDevThreshold (float) : The Standard Deviation threshold (default: average Standard Deviation)
useStdDevFilter (bool) : Whether to apply the Standard Deviation filter
Returns: Filtered result indicating whether the signal should be used
filter_macdv(src, shortLength, longLength, signalSmoothing, macdVThreshold, useMacdVFilter)
MACD-V filter for filtering signals based on MACD-V
Parameters:
src (float) : The source series
shortLength (simple int) : The short length for MACD calculation
longLength (simple int) : The long length for MACD calculation
signalSmoothing (simple int) : The signal smoothing length for MACD
macdVThreshold (float) : The MACD-V threshold (default: average MACD-V)
useMacdVFilter (bool) : Whether to apply the MACD-V filter
Returns: Filtered result indicating whether the signal should be used
filter_atr(length, atrThreshold, useAtrFilter)
ATR filter for filtering signals based on Average True Range (ATR)
Parameters:
length (simple int) : The length of the ATR calculation
atrThreshold (float) : The ATR threshold (default: average ATR)
useAtrFilter (bool) : Whether to apply the ATR filter
Returns: Filtered result indicating whether the signal should be used
filter_candle_body_and_atr(length, bodyThreshold, atrThreshold, useFilter)
Candle Body and ATR filter for filtering signals
Parameters:
length (simple int) : The length of the ATR calculation
bodyThreshold (float) : The threshold for candle body size (relative to ATR)
atrThreshold (float) : The ATR threshold (default: average ATR)
useFilter (bool) : Whether to apply the candle body and ATR filter
Returns: Filtered result indicating whether the signal should be used
filter_atrp(length, atrpThreshold, useAtrpFilter)
ATRP filter for filtering signals based on ATR Percentage (ATRP)
Parameters:
length (simple int) : The length of the ATR calculation
atrpThreshold (float) : The ATRP threshold (default: average ATRP)
useAtrpFilter (bool) : Whether to apply the ATRP filter
Returns: Filtered result indicating whether the signal should be used
filter_jma(src, length, phase, useJmaFilter)
Parameters:
src (float)
length (simple int)
phase (float)
useJmaFilter (bool)
filter_cidi(src, rsiLength, shortMaLength, longMaLength, useCidiFilter)
Parameters:
src (float)
rsiLength (simple int)
shortMaLength (int)
longMaLength (int)
useCidiFilter (bool)
filter_rsi(src, length, rsiThreshold, useRsiFilter)
Parameters:
src (float)
length (simple int)
rsiThreshold (float)
useRsiFilter (bool)
filter_ichimoku_oscillator(length, threshold, useFilter)
Ichimoku Oscillator filter for filtering signals based on Ichimoku Oscillator
Parameters:
length (int) : The length of the Ichimoku Oscillator calculation
threshold (float) : The threshold for the filter (default: average Ichimoku Oscillator)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_cmb_composite_index(src, shortLength, longLength, threshold, useFilter)
CMB Composite Index filter for filtering signals based on CMB Composite Index
Parameters:
src (float) : The source series
shortLength (simple int) : The short length for CMB calculation
longLength (simple int) : The long length for CMB calculation
threshold (float) : The threshold for the filter (default: average CMB Composite Index)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_connors_rsi(src, rsiLength, rocLength, streakLength, threshold, useFilter)
Connors RSI filter for filtering signals based on Connors RSI
Parameters:
src (float) : The source series
rsiLength (simple int) : The length for RSI calculation
rocLength (int) : The length for ROC calculation
streakLength (simple int) : The length for streak calculation
threshold (float) : The threshold for the filter (default: average Connors RSI)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_coppock_curve(src, roc1Length, roc2Length, wmaLength, threshold, useFilter)
Coppock Curve filter for filtering signals based on Coppock Curve
Parameters:
src (float) : The source series
roc1Length (int) : The length for the first ROC calculation
roc2Length (int) : The length for the second ROC calculation
wmaLength (int) : The length for the WMA calculation
threshold (float) : The threshold for the filter (default: average Coppock Curve)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_pmo(src, pmoLength, smoothingLength, threshold, useFilter)
DecisionPoint Price Momentum Oscillator filter for filtering signals based on PMO
Parameters:
src (float) : The source series
pmoLength (simple int) : The length for PMO calculation
smoothingLength (simple int) : The smoothing length for PMO
threshold (float) : The threshold for the filter (default: average PMO Oscillator)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_macd(src, shortLength, longLength, signalSmoothing, threshold, useFilter)
MACD filter for filtering signals based on MACD
Parameters:
src (float) : The source series
shortLength (simple int) : The short length for MACD calculation
longLength (simple int) : The long length for MACD calculation
signalSmoothing (simple int) : The signal smoothing length for MACD
threshold (float) : The threshold for the filter (default: average MACD)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_macd_histogram(src, shortLength, longLength, signalSmoothing, threshold, useFilter)
MACD-Histogram filter for filtering signals based on MACD-Histogram
Parameters:
src (float) : The source series
shortLength (simple int) : The short length for MACD calculation
longLength (simple int) : The long length for MACD calculation
signalSmoothing (simple int) : The signal smoothing length for MACD
threshold (float) : The threshold for the filter (default: average MACD-Histogram)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_kst(src, r1, r2, r3, r4, sm1, sm2, sm3, sm4, signalLength, threshold, useFilter)
Pring's Know Sure Thing filter for filtering signals based on KST
Parameters:
src (float) : The source series
r1 (int) : The first ROC length
r2 (int) : The second ROC length
r3 (int) : The third ROC length
r4 (int) : The fourth ROC length
sm1 (int) : The first smoothing length
sm2 (int) : The second smoothing length
sm3 (int) : The third smoothing length
sm4 (int) : The fourth smoothing length
signalLength (int) : The signal line smoothing length
threshold (float) : The threshold for the filter (default: average KST Oscillator)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_special_k(src, r1, r2, r3, r4, sm1, sm2, sm3, sm4, threshold, useFilter)
Pring's Special K filter for filtering signals based on Special K
Parameters:
src (float) : The source series
r1 (int) : The first ROC length
r2 (int) : The second ROC length
r3 (int) : The third ROC length
r4 (int) : The fourth ROC length
sm1 (int) : The first smoothing length
sm2 (int) : The second smoothing length
sm3 (int) : The third smoothing length
sm4 (int) : The fourth smoothing length
threshold (float) : The threshold for the filter (default: average Special K)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_roc_momentum(src, rocLength, momentumLength, threshold, useFilter)
ROC and Momentum filter for filtering signals based on ROC and Momentum
Parameters:
src (float) : The source series
rocLength (int) : The length for ROC calculation
momentumLength (int) : The length for Momentum calculation
threshold (float) : The threshold for the filter (default: average ROC and Momentum)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_rrg_relative_strength(src, length, threshold, useFilter)
RRG Relative Strength filter for filtering signals based on RRG Relative Strength
Parameters:
src (float) : The source series
length (int) : The length for RRG Relative Strength calculation
threshold (float) : The threshold for the filter (default: average RRG Relative Strength)
useFilter (bool) : Whether to apply the filter
Returns: Filtered result indicating whether the signal should be used
filter_alligator(useFilter)
Parameters:
useFilter (bool)
filter_wyckoff(useFilter)
Parameters:
useFilter (bool)
filter_squeeze_momentum(bbLength, bbStdDev, kcLength, kcMult, useFilter)
Parameters:
bbLength (int)
bbStdDev (float)
kcLength (simple int)
kcMult (float)
useFilter (bool)
filter_atr_compression(length, atrThreshold, useFilter)
Parameters:
length (simple int)
atrThreshold (float)
useFilter (bool)
filter_low_volume(length, useFilter)
Parameters:
length (int)
useFilter (bool)
filter_nvi_accumulation(useFilter)
Parameters:
useFilter (bool)
filter_ma_slope(src, length, slopeThreshold, useFilter)
Parameters:
src (float)
length (int)
slopeThreshold (float)
useFilter (bool)
filter_adx_low(len, lensig, adxThreshold, useFilter)
Parameters:
len (simple int)
lensig (simple int)
adxThreshold (int)
useFilter (bool)
filter_choppiness_index(length, chopThreshold, useFilter)
Parameters:
length (int)
chopThreshold (float)
useFilter (bool)
filter_range_detection(length, useFilter)
Parameters:
length (int)
useFilter (bool)
Eze Profit Range Detection FilterThe Range Detection Filter is a technical analysis tool designed to help traders identify range-bound market conditions and focus on breakout opportunities. It combines the ATR (Average True Range) for volatility analysis and the ADX (Average Directional Index) for trend strength evaluation to highlight consolidation phases and alert traders when the market is ready to break out.
This indicator provides visual cues and customizable alerts, making it suitable for traders looking to avoid false signals during choppy markets and capitalize on trending moves following a breakout.
What Makes It Unique?
ATR for Volatility:
Measures market volatility by comparing ATR with its moving average.
Consolidation phases are flagged when ATR remains below its moving average for a sustained period.
ADX for Trend Strength:
Monitors trend strength, confirming range-bound conditions when ADX falls below a user-defined threshold (default: 20).
Combines with ATR to ensure accurate detection of trendless periods.
Breakout Alerts:
Notifies traders of breakout opportunities when the price moves outside the highest high or lowest low of the range.
How It Works:
Range Detection:
The market is considered "in range" when:
ATR is below its moving average, indicating low volatility.
ADX is below the threshold, confirming a lack of trend strength.
Visual Indication:
A yellow background highlights range-bound conditions, allowing traders to avoid low-probability trades.
Breakout Detection:
Alerts are triggered for breakouts above or below the range to help traders identify potential opportunities.
Features:
Range Highlighting:
Automatically detects and highlights range-bound markets using a yellow background.
Breakout Alerts:
Sends alerts for breakouts above or below the range once the market exits consolidation.
Customizable Inputs:
ATR length, moving average length, and ADX parameters are fully adjustable to adapt to various trading styles and asset classes.
Multi-Timeframe Compatibility:
Suitable for all markets and timeframes, including stocks, forex, and cryptocurrencies.
How to Use:
Identify Ranges:
Avoid trading when the yellow background appears, signaling a range-bound market.
Focus on Breakouts:
Look for alerts indicating breakouts above or below the range for potential trending opportunities.
Combine with Other Indicators:
Use volume analysis, momentum oscillators, or candlestick patterns to confirm breakout signals.
Credits:
This script utilizes widely accepted methodologies for ATR and ADX calculations. ADX is calculated manually using directional movement (+DI and -DI) for precise trend detection. The concept has been adapted and enhanced to create this comprehensive range-detection tool.
Notes:
This indicator is intended for educational purposes and should not be used as standalone financial advice.
Always incorporate this tool into a broader trading strategy for optimal results.
Divides company with IndexOverview:
This indicator simplifies the comparison of a stock's performance against a specified index, such as the Nifty 50. By calculating and plotting the ratio between the two, it provides a clear visual representation of relative strength.
Key Features:
-Direct Comparison: Easily compare any stock against a selected index.
-Customizable Index: Choose from a dropdown menu or input a custom index symbol.
-Visual Clarity: Maximizing the chart provides a clear view of the relative performance.
-SMA Overlay: Add a Simple Moving Average (SMA) to identify trends and potential entry/exit
points.
-Customizable Appearance: Adjust background color, text color, and label size for personalized
visualization.
How to Use:
Add the Indicator: Add the indicator to your chart.
Select the Index: Choose the desired index from the dropdown menu or input a custom symbol.
Analyze the Ratio:
-A rising ratio indicates the stock is outperforming the index.
-A falling ratio suggests underperformance.
-The SMA can help identify potential trends and momentum.
Customize the Appearance: Adjust the background color, text color, and label size to suit your preferences.
Benefits:
-Improved Decision Making: Gain insights into a stock's relative strength.
-Faster Analysis: Quickly compare multiple stocks against a benchmark index.
-Enhanced Visualization: Customize the chart for better understanding.
-By leveraging this indicator, you can make informed trading decisions and gain a deeper
understanding of market dynamics.
QuantifyPS - 1Library "QuantifyPS"
normdist(z)
Parameters:
z (float) : (float): The z-score for which the CDF is to be calculated.
Returns: (float): The cumulative probability corresponding to the input z-score.
Notes:
- Uses an approximation method for the normal distribution CDF, which is computationally efficient.
- The result is accurate for most practical purposes but may have minor deviations for extreme values of `z`.
Formula:
- Based on the approximation formula:
`Φ(z) ≈ 1 - f(z) * P(t)` if `z > 0`, otherwise `Φ(z) ≈ f(z) * P(t)`,
where:
`f(z) = 0.3989423 * exp(-z^2 / 2)` (PDF of standard normal distribution)
`P(t) = Σ [c * t^i]` with constants `c` and `t = 1 / (1 + 0.2316419 * |z|)`.
Implementation details:
- The approximation uses five coefficients for the polynomial part of the CDF.
- Handles both positive and negative values of `z` symmetrically.
Constants:
- The coefficients and scaling factors are chosen to minimize approximation errors.
gamma(x)
Parameters:
x (float) : (float): The input value for which the Gamma function is to be calculated.
Must be greater than 0. For x <= 0, the function returns `na` as it is undefined.
Returns: (float): Approximation of the Gamma function for the input `x`.
Notes:
- The Lanczos approximation provides a numerically stable and efficient method to compute the Gamma function.
- The function is not defined for `x <= 0` and will return `na` in such cases.
- Uses precomputed Lanczos coefficients for accuracy.
- Includes handling for small numerical inaccuracies.
Formula:
- The Gamma function is approximated as:
`Γ(x) ≈ sqrt(2π) * t^(x + 0.5) * e^(-t) * Σ(p / (x + k))`
where `t = x + g + 0.5` and `p` is the array of Lanczos coefficients.
Implementation details:
- Lanczos coefficients (`p`) are precomputed and stored in an array.
- The summation iterates over these coefficients to compute the final result.
- The constant `g` controls the precision of the approximation (commonly `g = 7`).
t_cdf(t, df)
Parameters:
t (float) : (float): The t-statistic for which the CDF value is to be calculated.
df (int) : (int): Degrees of freedom of the t-distribution.
Returns: (float): Approximate CDF value for the given t-statistic.
Notes:
- This function computes a one-tailed p-value.
- Relies on an approximation formula using gamma functions and standard t-distribution properties.
- May not be as accurate as specialized statistical libraries for extreme values or very high degrees of freedom.
Formula:
- Let `x = df / (t^2 + df)`.
- The approximation formula is derived using:
`CDF(t, df) ≈ 1 - * x^((df + 1) / 2) / 2`,
where Γ represents the gamma function.
Implementation details:
- Computes the gamma ratio for normalization.
- Applies the t-distribution formula for one-tailed probabilities.
tStatForPValue(p, df)
Parameters:
p (float) : (float): P-value for which the t-statistic needs to be calculated.
Must be in the interval (0, 1).
df (int) : (int): Degrees of freedom of the t-distribution.
Returns: (float): The t-statistic corresponding to the given p-value.
Notes:
- If `p` is outside the interval (0, 1), the function returns `na` as an error.
- The function uses binary search with a fixed number of iterations and a defined tolerance.
- The result is accurate to within the specified tolerance (default: 0.0001).
- Relies on the cumulative density function (CDF) `t_cdf` for the t-distribution.
Formula:
- Uses the cumulative density function (CDF) of the t-distribution to iteratively find the t-statistic.
Implementation details:
- `low` and `high` define the search interval for the t-statistic.
- The midpoint (`mid`) is iteratively refined until the difference between the cumulative probability
and the target p-value is smaller than the tolerance.
jarqueBera(n, s, k)
Parameters:
n (float) : (series float): Number of observations in the dataset.
s (float) : (series float): Skewness of the dataset.
k (float) : (series float): Kurtosis of the dataset.
Returns: (float): The Jarque-Bera test statistic.
Formula:
JB = n *
Notes:
- A higher JB value suggests that the data deviates more from a normal distribution.
- The test is asymptotically distributed as a chi-squared distribution with 2 degrees of freedom.
- Use this value to calculate a p-value to determine the significance of the result.
skewness(data)
Parameters:
data (float) : (series float): Input data series.
Returns: (float): The skewness value.
Notes:
- Handles missing values (`na`) by ignoring invalid points.
- Includes error handling for zero variance to avoid division-by-zero scenarios.
- Skewness is calculated as the normalized third central moment of the data.
kurtosis(data)
Parameters:
data (float) : (series float): Input data series.
Returns: (float): The kurtosis value.
Notes:
- Handles missing values (`na`) by ignoring invalid points.
- Includes error handling for zero variance to avoid division-by-zero scenarios.
- Kurtosis is calculated as the normalized fourth central moment of the data.
regression(y, x, lag)
Parameters:
y (float) : (series float): Dependent series (observed values).
x (float) : (series float): Independent series (explanatory variable).
lag (int) : (int): Number of lags applied to the independent series (x).
Returns: (tuple): Returns a tuple containing the following values:
- n: Number of valid observations.
- alpha: Intercept of the regression line.
- beta: Slope of the regression line.
- t_stat: T-statistic for the beta coefficient.
- p_value: Two-tailed p-value for the beta coefficient.
- r_squared: Coefficient of determination (R²) indicating goodness of fit.
- skew: Skewness of the residuals.
- kurt: Kurtosis of the residuals.
Notes:
- Handles missing data (`na`) by ignoring invalid points.
- Includes basic error handling for zero variance and division-by-zero scenarios.
- Computes residual-based statistics (skewness and kurtosis) for model diagnostics.
OutofOptionsHelperLibraryLibrary "OutofOptionsHelperLibrary"
Helper library for my indicators/strategies
isUp(i)
is Up candle
Parameters:
i (int)
Returns: bool
isDown(i)
is Down candle
Parameters:
i (int)
Returns: bool
TF(t)
format time into date/time string
Parameters:
t (int)
Returns: string
S(s)
format data to string
Parameters:
s (float)
Returns: string
S(s)
format data to string
Parameters:
s (int)
Returns: string
S(s)
format data to string
Parameters:
s (bool)
Returns: string
barClose(price, up, strict)
Determine if candle closed above/below price
Parameters:
price (float)
up (bool)
strict (bool) : bool if close over is required or if close at the price is good enough
Returns: bool
processSweep(L, price, up, leftB)
Determine how many liquidity sweeps were made
Parameters:
L (array)
price (float)
up (bool)
leftB (int)
Returns: int
liquidity
Fields:
price (series float)
time (series int)
oprice (series float)
otime (series int)
sweeps (series int)
bars_swept (series int)
FRAMA Channel [BigBeluga]This is a trend-following indicator that utilizes the Fractal Adaptive Moving Average (FRAMA) to create a dynamic channel around the price. The FRAMA Channel helps identify uptrends, downtrends, and ranging markets by examining the relationship between the price and the channel's boundaries. It also marks trend changes with arrows, optionally displaying either price values or average volume at these key points.
🔵 IDEA
The core idea behind the FRAMA Channel indicator is to use the fractal nature of markets to adapt to different market conditions. By creating a channel around the FRAMA line, it not only tracks price trends but also adapts its sensitivity based on market volatility. When the price crosses the upper or lower bands of the channel, it signals a potential shift in trend direction. If the price remains within the channel and crosses over the upper or lower bands without a breakout, the market is likely in a ranging phase with low momentum. This adaptive approach makes the FRAMA Channel effective in both trending and ranging market environments.
🔵 KEY FEATURES & USAGE
◉ Dynamic FRAMA Channel with Trend Signals:
The FRAMA Channel uses a fractal-based moving average to create an adaptive channel around the price. When the price crosses above the upper band, it signals an uptrend and plots an upward arrow with the price (or average volume) value. Conversely, when the price crosses below the lower band, it signals a downtrend and marks the point with a downward arrow. This dynamic adaptation to market conditions helps traders identify key trend shifts effectively.
◉ Ranging Market Detection:
If the price remains within the channel, and only the high crosses the upper band or the low crosses the lower band, the indicator identifies a ranging market with low momentum. In this case, the channel turns gray, signaling a neutral trend. This is particularly useful for avoiding false signals during periods of market consolidation.
◉ Color-Coded Candles and Channel Bands:
Candles and channel bands are color-coded to reflect the current trend direction. Green indicates an upward trend, blue shows a downward trend, and gray signals a neutral or ranging market. This visual representation makes it easy to identify the market condition at a glance, helping traders make informed decisions quickly.
◉ Customizable Display of Price or Average Volume:
On trend change signals, the indicator allows users to choose whether to display the price at the point of trend change or the average volume of 10 bars. This flexibility enables traders to focus on the information that is most relevant to their strategy, whether it's the exact price entery or the volume context of the market shift. Displaying the average volume allows to see the strength of the trend change.
Price Data:
Average Volume of points:
🔵 CUSTOMIZATION
Length & Bands Distance: Adjust the length for the FRAMA calculation to control the sensitivity of the channel. A shorter length makes the channel more reactive to price changes, while a longer length smooths it out. The Bands Distance setting determines how far the bands are from the FRAMA line, helping to define the breakout and ranging conditions.
Signals Data: Choose between displaying the price or the average volume on trend change arrows. This allows traders to focus on either the exact price level of trend change or the market volume context.
Color Settings: Customize the colors for upward momentum, downward momentum, and neutral states to suit your charting preferences. You can also toggle whether to color the candles based on the momentum for a clearer visual of the trend direction.
The FRAMA Channel indicator adapts to market conditions, providing a versatile tool for identifying trends and ranging markets with clear visual cues.
ICT Macro Sessions by @zeusbottradingICT Macro Sessions Indicator
The ICT Macro Sessions Indicator is a powerful tool designed for traders who follow the ICT (Inner Circle Trader) methodology and want to optimize their trading during specific high-probability time intervals. This indicator highlights all the key macro sessions throughout the trading day in the GMT+8 (Hong Kong) time zone.
What Does the Indicator Do?
This indicator visually marks ICT Macro Sessions on your trading chart using background colors and optional labels. Each session corresponds to specific time intervals when institutional activity is most likely to drive price action. By focusing on these periods, traders can align their strategies with market volatility and liquidity, increasing their chances of success.
Highlighted Sessions
The indicator covers all major ICT Macro Sessions, each with a unique color for easy identification:
London Macro 1 (15:33–16:00 GMT+8):
- Marks the early London session, often characterized by strong directional moves.
London Macro 2 (17:03–17:30 GMT+8):
- Captures the mid-London session, where price frequently reacts to liquidity levels.
New York AM Macro 1 (22:50–23:10 GMT+8):
- Highlights the start of the New York session, a prime time for price reversals or continuations.
New York AM Macro 2 (23:50–00:10 GMT+8):
- Focuses on late-morning New York activity, often aligning with key news releases.
New York Lunch Macro (00:50–01:10 GMT+8):
- Covers the lunch period in New York, where price may consolidate or set up for afternoon moves.
New York PM Macro 1 (02:10–02:40 GMT+8):
- Tracks post-lunch activity in New York, often featuring renewed volatility.
New York PM Macro 2 (04:15–04:45 GMT+8):
- Captures late-session moves as institutional traders finalize their positions.
Features of the Indicator
Fixed Time: The indicator is pre-configured for GMT+8 but it will adapt automatically to your timezone. No need to change anything in the code.
Background Highlighting: Each session is visually marked with a unique background color for quick recognition.
Optional Labels: Traders can enable or disable labels for each session, providing flexibility in how information is displayed.
Session Toggles: You can choose which sessions to display based on your trading preferences and strategy.
Intraday Timeframes: The indicator is optimized for intraday charts with timeframes of 45 minutes or less. You can change it to anything you like.
Why Use This Indicator?
The ICT Macro Sessions Indicator helps traders focus on the most critical times of the trading day when institutional activity is at its peak. These periods often coincide with significant price movements, making them ideal for scalping, day trading, or even swing trading setups. By visually highlighting these sessions, the indicator eliminates guesswork and allows traders to plan their trades with precision.
2 bars BarsInputs:
The script allows you to specify the values for each state (HH, HL, LL, LH) for two bars.
Labels as Bars:
Instead of line.new, this script uses label.new to simulate a pseudo-bar chart.
Bars are visually represented as labels, with distinct positions and colors.
Offset Logic:
The offset ensures that each category has its labels (bars) placed at the correct horizontal distance.
Custom Categories:
The categories array ("HH", "HL", "LL", "LH") links to their respective values.
DB369 - Directional Bias 369
DB369 - Directional Bias 369 Indicator
The **DB369** indicator helps traders identify key market levels and trends by combining multiple timeframes' price action analysis. It highlights important **pivot points** on the chart and provides visual cues to help you make more informed buy and sell decisions based on the overall market direction.
Key Features
1. Pivot Points Across Multiple Timeframes**:
- The indicator calculates and displays pivot points for the **Monthly**, **Weekly**, **Daily**, **4-Hour**, and **1-Hour** timeframes (or 30-minute equivalent if desired). These pivots represent significant price levels where the market may retest.
2. **Trend Detection**:
- The indicator evaluates the relationship between the current price and the pivot point for each timeframe. Based on this comparison, it classifies the market as **Bullish**, **Bearish**, or **Neutral** on each timeframe.
3. **Pivot Lines**:
- Horizontal lines are drawn to mark the key pivot points for each selected timeframe. These lines extend into the future and adjust dynamically as the market moves in real time.
- **Customizable**: You can choose which timeframes to display pivot points by enabling/disabling them in the settings.
4. **Trend Table**:
- A **table** is displayed at the top-right of the chart to show the trend for the **Daily**, **4-Hour**, and **30-Minute** timeframes. It provides an easy-to-read view of the trend direction across these timeframes.
5. **Buy/Sell Arrows**:
- **Buy Arrow**: A green arrow will appear when the **Daily**, **4-Hour**, and **30-Minute** trends are all **Bullish** (aligned in the same direction).
- **Sell Arrow**: A red arrow will appear when all three timeframes show a **Bearish** trend.
- These arrows appear only once per alignment change and can be enabled or disabled for alerts. This helps avoid clutter on the chart and ensures that you only see a signal when the alignment occurs or changes.
### **How to Use the DB369 Indicator**:
1. **Pivot Points**:
- The pivot points represent significant price levels where the market might retest in the future. For instance:
- **Bullish Market**: If the price is above the pivot point, the market is considered bullish.
- **Bearish Market**: If the price is below the pivot point, the market is considered bearish.
- **Neutral Market**: When the price is near the pivot point, the market is neither strongly bullish nor bearish.
2. **Trend Alignment**:
- When the **Daily**, **4-Hour**, and **30-Minute** timeframes all show the same trend direction (either **Bullish** or **Bearish**), this alignment signifies a stronger trend.
- You will receive a **Buy Arrow** when all three timeframes are aligned bullish, and a **Sell Arrow** when they are aligned bearish.
- These arrows are displayed at the point when the alignment is first detected and can also trigger **alerts**.
3. **Alerts**:
- You can choose to enable alerts for when a **Buy** or **Sell** arrow appears on the chart. This allows you to be notified in real-time when the alignment conditions are met.
4. **Using the Pivot Points for Entry**:
- **Buy Trade**: Look for a buy trade when the price is near the **pivot line** of the higher timeframes, particularly when the trend across all three timeframes is **Bullish**.
- **Sell Trade**: Similarly, look for a sell trade when the price is near a **pivot line** and the trend is **Bearish**.
5. **Customization**:
- You can customize which timeframes' pivots are shown on the chart by toggling the visibility of the **Monthly**, **Weekly**, **Daily**, **4-Hour**, and **1-Hour** pivots in the settings.
- The indicator automatically adjusts the pivot levels in real-time as the market progresses.
**Important Notes**:
- This indicator does not guarantee successful trades; it is intended to assist in identifying potential trade opportunities based on the alignment of higher timeframe trends.
- Always combine the information from the DB369 indicator with other technical analysis tools and risk management strategies to ensure more accurate trade decisions.
Optimized Grid with KNN_2.0Strategy Overview
This strategy, named "Optimized Grid with KNN_2.0," is designed to optimize trading decisions using a combination of grid trading, K-Nearest Neighbors (KNN) algorithm, and a greedy algorithm. The strategy aims to maximize profits by dynamically adjusting entry and exit thresholds based on market conditions and historical data.
Key Components
Grid Trading:
The strategy uses a grid-based approach to place buy and sell orders at predefined price levels. This helps in capturing profits from market fluctuations.
K-Nearest Neighbors (KNN) Algorithm:
The KNN algorithm is used to optimize entry and exit points based on historical price data. It identifies the nearest neighbors (similar price movements) and adjusts the thresholds accordingly.
Greedy Algorithm:
The greedy algorithm is employed to dynamically adjust the stop-loss and take-profit levels. It ensures that the strategy captures maximum profits by adjusting thresholds based on recent price changes.
Detailed Explanation
Grid Trading:
The strategy defines a grid of price levels where buy and sell orders are placed. The openTh and closeTh parameters determine the thresholds for opening and closing positions.
The t3_fast and t3_slow indicators are used to generate trading signals based on the crossover and crossunder of these indicators.
KNN Algorithm:
The KNN algorithm is used to find the nearest neighbors (similar price movements) in the historical data. It calculates the distance between the current price and historical prices to identify the most similar price movements.
The algorithm then adjusts the entry and exit thresholds based on the average change in price of the nearest neighbors.
Greedy Algorithm:
The greedy algorithm dynamically adjusts the stop-loss and take-profit levels based on recent price changes. It ensures that the strategy captures maximum profits by adjusting thresholds in real-time.
The algorithm uses the average_change variable to calculate the average price change of the nearest neighbors and adjusts the thresholds accordingly.
Correlation Confluence Trend IndicatorCorrelation Confluence Trend Indicator
Overview
The Correlation Confluence Trend Indicator combines exponential moving averages (EMAs) and statistical correlation measures to identify high-confidence trend alignments between an asset and a benchmark. By filtering signals through correlation strength, this indicator highlights opportunities when the asset and benchmark move together. In other words, it defines a trend and then uses correlation strength and the trend of a second asset to identify high-confidence trends.
Key Features
Dual EMA Trend Analysis :
Calculates fast and slow EMAs for both the asset and the selected benchmark (e.g., SPY) to identify bullish and bearish trends.
Correlation Strength Filtering :
Evaluates correlation between the asset and benchmark, identifying stronger-than-average relationships based on the mean and standard deviation.
Background Color Coding :
- Green : Strong correlation, both asset and benchmark bullish.
- Aqua : Weak correlation, both asset and benchmark bullish.
- Red : Strong correlation, both asset and benchmark bearish.
- Fuchsia : Weak correlation, both asset and benchmark bearish.
- Orange : Strong correlation, benchmark bullish, asset bearish.
- Yellow : Weak correlation, benchmark bullish, asset bearish.
- Purple : Strong correlation, benchmark bearish, asset bullish.
- Lime : Weak correlation, benchmark bearish, asset bullish.
Visual Trend Indicators :
Plots fast and slow EMAs for the asset, dynamically colored based on aggregate trend signals. The color of this corresponds to the main trend signal.
Inputs
Benchmark Symbol : Symbol of the benchmark asset to compare against.
Fast EMA Length : Period for the fast EMA calculation.
Slow EMA Length : Period for the slow EMA calculation.
Correlation Length : Number of bars for correlation calculation.
Correlation Mean Length : Number of bars for mean and standard deviation calculation.
Std Dev Multiplier : Multiplier for standard deviation to define correlation strength. When the correlation is Std Dev Multiplier standard deviations above the mean, it counts as a strong correlation.
Set Background Color : Toggle background coloring on or off.
Notes
This indicator is primarily designed for trend-following strategies. By combining trend analysis and correlation filtering, it ensures that signals occur during aligned market conditions, reducing false signals.
Before incorporating this indicator into your trading strategy:
Always backtest on historical data to evaluate its performance before committing capital.
Use proper risk management to control position sizes and mitigate potential losses.
Remember that no indicator guarantees success. I'm quite proud of this one, but it's not the holy grail.
Non-Psychological Levels🟩 Non-Psychological Levels is a structural analysis tool that segments price action into objective ranges, identifying Broken and Unbroken levels without relying on psychological or time-based assumptions. By emphasizing mechanically derived price behavior, it provides traders with a clear framework for analyzing support and resistance in a consistent and unbiased manner across various market conditions.
This indicator introduces a new approach to understanding market structure by focusing on price movement within defined segments, free from behavioral patterns, round numbers, or specific time intervals. While the indicator is time-agnostic in design, it works within the natural time progression of the chart, ensuring that segmentation aligns with the inherent structure of price movement. Broken levels, where price has breached a structural boundary, and Unbroken levels, which remain intact, are visualized with horizontal lines. These structural zones are complemented by dynamically boxed segments that contextualize both historical and ongoing price behavior.
By offering an objective perspective, the Non-Psychological Levels indicator complements psychology-based tools, helping traders explore market dynamics from multiple angles. When structural levels align with psychological zones, they reinforce critical price areas; when they differ, they provide opportunities to analyze price behavior from an alternative lens. This indicator is designed as both an educational framework and a practical tool, encouraging a deeper understanding of structural price behavior in technical analysis.
⭕ THEORY AND CONCEPT ⭕
The Non-Psychological Levels indicator is grounded in the principle of analyzing price behavior without reliance on psychological assumptions or time-based factors. Its primary purpose is to provide a structural framework for identifying support and resistance levels by focusing solely on price movement within mechanically defined segments. By removing external influences such as sentiment, time intervals, or market sessions, the indicator offers an unbiased lens through which traders can observe price dynamics.
Non-psychology, as defined here, refers to an approach that excludes behavioral and emotional patterns—like fear, greed, or herd mentality—from price analysis. Traditional tools often depend on these patterns to identify zones such as pivots or Fibonacci retracements, but these methods can be inconsistent in volatile markets. In contrast, the Non-Psychological Levels indicator focuses entirely on what price is doing, free from assumptions about trader behavior or external time constraints.
The indicator’s time-agnostic and mechanically driven design segments price action into consistent ranges, highlighting "Broken" levels (where price breaches structural boundaries) and "Unbroken" levels (where price holds). These structural zones remain unaffected by subjective or external influences, ensuring clarity and consistency across different markets and timeframes. By doing so, the indicator reveals a pure view of price structure, independent of psychological biases.
Importantly, the Non-Psychological Levels indicator is not intended to replace psychology-based tools but to complement them. When its structural levels align with psychological zones like round numbers or session highs/lows, the significance of these areas is reinforced. Conversely, when the levels differ, the contrast provides traders with alternative insights into market dynamics. This dual perspective—blending mechanical objectivity with behavioral analysis—enhances the depth and flexibility of market evaluation.
The following principles outline the theoretical foundation of the indicator and its unique contribution to structural price analysis:
Time-Agnostic Design : The indicator avoids reliance on time-based factors like daily opens, session intervals, or specific events. Instead, it segments price action using bar indexes, ensuring that structural levels are identified independently of external time variables. While the x-axis of a chart inherently represents time, this indicator abstracts away its influence, allowing traders to focus purely on price movement without the bias of temporal context.
Mechanical and Neutral Framework : Every calculation within the indicator is predetermined by a set of mechanical rules, ensuring no subjective input or interpretation affects the results. This objectivity guarantees that levels are derived solely from observed price behavior, providing a reliable framework that traders can trust to remain consistent across different assets, timeframes, and market conditions.
Broken and Unbroken Levels : Broken levels represent zones where price has breached a structural boundary, while Unbroken levels highlight areas where price has consistently respected its range. This distinction provides a clear and systematic method for identifying key support and resistance levels, offering insights into where future price interactions are most likely to occur.
Neutral Price Behavior : By dividing price action into equal segments, the indicator removes the influence of external factors like trader sentiment or psychological expectations. Each segment independently determines significant levels based purely on price action, enabling a structural view of the market that abstracts away behavioral or emotional biases.
Complement to Psychological Tools : While the indicator itself avoids behavioral assumptions, its levels can align with psychological zones like round numbers, pivots, or Fibonacci levels. When these structural and psychological levels overlap, it reinforces the importance of key areas, while divergences offer opportunities to examine price behavior from a new perspective.
Educational Value : The indicator encourages traders to explore the contrast between structural and psychological analysis. By introducing a framework that isolates price behavior from external influences, it challenges traditional methods of technical analysis, fostering deeper insights into market structure and behavior.
🔍 UNDERSTANDING STRUCTURAL LEVELS 🔍
The Non-Psychological Levels indicator offers a straightforward yet powerful way to understand market structure by segmenting price action into mechanically defined ranges. This segmentation highlights two key elements: "Broken" levels, where price has breached structural boundaries, and "Unbroken" levels, which remain intact and respected by price action. Together, these components create a framework for identifying potential areas of support and resistance.
Broken Levels : These are structural boundaries that price has surpassed, indicating areas where previous support or resistance failed. Broken levels often signal transitions in price behavior, such as shifts in momentum or the start of trending movements. They provide insight into zones where price has already tested and moved beyond.
Unbroken Levels : These levels remain intact within a given price segment, marking areas where price has consistently respected boundaries. Unbroken levels are particularly useful for identifying potential reversal points or zones of continued support or resistance. Their persistence across price action often makes them reliable indicators of market structure.
The visual segmentation of price action into distinct ranges allows traders to observe how price transitions between structural zones. For example:
- Clusters of Unbroken levels near the current price may suggest strong support or resistance, offering areas of interest for reversals or breakouts.
- Gaps between Unbroken levels highlight areas of price inefficiency or low interaction, which may become significant if revisited.
By focusing solely on structural price behavior, the Non-Psychological Levels indicator enables traders to analyze price independently of time or psychological factors. This makes it a valuable tool for understanding price dynamics objectively, whether used on its own or alongside other indicators.
🛠️ SETTINGS 🛠️
The Non-Psychological Levels indicator offers various customizable settings to help users tailor its visualization to their specific trading style and market conditions. These settings allow adjustments to sensitivity, level projection, and the source of price calculations (e.g., wicks or closing prices). Below, we outline each setting and its impact on the chart, along with examples to illustrate their functionality.
Custom Settings
Sensitivity : This setting adjusts the balance between detailed and broader structural levels by controlling the number of segments. Higher values result in more segments, revealing finer price levels, while lower values consolidate segments to highlight major price movements.
Source : Allows the user to choose between 'Wick' or 'Close' for detecting levels. Selecting 'Wick' emphasizes the absolute highs and lows of price action, while 'Close' focuses on closing prices within each segment.
Level Labels : Configures the visual representation of price levels, allowing users to toggle between price values, symbols (▲ ▼), or disabling labels altogether. This setting ensures clarity in how Broken and Unbroken levels are displayed on the chart.
Unbroken Levels : - - - Users can customize the colors and label styles for Unbroken levels, which highlight areas where price has respected structural boundaries.
Broken Levels : -|- Similar to Unbroken levels, users can specify the visual appearance of Broken levels, including color customization for Broken highs and lows. These settings help distinguish areas where price has breached a structural boundary.
Projection Options : This setting allows users to control how broken and unbroken levels are visually extended on the chart. The Future option projects lines forward to the right of the current price, showing potential future relevance of levels. The All option extends lines both forward and backward, providing a comprehensive view of how levels align with historical and potential future price action. The None option disables projections, keeping the chart focused solely on current segment levels without any extensions.
Segments : Includes options for customizing the segment visualization:
- Live Segment : Toggles the display of a highlighted box representing the current developing segment, helping users focus on ongoing price action.
- Boxes : Allows users to display filled boxes around each segment for additional visual emphasis.
- Segment Colors : Users can define separate colors for support (lower) and resistance (upper) segments, making it easier to interpret directional trends.
- Boundaries : Enables or disables vertical lines to mark segment boundaries, providing a clearer view of structural divisions.
Repaint : This setting allows users to enable or disable triangle labels within the live segment. When enabled, the triangles dynamically update to reflect real-time price behavior during the live bar but will repaint until the bar is fully confirmed. Disabling this option prevents the triangles from appearing during the live bar, reducing potential confusion as they may otherwise flash on and off during price updates. This setting ensures users can choose their preferred visualization while maintaining clarity in real-time analysis.
Color Settings : Offers extensive customization for all visual elements, including Broken and Unbroken levels, segment boundaries, and live segments. These settings ensure the indicator can adapt to individual preferences for chart readability.
🖼️ CHART EXAMPLES 🖼️
The following chart examples illustrate different configurations and features of the Non-Psychological Levels indicator. These examples highlight how the indicator’s settings influence the visualization of structural price behavior, helping traders understand its functionality in various scenarios.
Broken and Unbroken Levels : Orange prices are Broken HIghs. Blue prices are Broken Lows. Green and Red are Unbroken.
Boundaries : Enable Boundaries to visualize segments.
High Sensitivity Setting : A high sensitivity setting produces fewer segments and levels, emphasizing broader price ranges and major structural zones. This configuration is better suited for higher timeframes or identifying overarching trends.
Low Sensitivity Setting : A low sensitivity setting results in a greater number of segments and levels, offering a granular view of price structure. This configuration is ideal for analyzing detailed price movements on lower timeframes.
Live Segment with Triangles Enabled : This example shows the live segment box with triangle labels enabled. These triangles update dynamically during the live bar but may repaint until the bar is confirmed, helping traders observe real-time price behavior.
Broken and Unbroken Levels : This example highlights Broken levels (where price has breached structural boundaries and are drawn through subsequent price action) and Unbroken levels (where price has respected structural boundaries). These distinctions visually identify areas of potential support and resistance.
Broken and Unbroken Levels with Projection: All : This example demonstrates the "Project All" feature, where broken and unbroken levels are extended both forward and backward on the chart. This visualization highlights historical and potential future support and resistance zones, helping traders better understand how price interacts with these structural levels over time.
Segment Boxes with Boundaries : Filled boxes around individual segments visually distinguish each price interval, offering clarity in observing structural price transitions.
📊 SUMMARY 📊
The Non-Psychological Levels indicator provides a unique framework for analyzing structural price behavior through the identification of Broken and Unbroken levels. These levels act as a mechanical representation of support and resistance, independent of psychological biases or time-based factors. By focusing purely on price movement within defined segments, the indicator offers a neutral and consistent approach to understanding market dynamics.
This method complements traditional tools by providing an unbiased perspective. When structural levels align with psychological zones—such as round numbers or session-based highs and lows—they reinforce the significance of these areas as key price zones. When they diverge, the indicator introduces an alternative view, prompting further exploration of price behavior. This dual perspective enhances the depth of analysis by combining the mechanical and behavioral aspects of price action.
The Non-Psychological Levels indicator is not designed to generate trading signals or predict future price movements but serves as a visual and educational tool. Its adaptability across all markets and timeframes allows traders to integrate it into their broader strategies. By highlighting structural price dynamics, the indicator offers a fresh perspective on market analysis while remaining compatible with other technical tools.
⚙️ COMPATIBILITY AND LIMITATIONS ⚙️
Asset Compatibility :
The Non-Psychological Levels indicator is compatible with all asset classes, including cryptocurrencies, forex, stocks, and commodities. It can be applied to any chart or timeframe, making it a flexible tool for structural price analysis. Users should adjust the Sensitivity setting to ensure the segmentation aligns with the price behavior of the specific asset being analyzed. For instance, higher sensitivity values are more suitable for assets with large price ranges, while lower values work well for assets with tighter ranges.
Visual Range Dependency :
The indicator is optimized to perform calculations only within the visible range of the chart. This is a significant advantage, as it prevents unnecessary calculations and maintains efficient performance. However, because of this dependency, levels may appear to "recalculate" when the chart is zoomed in or out quickly or shifted abruptly. While this does not affect the integrity of the levels, it may cause a temporary lag as the indicator adjusts to the new visual range.
Persistence of Levels Beyond Visibility :
Even if levels are not visible on the chart due to zoom or scroll settings, they still exist in the background and are recalculated when revisited. This ensures that the structural price analysis remains consistent, regardless of the chart view.
Box Limitations in Pine Script :
The indicator is subject to Pine Script's inherent limitation of 500 boxes. This means that no more than 500 segments or level boxes can be drawn on the chart simultaneously. For most configurations, this limitation is mitigated by focusing on the visual range, but users employing very low sensitivity settings may exceed the limit. In such cases, only the most recent 500 boxes will be displayed, potentially omitting earlier segments.
Lag with Low Sensitivity Settings :
When sensitivity is set to a low value, the indicator creates many more segments, resulting in finer granularity and a higher number of boxes. While this provides detailed structural levels, it may increase the likelihood of exceeding Pine Script’s 500-box limit or cause a temporary lag when rendering a dense set of boxes over a wide visual range. Users should adjust sensitivity to balance detail with performance, especially on assets with high volatility or broad price ranges.
Live Segment Caution :
The live segment box updates in real time to reflect price movements as the segment is still developing. Since the segment high and segment low are not yet finalized, users should interpret this feature as a dynamic visualization of current price behavior rather than a definitive structural analysis. This ensures clarity during ongoing price action while maintaining the integrity of the indicator's framework.
Cross-Market Versatility :
The indicator’s time-agnostic and mechanical design ensures that it functions identically across all markets and timeframes. However, users should consider the unique characteristics of different markets when interpreting the results, as certain assets (e.g., highly volatile cryptocurrencies) may require sensitivity adjustments for optimal segmentation.
Visual Range Dependency: Levels recalculate efficiently within the chart's visible range but may lag temporarily when zooming or scrolling quickly.
These considerations ensure that the Non-Psychological Levels indicator remains robust and versatile while highlighting some inherent limitations of Pine Script and real-time recalculations. Users can mitigate these constraints by carefully adjusting sensitivity and understanding how the visual range dependency affects performance.
⚠️ DISCLAIMER ⚠️
The Non-Psychological Levels indicator is a visual analysis tool and is not designed as a predictive or trading signal indicator. Its primary purpose is to highlight structural price levels, providing an objective framework for understanding support and resistance within mechanically segmented price action.
The indicator operates within the visible range of the chart to ensure efficiency and adaptiveness, but this recalculation should not be interpreted as a forecast of future price behavior. While the structural levels may align with significant price zones in hindsight, they are purely a reflection of observed price dynamics and should not be used as standalone trading signals.
This indicator is intended as an educational and visual aid to complement other analysis methods. Users are encouraged to integrate it into a broader trading strategy and make adjustments to the settings based on their individual needs and market conditions.
🧠 BEYOND THE CODE 🧠
The Non-Psychological Levels indicator, like other xxattaxx indicators , is designed with education and community collaboration in mind. Its open-source nature encourages exploration, experimentation, and the development of new approaches to price analysis. By focusing on structural price behavior rather than psychological or time-based factors, this indicator introduces a fresh perspective for users to study.
Beyond its visual utility, the indicator serves as an educational framework for understanding the concept of non-psychological analysis. It offers traders an opportunity to explore price dynamics in a purely mechanical way, challenging conventional methods and fostering deeper insights into structural behavior. This approach is especially valuable for those interested in exploring new concepts or seeking alternative perspectives on market analysis.
Your comments, suggestions, and discussions are invaluable in shaping the future of this project. We actively encourage your feedback and contributions, which will directly help us refine and improve the Non-Psychological Levels indicator. We look forward to seeing the creative ways in which you use and enhance this tool. MVS
TASC 2024.12 Dynamic ADX Histogram█ OVERVIEW
This script introduces a new version of the ADX oscillator, designed by Neil Jon Harrington and featured in the "Revisualizing The ADX Oscillator" article from the December 2024 edition of TASC's Traders' Tips .
█ CONCEPTS
The directional movement index (DMI+ and DMI−) and average directional index (ADX) indicators have long been popular with technical analysts. Developed by J. Welles Wilder in the 1970s, these indicators provide information about the direction and strength of price movements across bars. The DMI+ measures positive price movement, the DMI- measures negative price movement, and the ADX gauges the average strength of price trends. Although these indicators can provide helpful insights into price action and momentum, Neil Jon Harrington argues they are often misunderstood or misapplied.
Harrington's indicator, the Dynamic ADX Histogram (DADX), applies directional information to the ADX based on DMI+ and DMI- values to create a single oscillator centered around 0. The indicator displays the oscillator as a histogram with dynamic colors based on ADX movements and user-defined strength thresholds. The author believes this modification of the ADX and DMI data offers a more intuitive visualization of the information provided by Wilder's calculations.
An additional feature of the DADX is the option to use average (smooth) DMI+ and DMI- values in the oscillator's calculation, which reduces noise and choppiness at the cost of added lag.
█ USAGE
The "ADX Length" input determines the number of bars in the DMI and ADX calculation. The "DMI Smoothing Length" input controls the number of bars in the DMI smoothing calculation. Use a value of 1 for non-smoothed DMI data.
The sign of the DADX indicates the direction of price movements based on the difference between the smoothed DMI+ and DMI- values. The absolute value of the oscillator corresponds to the ADX, representing the trend strength.
The "Low Threshold" and "High Threshold" inputs define the ADX thresholds for categorizing trending, non-trending, and exhaustion states. The low threshold specifies the minimum absolute oscillator value required to indicate a trend, and the high threshold marks the absolute value where trend strength is excessive, possibly suggesting an upcoming consolidation or reversal. The indicator colors the histogram based on these thresholds and changes in the ADX, with brighter colors denoting a strengthening trend and darker colors signaling a weakening trend.
Weighted Average Strength Index (WASI)Weighted Average Strength Index (WASI)
The Weighted Average Strength Index (WASI) is a variation of the standard RSI. It uses the Weighted Moving Average (WMA) instead of the Running Moving Average (RMA), making it more responsive to recent price changes. The hypothesis is that this weighted calculation might better capture momentum shifts, providing traders with more timely insights.
How to Use:
Backtest WASI on your preferred assets and timeframes to evaluate its effectiveness for your strategy.
Use for trend following or mean reversion :
- Overbought/Oversold (OB/OS) levels can signal potential mean-reversion opportunities.
- Midline (50 level) crossovers can be used for trend-following strategies.
- WASI and its moving average (MA) crossovers offer additional trend-following or reversal signals.
Parameters and Their Functions:
WASI Length: Determines the number of periods for WASI calculation. A longer length smooths the indicator but increases lag, while a shorter length makes it more sensitive. (When in doubt, go longer).
Source: The price source for the calculation (e.g., close, open, high, or low).
MA Type: Specifies the type of moving average applied to the WASI (options include SMA, EMA, WMA, HMA, and others).
MA Length: The number of periods for the moving average used on the WASI. Higher will lead to a smoother moving average.
Indicator Features:
Dynamic OB/OS Levels: Default overbought (70) and oversold (30) levels help identify potential reversal zones.
Midline Crossover: WASI crossing above or below the 50 level may indicate a trend shift.
WASI-MA Crossover: Crossovers between WASI and its moving average can signal trend-following or mean-reversion opportunities.
Disclaimer:
This indicator is a tool for analysis and should be used in conjunction with other forms of analysis or confirmation. Past performance does not guarantee future results.
Max Pain StrategyThe Max Pain Strategy uses a combination of volume and price movement thresholds to identify potential "pain zones" in the market. A "pain zone" is considered when the volume exceeds a certain multiple of its average over a defined lookback period, and the price movement exceeds a predefined percentage relative to the price at the beginning of the lookback period.
Here’s how the strategy functions step-by-step:
Inputs:
length: Defines the lookback period used to calculate the moving average of volume and the price change over that period.
volMultiplier: Sets a threshold multiplier for the volume; if the volume exceeds the average volume multiplied by this factor, it triggers the condition for a potential "pain zone."
priceMultiplier: Sets a threshold for the minimum percentage price change that is required for a "pain zone" condition.
Calculations:
averageVolume: The simple moving average (SMA) of volume over the specified lookback period.
priceChange: The absolute difference in price between the current bar's close and the close from the lookback period (length).
Pain Zone Condition:
The condition for entering a position is triggered if both the volume is higher than the average volume by the volMultiplier and the price change exceeds the price at the length-period ago by the priceMultiplier. This is an indication of significant market activity that could result in a price move.
Position Entry:
A long position is entered when the "pain zone" condition is met.
Exit Strategy:
The position is closed after the specified holdPeriods, which defines how many periods the position will be held after being entered.
Visualization:
A small triangle is plotted on the chart where the "pain zone" condition is met.
The background color changes to a semi-transparent red when the "pain zone" is active.
Scientific Explanation of the Components
Volume Analysis and Price Movement: These are two critical factors in trading strategies. Volume often serves as an indicator of market strength (or weakness), and price movement is a direct reflection of market sentiment. Higher volume with significant price movement may suggest that the market is entering a phase of increased volatility or trend formation, which the strategy aims to exploit.
Volume analysis: The study of volume as an indicator of market participation, with increased volume often signaling stronger trends (Murphy, J. J., Technical Analysis of the Financial Markets).
Price movement thresholds: A large price change over a short period may be interpreted as a breakout or a potential reversal point, aligning with volatility and liquidity analysis (Schwager, J. D., Market Wizards).
Repainting Check: This strategy does not involve any repainting because it is based on current and past data, and there is no reference to future values in the decision-making process. However, any strategy that uses lagging indicators or conditions based on historical bars, like close , is inherently a lagging strategy and might not predict real-time price action accurately until after the fact.
Risk Management: The position hold duration is predefined, which adds an element of time-based risk control. This duration ensures that the strategy does not hold a position indefinitely, which could expose it to unnecessary risk.
Potential Issues and Considerations
Repainting:
The strategy does not utilize future data or conditions that depend on future bars, so it does not inherently suffer from repainting issues.
However, since the strategy relies on volume and price change over a set lookback period, the decision to enter or exit a trade is only made after the data for the current bar is complete, meaning the trade decisions are somewhat delayed, which could be seen as a lagging feature rather than a repainting one.
Lagging Nature:
As with many technical analysis-based strategies, this one is based on past data (moving averages, price changes), meaning it reacts to market movements after they have already occurred, rather than predicting future price actions.
Overfitting Risk:
With parameters like the lookback period and multipliers being user-adjustable, there is a risk of overfitting to historical data. Adjusting parameters too much based on past performance can lead to poor out-of-sample results (Gauthier, P., Practical Quantitative Finance).
Conclusion
The Max Pain Strategy is a simple approach to identifying potential market entries based on volume spikes and significant price changes. It avoids repainting by relying solely on historical and current bar data, but it is inherently a lagging strategy that reacts to price and volume patterns after they have occurred. Therefore, the strategy can be effective in trending markets but may struggle in highly volatile, sideways markets.
Volume Volatility and Delta Indicator (HN)This Volume Volatility Indicator with Overall Average from Hossein.N helps you visualize the volatility of volume on different timeframes and compares it to the average volume over a given period. It includes several components:
Volume Volatility Indicator (Blue Line): This shows the volatility of volume relative to its moving average over a specified period. Higher values indicate more volatile trading conditions.
Long-Term Volatility Average (Orange Line): This line shows the moving average of the volume volatility indicator over a longer period. It acts as a benchmark for comparing the current volume volatility with historical trends.
Average Volume on Up Days (Green Line): Displays the average volume on days when the price is going up (green).
Average Volume on Down Days (Red Line): Displays the average volume on days when the price is going down (red).
Delta in Percentage (Blue Line): This shows the difference between the average volume of up days and down days, expressed as a percentage of the overall moving average of volume. It can be used to identify bullish or bearish volume imbalances. For example:
Positive values indicate that the volume on up days is stronger than on down days, which could suggest a bullish trend.
Negative values suggest that volume on down days is stronger than on up days, potentially indicating a bearish trend.
Zero Line (Gray Dotted Line): A reference line at 0 that helps you identify when the delta is positive or negative, and visualize the neutral point where volume is balanced between up and down days.
How to Use This Indicator:
Add to Your Chart: Copy the script above and paste it into TradingView's Pine Script editor. Click "Add to Chart" to visualize the indicator.
Interpret the Indicator:
Volume Volatility: A higher value suggests high market volatility. When volume is highly volatile, it may indicate more significant price movements or market uncertainty.
Long-Term Average of Volatility: Use this line as a reference to see whether current volatility is above or below average over a longer period.
Delta in Percentage: This is particularly useful to compare the strength of buying and selling volume. A positive delta percentage suggests strong buying pressure, while a negative delta suggests strong selling pressure. The closer the delta is to zero, the more balanced the volume between up and down days.
Use for Trend Confirmation: The indicator can help confirm trends. If the delta percentage is positive and increasing, and the volume volatility is above average, it could signal strong bullish momentum. Conversely, if the delta is negative and the volume volatility is rising, it may suggest bearish sentiment.
Risk Disclaimer:
Important: This indicator is a tool designed to help analyze market conditions. It does not guarantee success in trading and should not be used as the sole basis for making trading decisions. Always do your own research, consider other factors (e.g., price action, market news, fundamentals), and manage your risk appropriately. Trading involves significant risk, and you should only trade with money you can afford to lose. Always ensure you understand the risks involved in trading and use risk management strategies.
By using this tool, you accept full responsibility for any trading decisions and the outcomes thereof. The information presented is for educational and informational purposes only.
Price Channel with SupertrendOverview
This Pine Script creates an indicator named "Price Channel with Supertrend" that overlays on the main chart. It combines the Price Channel and Supertrend indicators, and includes various customization options for colors and bar conditions.
Key Components
Inputs:
length: Length for the Price Channel.
channel: Boolean to enable/disable the Price Channel.
Various color inputs for customization.
Bar Conditions:
Identifies different types of bars (e.g., inside bars, outside bars, up days, down days) and sets colors accordingly.
Price Channel:
Calculates the upper and lower bounds of the Price Channel using the highest high and lowest low over the specified length.
Plots the Price Channel if enabled.
Supertrend:
Uses ATR (Average True Range) to calculate the Supertrend.
Plots the Supertrend line with color changes based on the trend direction.
Bar Coloring:
Colors bars based on conditions like outside bars and Supertrend direction.
Buy and Sell Signals:
Generates buy and sell signals based on crossovers and crossunders of the closing price with the Supertrend line.
Plots labels for these signals on the chart.
Plotting
Price Channel: Plots the upper and lower bounds.
Supertrend: Plots the Supertrend line with color changes.
ATR: Uses ATR for Supertrend calculation.
Bar Colors: Colors bars based on conditions.
Signals: Plots buy and sell signals with labels.