Refined EMA Pullback Screener (v4) fully integrated Pine Script (v4) for your screener. It includes all prior conditions plus optional toggles for:
✅ Rising EMA
✅ EMA above longer EMA
✅ Closed above EMA for 10 prior bars
✅ Touch and close on EMA in the last bar
✅ Bar size smaller than 14-day ATR%
✅ Lower wick ≥ 25% of daily range
✅ Score-based screener signal
指標和策略
Psychological Levels + Buffer ZonesThis indicator automatically draws major (100-pip) and minor (50-pip) psychological levels on your Forex chart, along with optional buffer zones for smarter trade entries. Zones help you visually capture breakouts, retests, and fakeouts. Includes:
Major & minor psych levels
Adjustable buffer zones (±0.1%, etc.)
Customizable zone color & transparency
Optional ATR trailing lines for trend confirmation
Perfect for scalpers, breakout traders, and zone-based strategies.
GEEKSDOBYTE IFVG w/ Buy/Sell Signals1. Inputs & Configuration
Swing Lookback (swingLen)
Controls how many bars on each side are checked to mark a swing high or swing low (default = 5).
Booleans to Toggle Plotting
showSwings – Show small triangle markers at swing highs/lows
showFVG – Show Fair Value Gap zones
showSignals – Show “BUY”/“SELL” labels when price inverts an FVG
showDDLine – Show a yellow “DD” line at the close of the inversion bar
showCE – Show an orange dashed “CE” line at the midpoint of the gap area
2. Swing High / Low Detection
isSwingHigh = ta.pivothigh(high, swingLen, swingLen)
Marks a bar as a swing high if its high is higher than the highs of the previous swingLen bars and the next swingLen bars.
isSwingLow = ta.pivotlow(low, swingLen, swingLen)
Marks a bar as a swing low if its low is lower than the lows of the previous and next swingLen bars.
Plotting
If showSwings is true, small red downward triangles appear above swing highs, and green upward triangles below swing lows.
3. Fair Value Gap (3‐Bar) Identification
A Fair Value Gap (FVG) is defined here using a simple three‐bar logic (sometimes called an “inefficiency” in price):
Bullish FVG (bullFVG)
Checks if, two bars ago, the low of that bar (low ) is strictly greater than the current bar’s high (high).
In other words:
bullFVG = low > high
Bearish FVG (bearFVG)
Checks if, two bars ago, the high of that bar (high ) is strictly less than the current bar’s low (low).
In other words:
bearFVG = high < low
When either condition is true, it identifies a three‐bar “gap” or unfilled imbalance in the market.
4. Drawing FVG Zones
If showFVG is enabled, each time a bullish or bearish FVG is detected:
Bullish FVG Zone
Draws a semi‐transparent green box from the bar two bars ago (where the gap began) at low up to the current bar’s high.
Bearish FVG Zone
Draws a semi‐transparent red box from the bar two bars ago at high down to the current bar’s low.
These colored boxes visually highlight the “fair value imbalance” area on the chart.
5. Inversion (Fill) Detection & Entry Signals
An inversion is defined as the price “closing through” that previously drawn FVG:
Bullish Inversion (bullInversion)
Occurs when a bullish FVG was identified on bar-2 (bullFVG), and on the current bar the close is greater than that old bar-2 low:
bullInversion = bullFVG and close > low
Bearish Inversion (bearInversion)
Occurs when a bearish FVG was identified on bar-2 (bearFVG), and on the current bar the close is lower than that old bar-2 high:
bearInversion = bearFVG and close < high
When an inversion is true, the indicator optionally draws two lines and a label (depending on input toggles):
Draw “DD” Line (yellow, solid)
Plots a horizontal yellow line from the current bar’s close price extending five bars forward (bar_index + 5). This is often referred to as a “Demand/Daily Demand” line, marking where price inverted the gap.
Draw “CE” Line (orange, dashed)
Calculates the midpoint (ce) of the original FVG zone.
For a bullish inversion:
ce = (low + high) / 2
For a bearish inversion:
ce = (high + low) / 2
Plots a horizontal dashed orange line at that midpoint for five bars forward.
Plot Label (“BUY” / “SELL”)
If showSignals is true, a green “BUY” label is placed at the low of the current bar when a bullish inversion occurs.
Likewise, a red “SELL” label at the high of the current bar when a bearish inversion happens.
6. Putting It All Together
Swing Markers (Optional):
Visually confirm recent swing highs and swing lows with small triangles.
FVG Zones (Optional):
Highlight areas where price left a 3-bar gap (bullish in green, bearish in red).
Inversion Confirmation:
Wait for price to close beyond the old FVG boundary.
Once that happens, draw the yellow “DD” line at the close, the orange dashed “CE” line at the zone’s midpoint, and place a “BUY” or “SELL” label exactly on that bar.
User Controls:
All of the above elements can be individually toggled on/off (showSwings, showFVG, showSignals, showDDLine, showCE).
In Practice
A bullish FVG forms whenever a strong drop leaves a gap in liquidity (three bars ago low > current high).
When price later “fills” that gap by closing above the old low, the script signals a potential long entry (BUY), draws a demand line at the closing price, and marks the midpoint of that gap.
Conversely, a bearish FVG marks a potential short zone (three bars ago high < current low). When price closes below that gap’s high, it signals a SELL, with similar lines drawn.
By combining these elements, the indicator helps users visually identify inefficiencies (FVGs), confirm when price inverts/fills them, and place straightforward buy/sell labels alongside reference lines for trade management.
Triple Moving Average Custom v2EMA SMA cross for better confirmation I personally using with Key Level.
9EMA Pullback9EMA pullback
✅ Rising 9 EMA
✅ 9 EMA above longer 21 EMA
✅ Closed above EMA for 10 prior bars
✅ Touch and close on EMA in the last bar
✅ Bar size smaller than 14-day ATR%
✅ Lower wick ≥ 25% of daily range
✅ Score-based screener signal
Pierre's H4 EMA/MA Compression Strategy (BTC)Pierre's logic and trading strategy from the X post and its related threads. The post focuses on Bitcoin (BTC) price action on a 4-hour (H4) chart, using Exponential Moving Averages (EMAs) and Moving Averages (MAs) to identify a potential "EMA/MA compression" scenario, which is a key part of his analysis.
Summary of Pierre's Logic
Pierre is analyzing Bitcoin's price movement on the H4 timeframe, focusing on a technical pattern he calls "EMA/MA compression." This concept is central to his analysis and involves the interaction of key moving averages (H4 100 MA, H4 200 EMA, and H4 300 MA) to predict price behavior. Here's the breakdown of his logic:
EMA/MA Compression Concept:
Pierre describes "EMA/MA compression" as a scenario where the price consolidates around key moving averages, leading to a tightening of volatility before a breakout or breakdown.
In this case, the H4 100 MA, H4 200 EMA, and H4 300 MA are the critical levels to watch. These moving averages act as dynamic support/resistance levels, and their behavior (break, hold, or flip) dictates the trend direction.
He notes that this compression often follows a cycle: EMA/MA compression → Trend → Gap Fills → Repeat. This cycle suggests that after a compression phase, the price tends to trend, fill any price gaps, and then return to another compression phase.
Key Levels and Conditions for a Bullish Scenario:
H4 100 MA: Must break or flip to the upside. A break above this level signals bullish momentum, while a failure to hold above it (a "flip") invalidates the bullish case.
H4 200 EMA: Acts as an "intermediary" level that must hold during pullbacks. If this level holds, it supports the bullish structure.
H4 300 MA: A critical support level. It must hold to keep the bullish scenario intact. If the price loses this level (and it flips to resistance), the bullish outlook is invalidated.
Pierre mentions that after the price breaks the H4 100 MA, it should aim to fill gaps between 109.5 and 110.5 (likely in thousands, so $109,500–$110,500). If the H4 200 EMA holds, the price might pull back to the H4 300 MA, where it could consolidate further before continuing the trend.
Invalidation Scenarios:
The bullish scenario is invalidated if:
The H4 100 MA is broken and flips to resistance (i.e., price closes below it after initially breaking above).
The H4 300 MA is lost and flips to resistance (i.e., price closes below it and fails to reclaim it).
Current Market Context:
Pierre notes a "nice bounce" in BTC's price, bringing it back into the compression zone. The price is currently fighting a key area on lower timeframes (LTF), likely referring to shorter timeframes like H1 or M15.
He mentions that all gaps have been filled for now (referencing the cycle of gap fills), which aligns with his expectation of reduced volatility as the price enters another compression phase.
Historical Context and Consistency:
Pierre has been tracking this scenario since the H4 100 MA break, as shared in his group @TheHavenCrypto
. He references notes from Monday (likely June 2, 2025, as the post is from June 6), indicating that his analysis has been consistent over the week.
In a follow-up post, he reflects on a recent trade where he took partial profits on the bounce but couldn’t fully capitalize on the move due to being on his phone and managing only a fraction of his intended position size near the H4 300 MA (for BTC) and H4 200 EMA (for ETH).
Pierre's Trading Strategy
Based on the post and its context, Pierre’s trading strategy revolves around the EMA/MA compression framework. Here’s how he approaches trades:
Setup Identification:
Pierre identifies setups using the H4 timeframe, focusing on the interaction of the H4 100 MA, H4 200 EMA, and H4 300 MA.
He looks for a "compression" phase where the price consolidates around these moving averages, signaling a potential breakout or breakdown.
In this case, the price breaking the H4 100 MA to the upside was his initial signal for a bullish setup.
Entry Points:
Pierre likely entered a long position (buy) near the H4 300 MA or H4 200 EMA during the recent bounce, as he mentions taking partial profits on the move.
He prefers entering after a pullback to these key levels (e.g., H4 200 EMA or H4 300 MA) as long as they hold as support. For example, in Thread 1 (Post 1930270942871118081), he shares a chart showing a long entry near the H4 300 MA with an upside target near 110,000–111,000.
Target Setting:
His primary target after the H4 100 MA break is to fill gaps between $109,500 and $110,500.
If the price reaches these levels and the H4 200 EMA holds, he expects a potential pullback to the H4 300 MA, followed by another leg up (as part of the trend phase in his cycle).
Risk Management:
Pierre sets clear invalidation levels:
A close below the H4 100 MA after breaking above it.
A close below the H4 300 MA with a failure to reclaim it.
He takes partial profits on bounces, as seen in his follow-up post where he mentions securing gains but not fully capitalizing on the move due to limited position size.
Position Sizing and Execution:
Pierre mentions being limited by trading from his phone, which restricted his position size. This suggests he typically scales into trades with a planned size but adjusts based on execution conditions.
He also notes going "AFK for the weekend" after taking profits, indicating a disciplined approach to stepping away from the market when not actively monitoring.
Cycle-Based Trading:
His strategy follows the cycle of EMA/MA compression → Trend → Gap Fills → Repeat. After the gaps are filled, he expects volatility to tighten (another compression phase), which could set up the next trade.
Key Takeaways for Traders
Focus on Key Levels: Pierre’s strategy hinges on the H4 100 MA, H4 200 EMA, and H4 300 MA. These levels are used to confirm trends, identify entries, and set invalidation points.
Patience for Compression: He waits for the price to enter a compression phase (tight consolidation around MAs) before expecting a breakout or breakdown.
Gap-Filling as a Target: Pierre uses price gaps (e.g., $109,500–$110,500) as targets, aligning with the market’s tendency to fill these gaps (as noted in the related web result from investing.com about CME gaps).
Risk Management: He has clear invalidation rules and takes partial profits to lock in gains while letting the trade play out.
Cycle Awareness: His trades are part of a broader cycle (compression → trend → gap fill → repeat), which helps him anticipate market behavior.
Additional Context from Related Threads
Thread 1 (June 4–June 6): Pierre’s earlier posts (e.g., Post 1930270942871118081) show historical examples of EMA/MA compression leading to trends and gap fills, reinforcing his current analysis. He also shares a chart with a potential upside target of $110,000–$111,000 if the H4 300 MA holds.
Thread 2 (June 3): Pierre mentions a Daily (D1) timeframe analysis where the D1 100 MA and D1 200 EMA align with range lows, suggesting a potential "wet dream swing long opportunity" if the price holds these levels. This indicates he’s also considering higher timeframes for confirmation.
Thread 3 (May 27): Pierre’s earlier analysis highlights similar concepts (e.g., H4 100 MA break, H4 200 EMA hold), showing consistency in his approach over time.
Conclusion
Pierre’s logic is rooted in technical analysis, specifically the interaction of moving averages on the H4 timeframe to identify "EMA/MA compression" setups. His strategy involves buying on pullbacks to key support levels (H4 200 EMA, H4 300 MA) after a breakout (H4 100 MA), targeting gap fills ($109,500–$110,500), and managing risk with clear invalidation levels. He follows a cyclical approach to trading, expecting periods of compression, trending, and gap-filling to repeat, which guides his entries, exits, and overall market outlook.
ML Super Divergence + ADX ConfirmationThe "ML Super Divergence + ADX Confirmation" indicator is a powerful tool designed for technical traders who want to combine machine learning-inspired divergence signals with the ADX (Average Directional Index) trend strength indicator for more reliable trade signals.
This script is written in Pine Script v6 and is suitable for use on TradingView charts. It visually highlights potential buy and sell opportunities and also generates alerts when conditions are met.
📈 Core Components:
1. ADX System (Average Directional Index):
Measures trend strength, not direction.
Calculated using a 14-period (user-configurable) setting.
DI+ (Positive Directional Index) and DI− (Negative Directional Index) are used to gauge bullish and bearish pressure.
Signals are only valid when ADX > threshold (e.g., 20), ensuring that the trend is strong enough to act upon.
2. Simulated ML Super Divergence Signal:
This is a placeholder for actual ML-based divergence detection.
For demonstration, it simulates:
Bullish divergence: when RSI crosses above 30 and OBV (On-Balance Volume) is rising.
Bearish divergence: when RSI crosses below 70 and OBV is falling.
This approximation helps visualize how real ML divergence signals could be integrated.
✅ Buy Signal Conditions:
A buy signal is plotted when:
A bullish divergence is detected.
DI+ is greater than DI− (i.e., bullish directional strength).
ADX is above the minimum threshold (confirming a strong trend).
📍 Visual cue: Green upward triangle below the price bar.
🔔 Alert Triggered: "Buy Signal: ML Super Divergence + DI+ + ADX Confirmation"
❌ Sell Signal Conditions:
A sell signal is plotted when:
A bearish divergence is detected.
DI− is greater than DI+ (i.e., bearish directional strength).
ADX is above the threshold.
📍 Visual cue: Red dot above the price bar.
🔔 Alert Triggered: "Sell Signal: ML Super Divergence + DI- + ADX Confirmation"
Premarket & Previous Day High/LowLines for Premarket High Low as well as Previous Day High and Low. Also adds Bollinger Bands. Colors the Bollinger Bands depending wether the Close is above or below PMH or PML
Customizable Alligator (Pane)Trend indicators that give you best signal. After Crossing indicated short term trend change.
Enhanced MFI Divergence with Pivot SignalsEnhanced MFI Divergence with Pivot Signals
This custom Pine Script indicator identifies bullish and bearish divergences between price action and the Money Flow Index (MFI), enhancing the trader's ability to spot potential reversal zones with visual clarity and optional confirmation filters.
📊 Key Features:
🔹 MFI Divergence Detection
The script detects:
Bullish divergence when price forms a lower low but MFI forms a higher low.
Bearish divergence when price forms a higher high but MFI forms a lower high.
🔹 Pivot-Based Logic
To ensure high-confidence signals, the script uses pivot point logic to mark local highs and lows on both price and MFI. This avoids noise and focuses only on meaningful swing points.
🔹 Optional Confirmation Filter
You can enable a filter that checks if MFI is above 50 during bullish divergence (implying buying pressure) and below 50 for bearish divergence (implying selling pressure), adding an extra layer of confirmation.
🔹 Signal Markers
Signals are visually displayed on the chart using colored triangles:
Green triangle up for bullish divergence
Red triangle down for bearish divergence
🔹 Background Color Shading
The background is optionally shaded green or red based on MFI’s relationship to its smoothed WMA, helping you visually interpret trend bias.
🔹 Pivot Point Debugging Tools
Circles and crosses mark pivot points on price and MFI for debugging and visual clarity.
🔹 Alerts Ready
Real-time alerts notify you instantly when a bullish or bearish MFI divergence occurs, allowing for quick decision-making.
⚙️ How It Helps
This indicator is designed to help traders:
Anticipate price reversals by identifying hidden strength or weakness in momentum,
Avoid false breakouts,
Confirm entries or exits based on volume-weighted momentum divergence.
It works especially well when used alongside trend-following tools like moving averages, support/resistance zones, or additional volume indicators.
Quad Rotation - StochasticThis Indicator is a step up from the Triad Rotation Indicator previously made, as it has 4 Stochastic signals rather then 3.
It can be used mainly to identify potential reversal periods. If the Instrument becomes overbought, or oversold with all 4 stochastics a horizontal highlight will appear, either green or red. Green indicates the instrument is oversold, and may reverse soon, meaning you should take a buying positions, and red indicates an overbought position, where you may want to sell due to a reversal downward.
Additionally, you can set an alarm if all 4 stochastic indicators signal overbought or oversold. This will help reduce your need to watch each instrument, and reduce the likelihood of overtrading.
If you have comments regarding this indicator, if you found it helpful, or would like other improvements feel free to email me. If you are looking for other custom indicators, also feel free to email me. Email: thejak77@aol.com. This is an email rarely monitored, so please be patient, thank you!
All the best, and stay profitable!
21EMA Pullback✅ Rising EMA
✅ EMA above longer EMA
✅ Closed above EMA for 10 prior bars
✅ Touch and close on EMA in the last bar
✅ Bar size smaller than 14-day ATR%
✅ Lower wick ≥ 25% of daily range
✅ Score-based screener signal
_CM_MacD_Ult_MTF_V2.1//------New V2 Update 07-28-2021----------
//Thanks to @SKTennis for help in Updating code to V2
//Added Groups to Settings Pane.
//Added Color Plots to Settings Pane
//Switched MTF Logic to turn ON/OFF automatically w/ TradingView's Built in Feature
//Updated Color Transparency plots to work in future update
//Added Ability to Turn ON/OFF Show MacD & Signal Line
//Added Ability to Turn ON/OFF Show Histogram
//Added Ability to Change MACD Line Colors Based on Trend
//Added Ability to Highlight Price Bars Based on Trend
//Added Alerts to Settings Pane.
//Customized how Alerts work. Must keep Checked in Settings Pane, and...
//When you go to Alerts Panel, Change Symbol to Indicator (CM_Ult_MacD_MTF_V2)
//Customized Alerts to Show Symbol, TimeFrame, Closing Price, MACD Crosses Up & MACD Crosses Down Signals in Alert
//Alerts are Pre-Set to only Alert on Bar Close
//------New V2.1 Update 08-03-2021----------
//Added back in ability to show Dots when MACD Crosses.
//Added Ability to Change Plot Widths in Settings Pane
//Added in Alert Feature where Cross Up if above 0 or cross down if below 0 (OFF By Default) user Request. @creid58
//FIXED - Plot Orders to Default what Plots are on top of each other
//FIXED - Two of the histogrm colors were backwrds
//------New V2.1 Update 12-07-2021----------
//Updated to PineScript V5
//------Minor Update 02-16-2022----------
//Per user request...Increased the Maxval for Signal Smoothing
//Next Add in Plot Types to Settings Pane.
//Next Add in more Moving Average types.
//See Video for Detailed Overview
//@version=5
indicator(title="_CM_MacD_Ult_MTF_V2.1", shorttitle="_CM_Ult_MacD_MTF_V2.1")
//Plot Inputs
res = input.timeframe("", "Indicator TimeFrame")
fast_length = input.int(title="Fast Length", defval=12)
slow_length = input.int(title="Slow Length", defval=26)
src = input.source(title="Source", defval=close)
signal_length = input.int(title="Signal Smoothing", minval = 1, maxval = 999, defval = 9)
sma_source = input.string(title="Oscillator MA Type", defval="EMA", options= )
sma_signal = input.string(title="Signal Line MA Type", defval="EMA", options= )
// Show Plots T/F
show_macd = input.bool(true, title="Show MACD Lines", group="Show Plots?", inline="SP10")
show_macd_LW = input.int(3, minval=0, maxval=5, title = "MACD Width", group="Show Plots?", inline="SP11")
show_signal_LW= input.int(2, minval=0, maxval=5, title = "Signal Width", group="Show Plots?", inline="SP11")
show_Hist = input.bool(true, title="Show Histogram", group="Show Plots?", inline="SP20")
show_hist_LW = input.int(5, minval=0, maxval=5, title = "-- Width", group="Show Plots?", inline="SP20")
show_trend = input.bool(true, title = "Show MACD Lines w/ Trend Color", group="Show Plots?", inline="SP30")
show_HB = input.bool(false, title="Show Highlight Price Bars", group="Show Plots?", inline="SP40")
show_cross = input.bool(false, title = "Show BackGround on Cross", group="Show Plots?", inline="SP50")
show_dots = input.bool(true, title = "Show Circle on Cross", group="Show Plots?", inline="SP60")
show_dots_LW = input.int(5, minval=0, maxval=5, title = "-- Width", group="Show Plots?", inline="SP60")
//show_trend = input(true, title = "Colors MACD Lines w/ Trend Color", group="Show Plots?", inline="SP5")
// MACD Lines colors
col_macd = input.color(#FF6D00, "MACD Line ", group="Color Settings", inline="CS1")
col_signal = input.color(#2962FF, "Signal Line ", group="Color Settings", inline="CS1")
col_trnd_Up = input.color(#4BAF4F, "Trend Up ", group="Color Settings", inline="CS2")
col_trnd_Dn = input.color(#B71D1C, "Trend Down ", group="Color Settings", inline="CS2")
// Histogram Colors
col_grow_above = input.color(#26A69A, "Above Grow", group="Histogram Colors", inline="Hist10")
col_fall_above = input.color(#B2DFDB, "Fall", group="Histogram Colors", inline="Hist10")
col_grow_below = input.color(#FF5252, "Below Grow", group="Histogram Colors", inline="Hist20")
col_fall_below = input.color(#FFCDD2, "Fall", group="Histogram Colors", inline="Hist20")
// Alerts T/F Inputs
alert_Long = input.bool(true, title = "MACD Cross Up", group = "Alerts", inline="Alert10")
alert_Short = input.bool(true, title = "MACD Cross Dn", group = "Alerts", inline="Alert10")
alert_Long_A = input.bool(false, title = "MACD Cross Up & > 0", group = "Alerts", inline="Alert20")
alert_Short_B = input.bool(false, title = "MACD Cross Dn & < 0", group = "Alerts", inline="Alert20")
// Calculating
fast_ma = request.security(syminfo.tickerid, res, sma_source == "SMA" ? ta.sma(src, fast_length) : ta.ema(src, fast_length))
slow_ma = request.security(syminfo.tickerid, res, sma_source == "SMA" ? ta.sma(src, slow_length) : ta.ema(src, slow_length))
macd = fast_ma - slow_ma
signal = request.security(syminfo.tickerid, res, sma_signal == "SMA" ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length))
hist = macd - signal
// MACD Trend and Cross Up/Down conditions
trend_up = macd > signal
trend_dn = macd < signal
cross_UP = signal >= macd and signal < macd
cross_DN = signal <= macd and signal > macd
cross_UP_A = (signal >= macd and signal < macd) and macd > 0
cross_DN_B = (signal <= macd and signal > macd) and macd < 0
// Condition that changes Color of MACD Line if Show Trend is turned on..
trend_col = show_trend and trend_up ? col_trnd_Up : trend_up ? col_macd : show_trend and trend_dn ? col_trnd_Dn: trend_dn ? col_macd : na
//Var Statements for Histogram Color Change
var bool histA_IsUp = false
var bool histA_IsDown = false
var bool histB_IsDown = false
var bool histB_IsUp = false
histA_IsUp := hist == hist ? histA_IsUp : hist > hist and hist > 0
histA_IsDown := hist == hist ? histA_IsDown : hist < hist and hist > 0
histB_IsDown := hist == hist ? histB_IsDown : hist < hist and hist <= 0
histB_IsUp := hist == hist ? histB_IsUp : hist > hist and hist <= 0
hist_col = histA_IsUp ? col_grow_above : histA_IsDown ? col_fall_above : histB_IsDown ? col_grow_below : histB_IsUp ? col_fall_below :color.silver
// Plot Statements
//Background Color
bgcolor(show_cross and cross_UP ? col_trnd_Up : na, editable=false)
bgcolor(show_cross and cross_DN ? col_trnd_Dn : na, editable=false)
//Highlight Price Bars
barcolor(show_HB and trend_up ? col_trnd_Up : na, title="Trend Up", offset = 0, editable=false)
barcolor(show_HB and trend_dn ? col_trnd_Dn : na, title="Trend Dn", offset = 0, editable=false)
//Regular Plots
plot(show_Hist and hist ? hist : na, title="Histogram", style=plot.style_columns, color=color.new(hist_col ,0),linewidth=show_hist_LW)
plot(show_macd and signal ? signal : na, title="Signal", color=color.new(col_signal, 0), style=plot.style_line ,linewidth=show_signal_LW)
plot(show_macd and macd ? macd : na, title="MACD", color=color.new(trend_col, 0), style=plot.style_line ,linewidth=show_macd_LW)
hline(0, title="0 Line", color=color.new(color.gray, 0), linestyle=hline.style_dashed, linewidth=1, editable=false)
plot(show_dots and cross_UP ? macd : na, title="Dots", color=color.new(trend_col ,0), style=plot.style_circles, linewidth=show_dots_LW, editable=false)
plot(show_dots and cross_DN ? macd : na, title="Dots", color=color.new(trend_col ,0), style=plot.style_circles, linewidth=show_dots_LW, editable=false)
//Alerts
if alert_Long and cross_UP
alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") MACD Crosses Up.", alert.freq_once_per_bar_close)
if alert_Short and cross_DN
alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") MACD Crosses Down.", alert.freq_once_per_bar_close)
//Alerts - Stricter Condition - Only Alerts When MACD Crosses UP & MACD > 0 -- Crosses Down & MACD < 0
if alert_Long_A and cross_UP_A
alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") MACD > 0 And Crosses Up.", alert.freq_once_per_bar_close)
if alert_Short_B and cross_DN_B
alert("Symbol = (" + syminfo.tickerid + ") TimeFrame = (" + timeframe.period + ") Current Price (" + str.tostring(close) + ") MACD < 0 And Crosses Down.", alert.freq_once_per_bar_close)
//End Code
Percent Change of Range CandlesPercent Change of Range Candles 2.0 – Explanation and Usage Guide - with a new visual display
Purpose of the Indicator
This indicator measures the percentage change in price relative to the total range (high - low) over a defined period. Its primary function is to display trend strength — whether the price has significantly risen or fallen in relation to its historical high and low over the selected length.
It serves as a tool for identifying momentum shifts, extreme zones, and potential entry and exit points.
How It Works
Main signal (c):
Calculated as the difference between the current close and the close length periods ago, divided by the total range over the same period.
The result is multiplied by 100 to express it as a percentage.
Positive values indicate bullish pressure, and negative values indicate bearish pressure.
Supportive lines (o, h, l):
o is the average of the last 5 values of c – used to observe momentum smoothing.
h and l are adaptive values based on short-term recalculations (25% of the main length), adjusted depending on the current direction of the trend.
Indicator Levels and Their Meaning
Level Meaning
0 A key boundary between bullish and bearish zones. Proximity to this line often suggests consolidation or a potential reversal.
+70 Strong bullish momentum. May indicate overbought strength – potential for a pullback.
+100 Extreme overbought zone. This could signal market exhaustion and an upcoming drop.
-70 Strong bearish momentum. Could indicate oversold strength, but still within a trending market.
-100 Extreme oversold zone. Signals a possible reversal or at least a short-term bounce.
How to Use It in Trading
Around the Zero Level (0):
This is the neutral zone. When c approaches zero after a strong trend, it can indicate momentum weakening and a potential trend shift.
A cross from negative to positive values could signal early bullish reversal.
A cross from positive to negative could indicate early bearish reversal.
Extreme Levels ±100:
These are not automatic "buy" or "sell" signals but mark extreme market conditions.
Approaching +100 suggests the market has risen too much, possibly overheated – be ready for a correction.
Approaching -100 suggests the market has fallen too much, potentially oversold – be prepared for a recovery.
Best used in combination with other filters like RSI, MA, price action, or volume.
Visual Interpretation
Green line (positive c) represents bullish momentum.
Red line (negative c) represents bearish momentum.
Gray lines (o, h, l) help visualize averages and wicks of the price move for better understanding of the internal price dynamics.
Conclusion
The Percent Change of Range Candles indicator is useful for:
Tracking medium-term price momentum.
Detecting overbought/oversold conditions.
Identifying consolidation phases and possible reversals.
For best results, use it in combination with other indicators and with a broader view of market context (e.g., higher timeframes).
Trend Persistence Counter (TPC) by riskcipher🧭 Trend Persistence Counter (TPC) – A Simple Price Action Trend Duration Tool
Trend Persistence Counter (TPC) is a lightweight indicator that counts how long a trend persists after a breakout.
It is entirely based on price action, without using any moving averages or smoothing. The goal is to give a simple, rule-based view of trend continuity.
🧠 How It Works (Logic Overview)
This indicator switches between two modes: bullish and bearish.
If close > previous high, the counter enters bullish mode, and starts at +1
While in bullish mode:
If close >= previous low → continue the uptrend → +1 each bar
If close < previous low → trend ends → reset to 0, switch to bearish mode
If close < previous low, the counter enters bearish mode, and starts at -1
While in bearish mode:
If close <= previous high → continue the downtrend → -1 each bar
If close > previous high → trend ends → reset to 0, switch to bullish mode
This provides a bar-by-bar count of trend persistence based on whether price holds structure.
🎯 Use Cases
Track how long a trend continues after a breakout
Quickly detect when trend structure breaks
Help visually filter “strong” vs “weak” moves
Build logic-based alerts (e.g., trend continues for N bars)
🔍 Why Use This Instead of Traditional Indicators?
This is not meant to replace moving averages or trend filters.
But it offers some advantages for those who prefer structure-based logic:
Feature TPC
Based on Price Action ✅ Yes
Uses Lagging Filters ❌ No moving average or smoothing
Trend Duration Measurement ✅ Counts valid consecutive moves
Complexity ⚪ Very simple and transparent
It’s a simple concept and easy to understand, but still useful when combined with other tools or visualized on its own.
⚙️ Technical Notes
Works on any timeframe or instrument
The value is positive during bullish persistence, negative during bearish
Value resets to 0 when trend structure breaks
All logic is calculated bar-by-bar, in real time
✅ Example Usage Ideas
Highlight candles when TPC value crosses a certain threshold (e.g., strong breakout continuation)
Use the zero-cross as a potential reversal warning
Filter trend signals in your existing strategies
MA20 + Fibonacci Bands + RSIA new indicator we developed that combines a 20 Fibonacci moving average and the RSI index
RS Triple MA Confluence Signal (Lower Pane)This indicator outputs a binary signal (1 or 0) based on triple moving average confluence of an asset’s relative strength vs a benchmark (e.g., SPY, BTC, etc).
✅ A value of 1 indicates full confluence, where the asset's relative strength is above three customizable moving averages (short, medium, and long).
❌ A value of 0 indicates confluence is off.
This version is designed to be used in a lower pane for:
Quick visual scanning
Dashboard-style layouts
Systematic filtering or alerting
Pairs perfectly with the main overlay tool:
👉 Relative Strength Triple MA Confluence
Use that version for candle coloring and price-level signals, and this version for clean signal tracking and screening support.
Darren - Engulfing + MACD CrossDarren – Engulfing + MACD Cross
Overall Behavior
Identify an engulfing candle (bullish or bearish).
Wait up to windowBars bars for the corresponding MACD crossover (bullish engulfing → MACD cross up; bearish engulfing → MACD cross down).
If the crossover occurs within that window, trigger an entry (long or short) and close any opposite open trade.
Inputs
• macdFast (default 12): length of MACD fast EMA
• macdSlow (default 26): length of MACD slow EMA
• macdSignal (default 9): length of MACD signal line
• windowBars (default 3): maximum bars allowed between an engulfing candle and a MACD crossover
Indicators
• macdLine and signalLine are calculated using ta.macd(close, macdFast, macdSlow, macdSignal)
• macdHist = macdLine – signalLine, plotted as columns (green when ≥ 0, red when < 0)
Engulfing Pattern Detection
• Bullish engulfing (bullEngulfing) is true when the previous candle is bearish (close < open ), the current candle is bullish (close > open), and the current body fully engulfs the previous body (open < close and close > open ).
• Bearish engulfing (bearEngulfing) is the inverse: previous candle bullish, current candle bearish, and current body fully engulfs the prior body.
MACD Crossover Detection
• macdCrossUp is true when macdLine crosses above signalLine.
• macdCrossDown is true when macdLine crosses below signalLine.
Timing Logic
• barsSinceBull = ta.barssince(bullEngulfing) returns number of bars since the last bullish engulfing.
• barsSinceBear = ta.barssince(bearEngulfing) returns number of bars since the last bearish engulfing.
• longCondition occurs if a MACD cross up happens within windowBars bars of a bullish engulfing (barsSinceBull ≤ windowBars and macdCrossUp).
• shortCondition occurs if a MACD cross down happens within windowBars bars of a bearish engulfing (barsSinceBear ≤ windowBars and macdCrossDown).
Chart Markers
• “Bull” label below bar whenever bullEngulfing is true.
• “Bear” label above bar whenever bearEngulfing is true.
• Small “Up” ▲ below bar when macdCrossUp is true.
• Small “Down” ▼ above bar when macdCrossDown is true.
• Triangle ▲ below bar for Long Entry (longCondition).
• Triangle ▼ above bar for Short Entry (shortCondition).
Entry & Exit Rules
• On longCondition: enter “Long”, and close any existing “Short” position.
• On shortCondition: enter “Short”, and close any existing “Long” position.
10 EMA -1.5*ATRHelps identify potential support zones below the EMA by subtracting market volatility (ATR) from the EMA.
Useful for trend-following traders and pullback strategies to estimate dynamic entry zones.
Can act as a volatility-adjusted trailing level.
Claude - 21 Trend StrategyStrategy:
1. Buy 100% position when price closed over 5, 21, 50 day SMA
2. Sell all position when price closed below 21 day SMA
MA Cross MTF Alert (Miu)This script extends the classic moving average crossover strategy with support for up to 8 user-defined symbols across 4 custom timeframes, combined with a visual and alert system designed for traders who monitor multiple assets simultaneously.
Unlike traditional MA crossover tools, this script enables traders to receive real-time alerts for crossovers across multiple assets and timeframes, even when the script is not actively displayed on the chart — ideal for passive monitoring in multi-asset strategies.
What it does:
This script calculates two customizable moving averages (SMA or EMA) for each selected symbol and timeframe.
It then tracks crossover events:
- Bullish crossover when the fast MA crosses above the slow MA
- Bearish crossunder when the fast MA crosses below the slow MA
On the chart, it also displays the crossover signals for the current symbol and timeframe using color-coded cross icons.
Key features:
- Select SMA or EMA type for both moving averages
- Customize MA lengths and colors
- Works with any asset and timeframe
- Alerts include symbol and timeframe info for easy identification
How to use:
1) Add the indicator to your chart.
2) Choose the moving average type and lengths.
3) Enable/disable any of the 8 symbols and 4 timeframes.
4) Set up TradingView alerts by clicking “Create Alert” and selecting one of the alert() calls.
5) You will receive a message like:
BTC (1h) | MA Crossover ▲ or ETH (15m) | MA Crossunder ▼
Technical note:
This script uses request.security() to retrieve moving average values from up to 8 different symbols and 4 different timeframes in real time.
Feel free to leave your feedback or suggestions in the comments section below.
Enjoy!
Anti-SMT + FVG StrategieMade by Laila
4h gives 57% winrate!
Instead of trading based on an expected SMT divergence, you assume that the divergence will not continue. You combine this with a Fair Value Gap (FVG) that is touched by price as additional confirmation.
Anti-SMT Logic (False Divergence)
Short:
EURUSD makes a new high (candle 1)
DXY does not make a new low
Long:
EURUSD makes a new low (candle 1)
DXY does not make a new high
This looks like SMT divergence, but your expectation is: "There will be no SMT."
Fair Value Gap (FVG) Detection
Detects an unfilled gap between candle 1 and 3.
You only trade if the FVG is touched during:
🔹 Candle 1 (the false SMT candle) or
🔹 Candle 2 (the entry candle)
Extra Filters
Only go long if price is above the 50 EMA
Only go short if price is below the 50 EMA
Only trade between 08:00 and 18:00 UTC
Wait 10 candles cooldown between trades
Result:
You only trade when:
There is a possible SMT illusion
An FVG is touched
The setup aligns with trend, session, and timing
This gives you a rational, rare, but strong edge.
Moving Average ExponentialUsing VWAP and two different EMAs. Also includes BollingerBands, showing if the Close is above or below VWAP.