TMA +BB Bands Indicator//@version=5
indicator(shorttitle="BB", title="Bollinger Bands", overlay=true, timeframe="", timeframe_gaps=true)
length = input.int(20, minval=1)
maType = input.string("SMA", "Basis MA Type", options = )
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
ma(source, length, _type) =>
switch _type
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input.int(0, "Offset", minval = -500, maxval = 500, display = display.data_window)
plot(basis, "Basis", color=#2962FF, offset = offset)
p1 = plot(upper, "Upper", color=#F23645, offset = offset)
p2 = plot(lower, "Lower", color=#089981, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))
Pita dan Kanal
EMA Percentile Rank [SS]Hello!
Excited to release my EMA percentile Rank indicator!
What this indicator does
Plots an EMA and colors it by short-term trend.
When price crosses the EMA (up or down) and remains on that side for three subsequent bars, the cross is “confirmed.”
At the moment of the most recent cross, it anchors a reference price to the crossover point to ensure static price targets.
It measures the historical distance between price and the EMA over a lookback window, separately for bars above and below the EMA.
It computes percentile distances (25%, 50%, 85%, 95%, 99%) and draws target bands above/below the anchor.
Essentially what this indicator does, is it converts the raw “distance from EMA” behavior into probabilistic bands and historical hit rates you can use for targets, stop placement, or mean-reversion/continuation decisions.
Indicator Inputs
EMA length: Default is 21 but you can use any EMA you prefer.
Lookback: Default window is 500, this is length that the percentiles are calculated. You can increase or decrease it according to your preference and performance.
Show Accumulation Table: This allows you to see the table that shows the hits/price accumulation of each of the percentile ranges. UCL means upper confidence and LCL means lower confidence (so upper and lower targets).
About Percentiles
A percentile is a way of expressing the position of a value within a dataset relative to all the other values.
It tells you what percentage of the data points fall at or below that value.
For example:
The 25th percentile means 25% of the values are less than or equal to it.
The 50th percentile (also called the median) means half the values are below it and half are above.
The 99th percentile means only 1% of the values are higher.
Percentiles are useful because they turn raw measurements into context — showing how “extreme” or “typical” a value is compared to historical behavior.
In the EMA Percentile Rank indicator, this concept is applied to the distance between price and the EMA. By calculating percentile distances, the script can mark levels that have historically been reached often (low percentiles) or rarely (high percentiles), helping traders gauge whether current price action is stretched or within normal bounds.
Use Cases
The EMA Percentile Rank indicator is best suited for traders who want to quantify how far price has historically moved away from its EMA and use that context to guide decision-making.
One strong use case is target setting after trend shifts: when a confirmed crossover occurs, the percentile bands (25%, 50%, 85%, 95%, 99%) provide statistically grounded levels for scaling out profits or placing stops, based on how often price has historically reached those distances. This makes it valuable for traders who prefer data-driven risk/reward planning instead of arbitrary point targets. Another use case is identifying stretched conditions — if price rapidly tags the 95% or 99% band after a cross, that’s an unusually large move relative to history, which could signal exhaustion and prompt mean-reversion trades or protective actions.
Conversely, if the accumulation table shows price frequently resides in upper bands after bullish crosses, traders may anticipate continuation and hold positions longer . The indicator is also effective as a trend filter when combined with its EMA color-coding : only taking trades in the trend’s direction and using the bands as dynamic profit zones.
Additionally, it can support multi-timeframe confluence (if you align your chart to the timeframes of interest), where higher-timeframe trend direction aligns with lower-timeframe percentile behavior for higher-probability setups. Swing traders can use it to frame pullbacks — entering near lower percentile bands during an uptrend — while intraday traders might use it to fade extremes or ride breakouts past the median band. Because the anchor price resets only on EMA crosses, the indicator preserves a consistent reference for ongoing trades, which is especially helpful for managing swing positions through noise .
Overall, its strength lies in transforming raw EMA distance data into actionable, probability-weighted levels that adapt to the instrument’s own volatility and tendencies .
Summary
This indicator transforms a simple EMA into a distribution-aware framework: it learns how far price tends to travel relative to the EMA on either side, and turns those excursions into percentile bands and historical hit rates anchored to the most recent cross. That makes it a flexible tool for targets, stops, and regime filtering, and a transparent way to reason about “how stretched is stretched?”—with context from your chosen market and timeframe.
I hope you all enjoy!
And as always, safe trades!
J12Matic Builder by galgoomA flexible Renko/tick strategy that lets you choose between two entry engines (Multi-Source 3-way or QBand+Moneyball), with a unified trailing/TP exit engine, NY-time trading windows with auto-flatten, daily profit/loss and trade-count limits (HALT mode), and clean webhook routing using {{strategy.order.alert_message}}.
Highlights
Two entry engines
Multi-Source (3): up to three long/short sources with Single / Dual / Triple logic and optional lookback.
QBand + Moneyball: Gate → Trigger workflow with timing windows, OR/AND trigger modes, per-window caps, optional same-bar fire.
Unified exit engine: Trailing by Bricks or Ticks, plus optional static TP/SL.
Session control (NY time): Evening / Overnight / NY Session windows; auto-flatten at end of any enabled window.
Day controls: Profit/Loss (USD) and Trade-count limits. When hit, strategy HALTS new entries, shows an on-chart label/background.
Alert routing designed for webhooks: Every order sets alert_message= so you can run alerts with:
Condition: this strategy
Notify on: Order fills only
Message: {{strategy.order.alert_message}}
Default JSONs or Custom payloads: If a Custom field is blank, a sensible default JSON is sent. Fill a field to override.
How to set up alerts (the 15-second version)
Create a TradingView alert with this strategy as Condition.
Notify on: Order fills only.
Message: {{strategy.order.alert_message}} (exactly).
If you want your own payloads, paste them into Inputs → 08) Custom Alert Payloads.
Leave blank → the strategy sends a default JSON.
Fill in → your text is sent as-is.
Note: Anything you type into the alert dialog’s Message box is ignored except the {{strategy.order.alert_message}} token, which forwards the payload supplied by the strategy at order time.
Publishing notes / best practices
Renko users: Make sure “Renko Brick Size” in Inputs matches your chart’s brick size exactly.
Ticks vs Bricks: Exit distances switch instantly when you toggle Exit Units.
Same-bar flips: If enabled, a new opposite signal will first close the open trade (with its exit payload), then enter the new side.
HALT mode: When day profit/loss limit or trade-count limit triggers, new entries are blocked for the rest of the session day. You’ll see a label and a soft background tint.
Session end flatten: Auto-closes positions at window ends; these exits use the “End of Session Window Exit” payload.
Bar magnifier: Strategy is configured for on-close execution; you can enable Bar Magnifier in Properties if needed.
Default JSONs (used when a Custom field is empty)
Open: {"event":"open","side":"long|short","symbol":""}
Close: {"event":"close","side":"long|short|flat","reason":"tp|sl|flip|session|limit_profit|limit_loss","symbol":""}
You can paste any text/JSON into the Custom fields; it will be forwarded as-is when that event occurs.
Input sections — user guide
01) Entries & Signals
Entry Logic: Choose Multi-Source (3) or QBand + Moneyball (pick one).
Enable Long/Short Signals: Master on/off switches for entering long/short.
Flip on opposite signal: If enabled, a new opposite signal will close the current position first, then open the other side.
Signal Logic (Multi-Source):
Single: any 1 of the 3 sources > 0
Dual: Source1 AND Source2 > 0
Triple (default): 1 AND 2 AND 3 > 0
Long/Short Signal Sources 1–3: Provide up to three series (often indicators). A positive value (> 0) is treated as a “pulse”.
Use Lookback: Keeps a source “true” for N bars after it pulses (helps catch late triggers).
Long/Short Lookback (bars): How many bars to remember that pulse.
01b) QBands + Moneyball (Gate -> Trigger)
Allow same-bar Gate->Trigger: If ON, a trigger can fire on the same bar as the gate pulse.
Trigger must fire within N bars after Gate: Size of the gate window (in bars).
Max signals per window (0 = unlimited): Cap the number of entries allowed while a gate window is open.
Buy/Sell Source 1 – Gate: Gate pulse sources that open the buy/sell window (often a regime/zone, e.g., QBands bull/bear).
Trigger Pulse Mode (Buy/Sell): How to detect a trigger pulse from the trigger sources (Change / Appear / Rise>0 / Fall<0).
Trigger A/B sources + Extend Bars: Primary/secondary triggers plus optional extension to persist their pulse for N bars.
Trigger Mode: Pick S2 only, S3 only, S2 OR S3, or S2 AND S3. AND mode remembers both pulses inside the window before firing.
02) Exit Units (Trailing/TP)
Exit Units: Choose Bricks (Renko) or Ticks. All distances below switch accordingly.
03) Tick-based Trailing / Stops (active when Exit Units = Ticks)
Initial SL (ticks): Starting stop distance from entry.
Start Trailing After (ticks): Start trailing once price moves this far in your favor.
Trailing Distance (ticks): Offset of the trailing stop from peak/trough once trailing begins.
Take Profit (ticks): Optional static TP distance.
Stop Loss (ticks): Optional static SL distance (overrides trailing if enabled).
04) Brick-based Trailing / Stops (active when Exit Units = Bricks)
Renko Brick Size: Must match your chart’s brick size.
Initial SL / Start Trailing After / Trailing Distance (bricks): Same definitions as tick mode, measured in bricks.
Take Profit / Stop Loss (bricks): Optional static distances.
05) TP / SL Switch
Enable Static Take Profit: If ON, closes the trade at the fixed TP distance.
Enable Static Stop Loss (Overrides Trailing): If ON, trailing is disabled and a fixed SL is used.
06) Trading Windows (NY time)
Use Trading Windows: Master toggle for all windows.
Evening / Overnight / NY Session: Define each session in NY time.
Flatten at End of : Auto-close any open position when a window ends (sends the Session Exit payload).
07) Day Controls & Limits
Enable Profit Limits / Profit Limit (Dollars): When daily net PnL ≥ limit → auto-flatten and HALT.
Enable Loss Limits / Loss Limit (Dollars): When daily net PnL ≤ −limit → auto-flatten and HALT.
Enable Trade Count Limits / Number of Trades Allowed: After N entries, HALT new entries (does not auto-flatten).
On-chart HUD: A label and soft background tint appear when HALTED; a compact status table shows Day PnL, trade count, and mode.
08) Custom Alert Payloads (used as strategy.order.alert_message)
Long/Short Entry: Payload sent on entries (if blank, a default open JSON is sent).
Regular Long/Short Exit: Payload sent on closes from SL/TP/flip (if blank, a default close JSON is sent).
End of Session Window Exit: Payload sent when any enabled window ends and positions are flattened.
Profit/Loss/Trade Limit Close: Payload sent when daily profit/loss limit causes auto-flatten.
Tip: Any tokens you include here are forwarded “as is”. If your downstream expects variables, do the substitution on the receiver side.
Known limitations
No bracket orders from Pine: This strategy doesn’t create OCO/attached brackets on the broker; it simulates exits with strategy logic and forwards your payloads for external automation.
alert_message is per order only: Alerts fire on order events. General status pings aren’t sent unless you wire a separate indicator/alert.
Renko specifics: Backtests on synthetic Renko can differ from live execution. Always forward-test on your instrument and settings.
Quick checklist before you publish
✅ Brick size in Inputs matches your Renko chart
✅ Exit Units set to Bricks or Ticks as you intend
✅ Day limits/Windows toggled as you want
✅ Custom payloads filled (or leave blank to use defaults)
✅ Your alert uses Order fills only + {{strategy.order.alert_message}}
Smart Multi-Confirm Reversal DetectorHow the Smart Multi-Confirm Reversal Detector Works
The indicator works by analyzing candlestick patterns, trend, and technical confirmations and then scoring each bar to determine the strength of a potential reversal. Here’s the step-by-step logic:
Step 1: Analyze Candlestick Patterns
For each new candle, the indicator checks if any of the selected patterns occur:
Wick Reversal (Long Lower Wick):
Looks for candles with a small body and a long lower shadow.
Indicates buying pressure (potential bullish reversal).
Inverted Wick (Long Upper Wick):
Looks for candles with a small body and a long upper shadow.
Indicates selling pressure (potential bearish reversal).
Body Engulf:
The current candle completely “engulfs” the previous candle.
Signals a strong change in momentum.
Tweezer Patterns:
Two consecutive candles with almost identical highs or lows.
Suggests a potential reversal zone.
3-Bar Pattern:
Three consecutive bullish or bearish candles in a row.
Shows strong momentum continuation or exhaustion, used to confirm reversal.
Each pattern can be turned on/off by the user. If a pattern is detected, it contributes points to the overall signal score.
Step 2: Confirm Trend Direction
The indicator checks EMA trend alignment:
Fast EMA vs Slow EMA:
Fast EMA above Slow EMA → bullish trend.
Fast EMA below Slow EMA → bearish trend.
Optional Higher Timeframe EMA (HTF) Alignment:
Checks if the trend on a higher timeframe matches the current trend.
Adds extra weight to the signal if alignment is true.
This ensures the signal goes in the direction of the prevailing trend, reducing false signals.
Step 3: Check Technical Confirmations
Optional filters increase reliability:
ADX (Average Directional Index):
Measures the strength of the current trend.
Only strong trends contribute to the score.
RSI (Relative Strength Index):
Bullish confirmation: RSI is oversold.
Bearish confirmation: RSI is overbought.
Volume Spike:
Compares current volume to the average volume.
High volume validates the signal’s momentum.
Body Momentum:
Compares current candle’s body size to its average.
Larger than average body indicates stronger momentum.
Each of these confirmations can be enabled/disabled and has a weight in the scoring system.
Step 4: Calculate Score
Each pattern and confirmation has a user-defined weight (0–100).
The indicator sums the active weights that pass conditions and normalizes to 100.
Example:
Wick Reversal detected → 30 points
Trend EMA confirmed → 15 points
ADX confirmed → 10 points
Score = 55/100 → may or may not trigger a signal depending on threshold.
Score Threshold:
Only bars above the user-defined threshold are considered a confirmed signal.
Bars above a lower “label threshold” still show a label, even if not strong enough for alerts.
Step 5: Visualize Signals
Bullish Signals: Green triangle below the candle.
Bearish Signals: Red triangle above the candle.
Labels: Show the type of pattern and the score.
Purpose: Quickly identify potential reversals and assess their strength visually.
Step 6: Optional Alerts
Fixed alert messages can be enabled for confirmed bullish or bearish signals.
Alerts do not recommend trades; they just notify you of pattern confirmations.
Complies with TradingView’s policy for safe alert use.
Step 7: Weighted Decision
The final decision is not binary.
Instead, the indicator combines multiple signals into a score, so stronger signals are more reliable.
This reduces false positives and gives traders a professional, multi-confirmation approach to detect potential reversals.
OPTIMAL super trend tripple confirm for leverage. Ai implemented for higher r:r still a work in progresss
Ripster EMA Clouds with customisable colorsEMA Clouds indicator inspired by Ripster47's concepts. Published primarily to offer customizable color settings for the cloud displays. This is not an identical copy but an inspired implementation.
Hammer, Engulfing & Star Candles aksh//@version=5
indicator("Hammer, Engulfing & Star Candles ", overlay=true, max_bars_back=500)
// ===== Inputs =====
showHammer = input.bool(true, "Show Hammer")
showShootingStar = input.bool(true, "Show Shooting Star")
showEngulfing = input.bool(true, "Show Bull/Bear Engulfing")
showMorningStar = input.bool(true, "Show Morning Star (3-candle)")
showEveningStar = input.bool(true, "Show Evening Star (3-candle)")
// Sensitivity / thresholds
wickToBodyMin = input.float(2.5, "Min Wick:Body (Hammer/Star)", minval=0.5, step=0.1)
maxOppWickToBody = input.float(0.7, "Max Opp Wick:Body (Hammer/Star)", minval=0.0, step=0.1)
closeInTopPct = input.float(0.35, "Hammer: close in top % of range", minval=0.0, maxval=1.0, step=0.05)
closeInBotPct = input.float(0.35, "Star: close in bottom % of range", minval=0.0, maxval=1.0, step=0.05)
minBodyFracRange = input.float(0.15, "Min body as % of range (avoid doji)", minval=0.0, maxval=1.0, step=0.01)
engulfRequireBodyPct = input.float(1.00, "Engulfing: body >= prev body x", minval=0.5, maxval=3.0, step=0.05)
engulfAllowWicks = input.bool(false, "Engulfing: allow wick engulf if bodies equal")
starMiddleBodyMaxPct = input.float(0.40, "Morning/Evening Star: middle body <= % of avg body", minval=0.05, maxval=1.0, step=0.05)
starCloseRetracePct = input.float(0.50, "Morning/Evening Star: final close retraces >= % of first body", minval=0.25, maxval=1.0, step=0.05)
// ===== Helpers =====
body(c,o) => math.abs(c - o)
upperWick(h,o,c) => h - math.max(o, c)
lowerWick(l,o,c) => math.min(o, c) - l
rng(h,l) => h - l
isBull(o,c) => c > o
isBear(o,c) => o > c
midpoint(h,l) => (h + l) * 0.5
b = body(close, open)
uw = upperWick(high, open, close)
lw = lowerWick(low, open, close)
rg = rng(high, low)
prev_o = open , prev_c = close , prev_h = high , prev_l = low
prev_b = body(prev_c, prev_o)
// avoid divide-by-zero
safe(val) => nz(val, 0.0000001)
// ===== Single-candle patterns =====
// Hammer: long lower wick, small/limited upper wick, decent body, close toward top of range
hammer = showHammer and rg > 0 and b/rg >= minBodyFracRange and
(lw / safe(b) >= wickToBodyMin) and (uw / safe(b) <= maxOppWickToBody) and
(close >= (low + (1.0 - closeInTopPct) * rg))
// Shooting Star: long upper wick, small/limited lower wick, close toward bottom
shootingStar = showShootingStar and rg > 0 and b/rg >= minBodyFracRange and
(uw / safe(b) >= wickToBodyMin) and (lw / safe(b) <= maxOppWickToBody) and
(close <= (low + closeInBotPct * rg))
// ===== Two-candle patterns: Engulfing =====
// Bullish engulfing: previous bearish, current bullish, current body engulfs previous body
bullEngulf = showEngulfing and isBear(prev_o, prev_c) and isBull(open, close) and
(open <= prev_c and close >= prev_o) and (b >= engulfRequireBodyPct * prev_b or (engulfAllowWicks and high >= prev_h and low <= prev_l))
// Bearish engulfing: previous bullish, current bearish, current body engulfs previous body
bearEngulf = showEngulfing and isBull(prev_o, prev_c) and isBear(open, close) and
(open >= prev_c and close <= prev_o) and (b >= engulfRequireBodyPct * prev_b or (engulfAllowWicks and high >= prev_h and low <= prev_l))
// ===== Three-candle patterns: Morning/Evening Star =====
// Morning Star: strong bearish candle, small middle candle (gap or small body), strong bullish close retracing into first body
o2 = open , c2 = close
b2 = body(c2, o2)
avgBody = ta.sma(body(close, open), 20)
smallMiddle = body(close , open ) <= starMiddleBodyMaxPct * nz(avgBody, prev_b)
firstBear = isBear(o2, c2)
lastBull = isBull(open, close)
retrBull = lastBull and (close >= (c2 + starCloseRetracePct * (o2 - c2)))
morningStar = showMorningStar and firstBear and smallMiddle and retrBull
// Evening Star: mirror
firstBull = isBull(o2, c2)
lastBear = isBear(open, close)
retrBear = lastBear and (close <= (c2 - starCloseRetracePct * (c2 - o2)))
eveningStar = showEveningStar and firstBull and smallMiddle and retrBear
// ===== Plotting =====
plotshape(hammer, title="Hammer", style=shape.labelup, location=location.belowbar, text="🔨 Hammer", size=size.tiny, color=color.new(color.lime, 0), textcolor=color.black)
plotshape(shootingStar, title="Shooting Star", style=shape.labeldown, location=location.abovebar, text="⭐ Star", size=size.tiny, color=color.new(color.orange, 0), textcolor=color.black)
plotshape(bullEngulf, title="Bull Engulfing", style=shape.labelup, location=location.belowbar, text="🟢 Engulf", size=size.tiny, color=color.new(color.teal, 0), textcolor=color.black)
plotshape(bearEngulf, title="Bear Engulfing", style=shape.labeldown, location=location.abovebar, text="🔴 Engulf", size=size.tiny, color=color.new(color.red, 0), textcolor=color.white)
plotshape(morningStar, title="Morning Star", style=shape.labelup, location=location.belowbar, text="🌅 Morning", size=size.tiny, color=color.new(color.aqua, 0), textcolor=color.black)
plotshape(eveningStar, title="Evening Star", style=shape.labeldown, location=location.abovebar, text="🌆 Evening", size=size.tiny, color=color.new(color.purple, 0), textcolor=color.white)
// Optional: color bars when patterns occur
barcolor(hammer ? color.new(color.lime, 60) : na)
barcolor(shootingStar ? color.new(color.orange, 60) : na)
barcolor(bullEngulf ? color.new(color.teal, 70) : na)
barcolor(bearEngulf ? color.new(color.red, 70) : na)
barcolor(morningStar ? color.new(color.aqua, 70) : na)
barcolor(eveningStar ? color.new(color.purple, 70) : na)
// ===== Alerts =====
alertcondition(hammer, "Hammer", "Hammer detected")
alertcondition(shootingStar, "Shooting Star", "Shooting Star detected")
alertcondition(bullEngulf, "Bullish Engulfing","Bullish Engulfing detected")
alertcondition(bearEngulf, "Bearish Engulfing","Bearish Engulfing detected")
alertcondition(morningStar, "Morning Star", "Morning Star detected (3-candle)")
alertcondition(eveningStar, "Evening Star", "Evening Star detected (3-candle)")
// ===== Hints (toggle in the Style tab if labels feel too crowded) =====
// You can adjust thresholds to match your market/timeframe.
// Common tweaks: increase wickToBodyMin for stricter hammers/stars; increase minBodyFracRange to avoid doji;
// require stronger retrace in star patterns by raising starCloseRetracePct.
Gamma Blast StrategyGamma Blast Strategy used for quick 2-5 ticks on Buys, but on a sideways market can get up to 15-20 ticks.
Pump/Dump Detector [Modular]//@version=5
indicator("Pump/Dump Detector ", overlay=true)
// ————— Inputs —————
risk_pct = input.float(1.0, "Risk %", minval=0.1)
capital = input.float(100000, "Capital")
stop_multiplier = input.float(1.5, "Stop Multiplier")
target_multiplier = input.float(2.0, "Target Multiplier")
volume_mult = input.float(2.0, "Volume Spike Multiplier")
rsi_low_thresh = input.int(15, "RSI Oversold Threshold")
rsi_high_thresh = input.int(85, "RSI Overbought Threshold")
rsi_len = input.int(2, "RSI Length")
bb_len = input.int(20, "BB Length")
bb_mult = input.float(2.0, "BB Multiplier")
atr_len = input.int(14, "ATR Length")
show_signals = input.bool(true, "Show Entry Signals")
use_orderflow = input.bool(true, "Use Order Flow Proxy")
use_ml_flag = input.bool(false, "Use ML Risk Flag")
use_session_filter = input.bool(true, "Use Volatility Sessions")
// ————— Symbol Filter (Optional) —————
symbol_nq = input.bool(true, "Enable NQ")
symbol_es = input.bool(true, "Enable ES")
symbol_gold = input.bool(true, "Enable Gold")
is_nq = str.contains(syminfo.ticker, "NQ")
is_es = str.contains(syminfo.ticker, "ES")
is_gold = str.contains(syminfo.ticker, "GC")
symbol_filter = (symbol_nq and is_nq) or (symbol_es and is_es) or (symbol_gold and is_gold)
// ————— Calculations —————
rsi = ta.rsi(close, rsi_len)
atr = ta.atr(atr_len)
basis = ta.sma(close, bb_len)
dev = bb_mult * ta.stdev(close, bb_len)
bb_upper = basis + dev
bb_lower = basis - dev
rolling_vol = ta.sma(volume, 20)
vol_spike = volume > volume_mult * rolling_vol
// ————— Session Filter (EST) —————
est_offset = -5
est_hour = (hour + est_offset + 24) % 24
session_filter = (est_hour >= 18 or est_hour < 6) or (est_hour >= 14 and est_hour < 17)
session_ok = not use_session_filter or session_filter
// ————— Order Flow Proxy —————
mfi = ta.mfi(close, 14)
buy_imbalance = ta.crossover(mfi, 50)
sell_imbalance = ta.crossunder(mfi, 50)
reversal_candle = close > open and close > ta.highest(close , 3)
// ————— ML Risk Flag (Placeholder) —————
ml_risk_flag = use_ml_flag and (ta.sma(close, 5) > ta.sma(close, 20))
// ————— Entry Conditions —————
long_cond = symbol_filter and session_ok and vol_spike and rsi < rsi_low_thresh and close < bb_lower and (not use_orderflow or (buy_imbalance and reversal_candle)) and (not use_ml_flag or ml_risk_flag)
short_cond = symbol_filter and session_ok and vol_spike and rsi > rsi_high_thresh and (not use_orderflow or sell_imbalance) and (not use_ml_flag or ml_risk_flag)
// ————— Position Sizing —————
risk_amt = capital * (risk_pct / 100)
position_size = risk_amt / atr
// ————— Plot Signals —————
plotshape(show_signals and long_cond, title="Long Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(show_signals and short_cond, title="Short Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// ————— Alerts —————
alertcondition(long_cond, title="Long Entry Alert", message="Pump fade detected: Long setup triggered")
alertcondition(short_cond, title="Short Entry Alert", message="Dump detected: Short setup triggered")
[GrandAlgo] Moving Averages Cross LevelsMoving Averages Cross Levels
Many traders watch for moving average crossovers – such as the golden cross (50 MA crossing above 200 MA) or death cross – as signals of changing trends. However, once a crossover happens, the exact price level where it occurred often fades from view, even though that level can be an important reference point. Moving Averages Cross Levels is an indicator that keeps those crossover price levels visible on your chart, helping you track where momentum shifts occurred and how price behaves relative to those key levels.
This tool plots horizontal line segments at the price where each pair of selected moving averages crossed within a recent window of bars. Each level is labeled with the moving average lengths (for example, “21×50” for a 21/50 MA cross) and is color-coded – green for bullish crossovers (short-term MA crossing above long-term MA) and red for bearish crossunders (short-term crossing below). By visualizing these crossover levels, you can quickly identify past trend change points and use them as potential support/resistance or decision levels in your trading. Importantly, this indicator is non-repainting – once a crossover level is plotted, it remains fixed at the historical price where the cross occurred, allowing you to continually monitor that level going forward. (As with any moving average-based analysis, crossover signals are lagging, so use these levels in conjunction with other tools for confirmation.)
Key Features:
✅ Multiple Moving Averages: Track up to 7 different MAs (e.g. 5, 8, 21, 50, 64, 83, 200 by default) simultaneously. You can enable/disable each MA and set its length, allowing flexible combinations of short-term and long-term averages.
✅ Selectable MA Type: Each average can be calculated as a Simple (SMA), Exponential (EMA), Volume-Weighted (VWMA), or Smoothed (RMA) moving average, giving you flexibility to match your preferred method.
✅ Auto Crossover Detection: The script automatically detects all crosses between any enabled MA pairs, so you don’t have to specify pairs manually. Whether it’s a fast cross (5×8) or a long-term cross (50×200), every crossover within the lookback period will be identified and marked.
✅ Horizontal Level Markers: For each detected crossover, a horizontal line segment is drawn at the exact price where the crossover occurred. This makes it easy to glance at your chart and see precisely where two moving averages intersected in the recent past.
✅ Labeled and Color-Coded: Each crossover line is labeled with the two MA lengths that crossed (e.g. “50×200”) for clear identification. Colors indicate crossover direction – by default green for bullish (positive) crossovers and red for bearish (negative) crossovers – so you can tell at a glance which way the trend shifted. (You can customize these colors in the settings.)
✅ Adjustable Lookback: A “Crosses with X candles” input lets you control how far back the script looks for crossovers to plot. This prevents your chart from getting cluttered with too many old levels – for example, set X = 100 to show crossovers from roughly the last 100 bars. Older crossover lines beyond this lookback window will automatically clear off the chart.
✅ Optional MA Plots: You can toggle the display of each moving average line on the chart. This means you can either view just the crossover levels alone for a clean look, or also overlay the MA curves themselves for additional context (to see how price and MAs were moving around the crossover).
✅ No Repainting or Hindsight Bias: Once a crossover level is plotted, it stays at that fixed price. The indicator doesn’t move levels around after the fact – each line is a true historical event marker. This allows you to backtest visually: see how price acted after the crossover by observing if it retested or respected that level later.
How It Works:
1️⃣ Add to Chart & Configure – Simply add the indicator to your chart. In the settings, choose which moving averages you want to include and set their lengths. For example, you might enable 21, 50, 200 to focus on medium and long-term crosses (including the golden cross), or turn on shorter MAs like 5 and 8 for quick momentum shifts. Adjust the lookback (number of bars to scan for crosses) if needed.
2️⃣ Visualization – The script continuously checks the latest X bars for any points where one MA crossed above or below another. Whenever a crossover is found, it calculates the exact price level at which the two moving averages intersected. On the last bar of your chart, it will draw a horizontal line segment extending from the crossover bar to the current bar at that price level, and place a label to the right of the line with the MA lengths. Green lines/labels signify bullish crossovers (where the first MA crossed above the second), and red lines indicate bearish crossunders.
3️⃣ On Your Chart – You will see these labeled levels aligned with the price scale. For example, if a 50 MA crossed above a 200 MA (bullish) 50 bars ago at price $100, there will be a green “50×200” line at $100 extending to the present, showing you exactly where that golden cross happened. You might notice price pulling back near that level and bouncing, or if price falls back through it, it could signal a failed crossover. The indicator updates in real-time: if a new crossover happens on the latest bar, a new line and label will instantly appear, and if any old cross moves out of the lookback range, its line is removed to keep the chart focused.
4️⃣ Customization – You can fine-tune the appearance: toggle any MA’s visibility, change line colors or label styles, and modify the lookback length to suit different timeframes. For instance, on a 1-hour chart you might use a lookback of 500 bars to see a few weeks of cross history, whereas on a daily chart 100 bars (about 4–5 months) may be sufficient. Adjust these settings based on how many crossover levels you find useful to display.
Ideal for Traders Who:
Use MA Crossovers in Strategy: If your strategy involves moving average crossovers (for trend confirmation or entry/exit signals), this indicator provides an extra layer of insight by keeping the price of those crossover events in sight. For example, trend-followers can watch if price stays above a bullish crossover level as a sign of trend strength, or falls below it as a sign of weakness.
Identify Support/Resistance from MA Events: Crossover levels often coincide with pivot points in market sentiment. A crossover can act like a regime change – the level where it happened may turn into support or resistance. This tool helps you mark those potential S/R levels automatically. Rather than manually noting where a golden cross occurred, you’ll have it highlighted, which can be useful for setting stop-losses (e.g. below the crossover price in a bullish scenario) or profit targets.
Track Multiple Averages at Once: Instead of focusing on just one pair of moving averages, you might be interested in the interaction of several (short, medium, and long-term trends). This indicator caters to that by plotting all relevant crossovers among your chosen MAs. It’s great for multi-timeframe thinkers as well – e.g. you could apply it on a higher timeframe chart to mark major cross levels, then drill down to lower timeframes knowing those key prices.
Value Clean Visualization: There are no flashing signals or arrows – just simple lines and labels that enhance your chart’s storytelling. It’s ideal if you prefer to make trading decisions based on understanding price interaction with technical levels rather than following automatic trade calls. Moving Averages Cross Levels gives you information to act on, without imposing any bias or strategy – you interpret the crossover levels in the context of your own trading system.
Maiko Range Scalper (Sideways BB + RSI) – v4 cleanPurpose
It’s a range scalping strategy for crypto. It tries to take small, repeatable trades inside a sideways market: buy near the bottom of the range, sell near the middle/top (and the reverse for shorts).
Core idea (two timeframes)
Define the trading range on a higher timeframe (HTF)
You choose the HTF (e.g., 15m or 1h).
The script finds the highest high and lowest low over a lookback window (e.g., last 96 HTF candles) → these become HTF Resistance and HTF Support.
It also calculates the midline (average of support/resistance).
Trade signals on your lower timeframe (LTF)
You run the strategy on a fast chart (e.g., 1m or 5m).
Entries are only allowed inside the HTF range.
Entry logic (mean reversion)
Indicators on the LTF:
Bollinger Bands (length & std dev configurable).
RSI (length & thresholds configurable).
Optional VWAP proximity filter (price must be within X% of VWAP).
Long setup:
Price touches/under-cuts the lower Bollinger band AND RSI ≤ threshold (default 30) AND price is inside the HTF range (and passes VWAP filter if enabled).
Short setup:
Price touches/exceeds the upper Bollinger band AND RSI ≥ threshold (default 70) AND price is inside the HTF range (and passes VWAP filter if enabled).
Exits and risk
Stop-loss: placed just outside the HTF range with a configurable buffer %:
Long SL = HTF Support × (1 − buffer).
Short SL = HTF Resistance × (1 + buffer).
Take-profit (selectable):
Mid band (the Bollinger basis) → conservative, faster exits.
Opposite band / HTF boundary → more aggressive, higher RR but more give-backs.
Position sizing
A simple cap: maximum position size = percent of account equity (e.g., 20%).
The script calculates quantity from that cap and current price.
Plots you’ll see on the chart
HTF Resistance (red) and HTF Support (green) via plot().
HTF Midline (gray dashed) drawn with a line.new() object (because plot() cannot do dashed).
Bollinger basis/upper/lower on the LTF.
Optional VWAP line (only shown if you enable the filter).
Signal markers (green triangle up for Long setups, red triangle down for Short setups).
Alerts
Two alertconditions:
“Long Setup” – when a long entry condition appears.
“Short Setup” – when a short entry condition appears.
Create alerts from these to get notified in real time.
How to use it (quick start)
Add to a 1m or 5m chart of a liquid coin (BTC, ETH, SOL).
Set HTF timeframe (start with 1h) and lookback (e.g., 96 = ~4 days on 1h).
Keep default Bollinger/RSI first; tune later.
Choose TP mode:
“Mid band” for quick scalps.
“Opposite band/Range” if the range is very clean and you want bigger targets.
Set SL buffer (0.15–0.30% is common; adjust for volatility).
Set Max position % to control size (e.g., 20%).
(Optional) Enable VWAP filter to skip stretched moves.
When it works best
Clearly sideways markets with visible support/resistance on the HTF.
High-liquidity pairs where spreads/fees are small relative to your scalp target.
Limitations & safety notes
True breakouts will invalidate mean-reversion logic—your SL outside the range is there to cut losses fast.
Fees can eat into small scalps—prefer limit orders, rebates, and liquid pairs.
Backtest results vary by exchange data; always forward-test on small size.
If you want, I can:
Add an ATR-based stop/target option.
Provide a study-only version (signals/alerts, no trading engine).
Pre-set risk to your €5,000 plan (e.g., ~0.5% max loss/trade) with calculated qty.
Chanpreet RSI Extreme Rays Version 1.0Identifies short-term momentum extremes and highlights potential reversal zones.
Market Pulse Dip RadarThis indicator is designed to help traders spot meaningful dips in price and then evaluate whether those dips are worth trading or not. It doesn’t just mark a dip; it also helps with risk management, trade planning, and filtering out weak signals.
Here’s how it works:
First, it looks at the recent high price and checks how much the market has dropped from that high. If the drop is larger than the minimum percentage you set, it marks it as a potential dip.
Next, it checks the trend structure by using two moving averages (a fast one and a slow one). If the fast average is below the slow average, it means the market is in a weaker structure, and that dip is considered more valid.
On top of that, you can enable a multi-timeframe filter. For example, if you are trading on the 15-minute chart, you can ask the indicator to confirm that the 1-hour trend is also supportive before showing you a dip. This helps avoid trading against the bigger trend.
Risk management is built in. The indicator automatically suggests a stop-loss by combining volatility (ATR) and recent swing lows. It then draws three profit target levels (1x risk, 2x risk, and 3x risk). This makes it easier to plan where to exit if the trade works.
A key part of this tool is the confidence score. Each dip signal is rated from 0 to 100. The score depends on how deep the dip is, how far apart the moving averages are, how healthy volatility is, and whether the higher timeframe supports the trade. The score is then labeled as High, Medium, Low, or Wait. This helps traders focus only on the stronger setups.
On the chart, dip signals are marked with a diamond shape under the bars. The color of the diamond tells you if it’s high, medium, or low quality. When a signal appears, the indicator also plots horizontal lines for the entry, stop, and targets.
To make it easier to read, there is also a dashboard box that shows the current score, quality, dip percentage, and suggested stop-loss. This means you don’t have to calculate or check different things yourself – everything is visible in one place.
Finally, it comes with alerts. You can set alerts for when a dip signal happens, or when it’s medium or high confidence. This way, you don’t need to stare at charts all day; TradingView can notify you.
So in short, this tool:
• Finds dips based on your rules.
• Filters them using structure, volatility, and higher timeframe trend.
• Suggests stop-loss and profit targets.
• Rates each dip with a confidence score.
• Shows all this info in a clean dashboard and alerts you when it happens.
👉 Do you want me to now explain how a trader would actually use it in practice (step by step, from signal to trade)?
EMA20 Entry with Lei Teacher Strategy_Trend_Follow_RuleEMA20 Entry with Lei Teacher Strategy Trend Follow Entry Alert
Momentum Fusion Pro X Elite1️⃣ Impulse Detection
Purpose: Identify fast, significant price movements that could provide entry opportunities.
upImpulse: Triggered when the current candle breaks above the high from 2 candles ago and closes above that level.
downImpulse: Triggered when the current candle breaks below the low from 2 candles ago and closes below that level.
confirmLong / confirmShort: Only consider candles that close above/below the impulse level to reduce false signals.
Visualization: Boxes and lines mark the impulse zones on the chart.
Explanation: “We mark zones where the price shows clear momentum, helping spot potential entry points.”
2️⃣ Trend Filters
Purpose: Trade in the direction of the main trend.
EMA Fast & Slow: Determine the current timeframe trend.
EMA Multi-Timeframe (HTF): Confirms the trend on a higher timeframe.
trendHTF: Combines EMA, RSI, and CCI from the higher timeframe for stronger trend confirmation.
Explanation: “We only take trades aligned with the current trend and the higher timeframe trend.”
3️⃣ Momentum & Volatility Filters
Purpose: Ensure the move has strength before entering.
RSI & CCI: Confirm momentum and avoid overbought/oversold extremes.
Volume: Only consider candles with above-average volume.
VWAP: Confirms price is above/below VWAP for bullish/bearish validation.
ATR / Volatility: Only enter trades if candle size exceeds a multiple of ATR to filter weak moves.
Explanation: “This ensures entries occur during strong and validated moves, not weak or fake breakouts.”
4️⃣ Signal Scoring System
Purpose: Increase signal reliability by combining multiple filters.
Each filter contributes 1 point: impulse confirmation, EMA trend, HTF trend, RSI, CCI, volume, VWAP, and volatility.
minScore: Minimum number of filters required for a signal (default 6 out of 8).
finalLong / finalShort: Signals only appear if they meet or exceed the minimum score.
Explanation: “Signals are shown only when most indicators agree, reducing false positives.”
5️⃣ Chart Visualization
Green / Red triangles: Strong long or short signals.
Boxes and lines: Show impulse zones for support/resistance levels.
Explanation: “Arrows indicate high-probability trades, while zones help identify key price levels.”
6️⃣ Dashboard
Configurable position: Top Right, Bottom Right, Bottom Left.
Shows:
Number of detected impulse signals
Signal strength (longScore / shortScore)
Trend direction of higher timeframe
Explanation: “Quickly assess signal strength and trend without analyzing each indicator individually.”
7️⃣ Adjustable Parameters
EMA lengths and Trend Window
RSI / CCI periods and overbought/oversold levels
Volume average and ATR multiplier for volatility
Higher timeframe trend confirmation
Minimum active filters for signal validity
Explanation: “You can customize the indicator for conservative or aggressive trading styles.”
⚠️ Disclaimer
This indicator is for educational purposes only and does not guarantee profits. Trading involves risk, and users should trade responsibly and at their own risk.
GMMA ABC Signal Goal (one-liner)
Detect trend-aligned entries using an 18-EMA GMMA stack, then filter out chop with momentum (ATR), trend strength (ADX/RSI), and a tight-range (“box”) mute. Auto-draw SL/TP and fire alerts.
1) Core inputs & idea
Three entry archetypes
Type A (Structure break in a tight bundle): GMMA is narrow → price breaks prior swing with correct bull/bear sequence.
Type B (Trend continuation): Price crosses many EMAs with body and short>mid (bull) or short midAvg, close > longAvg, candle pass.
Short: red body, crossBodyDown ≥ bodyThresh, shortAvg < midAvg, close < longAvg, candle pass.
Anti-chop add-ons:
Require GMMA spread ≥ minSpreadB (trend sufficiently expanded).
ADX/RSI gate (configurable AND/OR and individual enable flags):
ADX ≥ adxMin_B
RSI ≥ rsiMinLong_B (long) or RSI ≤ rsiMaxShort_B (short)
Type C — momentum pop
Needs many crosses (crossUp / crossDown ≥ crossThresh) and a strong candle.
Has its own ATR body threshold: body ≥ ATR * atrMultC (separate from global).
6) Global “Box” (tight-range) mute
Look back boxLookback bars; if (highest−lowest)/close ≤ boxMaxPct, then mute all signals.
Prevents trading inside cramped ranges.
7) Signal priority + confirmation + cooldown
Compute raw A/B/C booleans.
Pick first valid in order A → B → C per side (long/short).
Apply:
Bar confirmation (confirmClose)
Cooldown (no new signal within cooldownBars after last)
Global box mute
Record bar index to enforce cooldown.
8) SL/TP logic (simple R-based scaffolding)
SL: previous swing extreme within structLookback (long uses prevLow, short uses prevHigh).
Risk R: distance from entry close to SL (min-tick protected).
TPs: TP1/TP2/TP3 = close ± R × (tp1R, tp2R, tp3R) depending on side.
On a new signal, draw lines for SL/TP1/TP2/TP3; keep them for keepBars then auto-delete.
9) Visuals & alerts
Plot labels for raw Type A/B/C (so you can see which bucket fired).
Entry label on the chosen signal with SL/TP prices.
Alerts: "ABC LONG/SHORT Entry" with ticker & timeframe placeholders.
10) Info panel (top-right)
Shows spread%, box%, ADX, RSI on the last/confirmed bar for quick situational awareness.
11) How to tune (quick heuristics)
Too many signals? Increase minSpreadB, adxMin_B, bodyThresh, or enable confirmClose and a small cooldownBars.
Missing breakouts? Lower atrMultC (Type C) or crossThresh; relax minSpreadB.
Choppy pairs/timeframes? Raise boxMaxPct sensitivity (smaller value mutes more), or raise atrMult (global) to demand fatter candles.
Cleaner trends only? Turn on strictSeq for Type A; raise minSpreadB and adxMin_B.
12) Mental model (TL;DR)
A = “Tight coil + fresh structure break”
B = “Established trend, strong continuation” (spread + ADX/RSI keep you out of chop)
C = “Momentum burst through many EMAs” (independent ATR gate)
Then add box mute, close confirmation, cooldown, and auto SL/TP scaffolding.
Hoàng già — Hoàng giàSimplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Simplify it based on the structure of the frame price
Auto S/R 1H - Stable Simplethat is a script to find out the support and resistance as trendlines for stocks in one hour timeframe for swing trading.
Anchorman - EMA Channel + EMA + MTF Status Table PRICE BREAKOUTUses a high/low EMA Channel to tell you when strong price breakouts are happening plus comes with a EMA to help follow the trend if you like. I designed it so it can alert you when a single TF touch happens or a breakout alignment on MTF happens (I recommend this) its up to you also its single alert so no need to do bullish or bearish signals just one signal will alert you when a breakout happens in EITHER direction.