Cheat Setup//@version=5
indicator("Cheat Setup", overlay=true)
// === User inputs ===
adr_period = input.int(20, title="ADR Window (days)")
lookback = input.int(100, title="Historical Lookback (bars)")
sensitivity = input.float(1.5, minval=0.5, step=0.1, title="Sensitivity (Multiplier of Avg ADR%)")
show_threshold_lines = input.bool(true, title="Show ADR% / Threshold Lines")
// === ADR% Calculation ===
// ADR% = (20-day high - 20-day low) / 20-day low × 100
adr_percent = (ta.highest(high, adr_period) - ta.lowest(low, adr_period)) / ta.lowest(low, adr_period) * 100
// Average ADR% over lookback period
avg_adr_percent = ta.sma(adr_percent, lookback)
// Adaptive threshold
adaptive_threshold = avg_adr_percent * sensitivity
// Detection condition
cheat_setup_signal = adr_percent > adaptive_threshold
// === Plotting ===
bgcolor(cheat_setup_signal ? color.new(color.green, 80) : na, title="Cheat Setup Background")
// Optional: Visual aid lines
plot(show_threshold_lines ? adr_percent : na, title="ADR(20)%", color=color.orange)
plot(show_threshold_lines ? avg_adr_percent : na, title="Average ADR%", color=color.gray)
plot(show_threshold_lines ? adaptive_threshold : na, title="Adaptive Threshold", color=color.red)
// ## What This Script Is For
// This script helps detect potential breakout zones — often called a "Cheat Setup" — before they happen.
// It's useful for identifying periods where a stock's volatility starts expanding after consolidation, which often leads to a breakout.
// ## What Is a Cheat Setup?
// A Cheat Setup is a technical setup where:
// > The price has been consolidating within a narrow range.
// > When volatility suddenly increases, it may indicate a breakout is about to occur.
// This script alerts you when that volatility expansion begins, using an adaptive threshold.
// ## How the Script Works (Step by Step)
// 1. Calculates ADR%:
// Measures how much the price has moved over the past N days (default: 20),
// using the formula: (20-day high - 20-day low) ÷ 20-day low × 100
// 2. Calculates the average ADR% over a longer lookback period (default: 100 bars).
// 3. Sets an adaptive threshold:
// The average ADR% multiplied by a user-defined sensitivity factor (e.g. 1.5×).
// 4. Triggers a cheat setup signal if the current ADR% exceeds the threshold.
// 5. Displays a green background on the chart during the signal to visually highlight the cheat area.
// 6. Optionally draws 3 reference lines:
// - Current ADR% (orange line)
// - Average ADR% (gray line)
// - Adaptive threshold (red line)
// ## How to Use the Script
// 1. Apply the script on a TradingView chart (daily timeframe is recommended).
// 2. Select a stock (e.g. AAPL, TSLA, 0700, 9988).
// 3. Monitor for periods when the background turns green.
// 4. These green zones signal that volatility has increased — the stock may be preparing for a breakout.
// ## What to Do When You See a Green Background
// - Add the stock to your watchlist.
// - Wait for confirmation — such as a breakout above the recent consolidation range.
// - Use other indicators like RSI, volume, or moving averages to filter signals.
// - Avoid chasing; instead, use the green zone as early warning and plan your entry.
// ## Recommended Parameter Settings
// Parameter | Purpose
// ---------------------- | ---------------------------------------------------------------
// `adr_period` | Number of days to calculate ADR%, e.g. 20
// `lookback` | Number of bars to average ADR%, e.g. 100
// `sensitivity` | Multiplier for adaptive threshold. 1.5 = moderate, 2.0 = strict
// `show_threshold_lines` | Toggle visibility of the ADR%, average, and threshold lines
// If the signal appears too frequently, increase the `sensitivity`. If too few, lower it slightly.
// ## Summary
// This script identifies stocks that are showing early signs of a breakout based on abnormal volatility expansion.
// It's especially useful for traders who want to get ahead of the move — before a breakout occurs — rather than reacting to it afterward.
// If you'd like, I can extend this script to also include:
// - Volume filters
// - Consolidation zone detection
// - Alert setup
// - Breakout confirmation (e.g. close > recent high)
// Let me know if you want to take it further.
Indicatori di ampiezza
Pattern + Supertrend + Stoch RSI Signals**Strategy Description: Pattern + Supertrend + Stochastic RSI Filter**
This trading strategy combines three robust technical analysis methods to generate high-quality trade signals:
### 1. **Candlestick Patterns**
The script detects classic reversal patterns including:
* **Hammer** (bullish reversal)
* **Shooting Star** (bearish reversal)
* **Bullish Engulfing**
* **Bearish Engulfing**
* **Morning Star** (bullish reversal)
* **Evening Star** (bearish reversal)
These patterns are only valid when they occur in the direction of the prevailing trend confirmed by Supertrend.
### 2. **Supertrend Filter**
Supertrend acts as a trend filter:
* Only **long trades** are taken when Supertrend is **bullish**.
* Only **short trades** are taken when Supertrend is **bearish**.
This ensures that trades are not taken against the major market direction.
### 3. **Stochastic RSI Confirmation**
To refine entries, the strategy adds an oscillator-based filter:
* **Overbought (>80)** and **Oversold (<20)** zones must be met.
* A **Stochastic RSI crossover** is required:
* %K crossing above %D when oversold (for longs)
* %K crossing below %D when overbought (for shorts)
This helps in capturing entries only when momentum is likely to reverse, avoiding low-quality signals in flat markets.
### Trade Signals:
A trade signal is generated only when all three conditions are met:
1. A recognized candlestick pattern appears.
2. The Supertrend confirms the trade direction.
3. The Stochastic RSI confirms a crossover in overbought or oversold conditions.
This layered filtering system reduces false signals and focuses on higher-probability trade setups that align with trend and momentum.
**Use case:** Best suited for swing trading or intraday setups where market context and timing are crucial.
**Timeframes:** Works on multiple timeframes but performs better on 15m, 1H, or 4H for more reliable patterns and trend behavior.
OBV + Momentum + DI+ Dashboard 📊 Script Description: OBV + Momentum + DI+ Dashboard
This custom TradingView indicator combines three powerful technical analysis tools—On-Balance Volume (OBV), Momentum (ROC), and Directional Movement Index (+DI)—into a single, easy-to-read dashboard.
🔍 Key Features:
✅ Buy & Sell Signals
Plots signals on the chart when multiple conditions align:
Buy Signal: Bullish candle + Rising OBV + Positive Momentum + Strong +DI
Sell Signal: Bearish candle + Falling OBV + Negative Momentum + Weak +DI
✅ Dashboard Panel (Top Center)
A real-time dashboard displays key market conditions:
Price Action (Bullish, Bearish, or Neutral)
OBV Trend (Rising, Falling, or Flat)
Momentum (Rising, Falling, or Flat)
+DI Strength (Strong, Weak, or Neutral)
✅ Visual Enhancements
Color-coded trends for quick interpretation.
Compact table view in the center top of the chart.
📈 Technical Indicators Used:
OBV (On-Balance Volume): Measures buying/selling pressure via volume.
Momentum (Rate of Change): Detects acceleration/deceleration in price movement.
+DI from DMI/ADX: Indicates the strength of the uptrend.
This tool is ideal for momentum traders, volume analysts, and those who prefer a confluence-based trading approach. Use it on any time frame or asset to help confirm entries and exits with greater confidence.
Time//@version=5
indicator('Time', overlay=true, max_bars_back=1000, max_labels_count=500, max_lines_count=500, max_boxes_count=500)
// Asia
var GRP1 = "Asian Session"
extendLines = true
rangeTime = '1705-0101'
boxLineColor = input(color.new(color.rgb(212, 129, 4), int(80)), 'Line color', group=GRP1)
backgroundColor = input(color.new(color.rgb(221, 133, 0), int(90)), "Background color", group=GRP1)
// A session
inSession1 = not na(time(timeframe.period, rangeTime))
inExtend = not na(time(timeframe.period, "0100-0801"))
startTime = 0
startTime := inSession1 and not inSession1 ? time : startTime
var line lowHLine = na
var line topHLine = na
var line leftVLine = na
var line rightVLine = na
var line middleHLine = na
var box bgBox = na
var low_val = float(0.0)
var high_val = 0.0
if inSession1 and not inSession1
low_val := low
high_val := high
high_val
if inSession1 and timeframe.isintraday
if inSession1
line.delete(lowHLine)
line.delete(topHLine)
line.delete(middleHLine)
box.delete(bgBox)
if low < low_val
low_val := low
low_val
if high > high_val
high_val := high
high_val
if true and timeframe.multiplier <= 60
bgBox := box.new(startTime, high_val, time, low_val, xloc=xloc.bar_time, bgcolor=backgroundColor, border_width=0)
if true and timeframe.multiplier <= 60
lowHLine := line.new(startTime, low_val, time, low_val, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=1)
topHLine := line.new(startTime, high_val, time, high_val, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=1)
if true and timeframe.multiplier <= 60
middleHLine := line.new(startTime, (high_val + low_val) / 2, time, (high_val + low_val) / 2, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=1)
else
if inExtend and extendLines and not inSession1 and timeframe.isintraday
time1 = line.get_x1(lowHLine)
time2 = line.get_x2(lowHLine)
price = line.get_y1(lowHLine)
line.delete(lowHLine)
lowHLine := line.new(time1, price, time, price, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=1)
time1 := line.get_x1(topHLine)
time2 := line.get_x2(topHLine)
price := line.get_y1(topHLine)
line.delete(topHLine)
topHLine := line.new(time1, price, time, price, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=1)
time1 := line.get_x1(middleHLine)
time2 := line.get_x2(middleHLine)
price := line.get_y1(middleHLine)
line.delete(middleHLine)
middleHLine := line.new(time1, price, time, price, xloc=xloc.bar_time, color=boxLineColor, style=line.style_solid, width=1)
middleHLine
// LDN & NY
remove(str, pos, length) =>
arr = str.split(str, "")
len = array.size(arr)
pos1 = pos >= 0 ? pos : len + pos
length_ = length >= 0 ? length : len - pos1
pos2 = pos1 + length_
if len > 0 and length_ > 0 and pos1 >= 0 and pos2 <= len
for i = 0 to length_ - 1
array.remove(arr, pos1)
res = array.join(arr, "")
CalcOffs(timeStr) =>
hourStartStr = remove(timeStr, 2, 7)
hourStart = str.tonumber(hourStartStr)
minStartTemp = remove(timeStr, 0, 2)
minStartStr = remove(minStartTemp, 2, 5)
minStart = str.tonumber(minStartStr)
timeEndStr = remove(timeStr, 0, 5)
hourEndStr = remove(timeEndStr, 2, 2)
hourEnd = str.tonumber(hourEndStr)
minEndStr = remove(timeEndStr, 0, 2)
minEnd = str.tonumber(minEndStr)
time_diff_minutes = str.tostring(math.abs((hourEnd * 60 + minEnd) - (hourStart * 60 + minStart)))
// Settings
isLondon = true
loSessionTime = input.session("0300-0400", title="Session", group = "London Session")
loBoxColor = input.color(color.new(#2962ff, 80), title="Background color", group = "London Session")
isNewYorkTrap = true
nytrapSessionTime = input.session("0900-1000", title="Session", group ="New York Trap Session")
nytrapBoxColor = input.color(color.new(#2962ff, 80), title="Background color", group = "New York Trap Session")
loOffs = math.round(str.tonumber(CalcOffs(loSessionTime)))
nytrapOffs = math.round(str.tonumber(CalcOffs(nytrapSessionTime)))
dayOffs = 1440
if timeframe.period == "S"
loOffs := loOffs * 60
nytrapOffs := nytrapOffs * 60
dayOffs := dayOffs * 60
if timeframe.period == "5S"
loOffs := loOffs * 60 / 5
nytrapOffs := nytrapOffs * 60/5
dayOffs := dayOffs * 60 / 5
if timeframe.period == "15S"
loOffs := loOffs * 60 / 15
nytrapOffs := nytrapOffs *60 / 15
dayOffs := dayOffs * 60 / 15
if timeframe.period == "30S"
loOffs := loOffs * 60 / 30
nytrapOffs := nytrapOffs *60 / 30
dayOffs := dayOffs * 60 / 30
if timeframe.period == "3"
loOffs := loOffs / 3
nytrapOffs := nytrapOffs /3
dayOffs := dayOffs / 3
if timeframe.period == "5"
loOffs := loOffs / 5
nytrapOffs := nytrapOffs / 5
dayOffs := dayOffs / 5
if timeframe.period == "15"
loOffs := loOffs / 15
nytrapOffs := nytrapOffs / 15
dayOffs := dayOffs / 15
if timeframe.period == "30"
loOffs := loOffs / 30
nytrapOffs := nytrapOffs / 30
dayOffs := dayOffs / 30
if timeframe.period == "45"
loOffs := loOffs / 45
nytrapOffs := nytrapOffs / 45
dayOffs := dayOffs / 45
if timeframe.period == "60"
loOffs := loOffs / 60
nytrapOffs := nytrapOffs / 60
dayOffs := dayOffs / 60
if timeframe.period == "120"
loOffs := loOffs / 120
nytrapOffs := nytrapOffs / 120
dayOffs := dayOffs / 120
if timeframe.period == "180"
loOffs := loOffs / 180
nytrapOffs := nytrapOffs / 180
dayOffs := dayOffs / 180
if timeframe.period == "240"
loOffs := loOffs / 240
nytrapOffs := nytrapOffs / 240
dayOffs := dayOffs / 240
if true and timeframe.multiplier <= 60
if isLondon
var sessionHighPrice = 0.0
var sessionLowPrice = 0.0
var sessionOpenPrice = 0.0
var box sessionBox = na
var line sessionTopLine = na
var line sessionLowLine = na
inSession = not na(time(timeframe.period, loSessionTime)) and timeframe.isintraday
sessionStart = inSession and not inSession
if sessionStart
sessionHighPrice := high
sessionLowPrice := low
sessionOpenPrice := open
else if inSession
sessionHighPrice := math.max(sessionHighPrice, high)
sessionLowPrice := math.min(sessionLowPrice, low)
if sessionStart
sessionBox := box.new(left=bar_index, top=na, right=bar_index+loOffs, bottom=na, border_color = color.new(#ffffff, 100), bgcolor=loBoxColor)
sessionTopLine := line.new(x1=bar_index, y1=na, x2=bar_index+loOffs, y2=na, style=line.style_solid, width=0)
sessionLowLine := line.new(x1=bar_index, y1=na, x2=bar_index+loOffs, y2=na, style=line.style_solid, width=0)
if inSession
box.set_top(sessionBox, sessionHighPrice)
box.set_bottom(sessionBox, sessionLowPrice)
if isNewYorkTrap
var sessionHighPrice = 0.0
var sessionLowPrice = 0.0
var sessionOpenPrice = 0.0
var box sessionBox = na
var line sessionTopLine = na
var line sessionLowLine = na
inSession = not na(time(timeframe.period, nytrapSessionTime)) and timeframe.isintraday
sessionStart = inSession and not inSession
if sessionStart
sessionHighPrice := high
sessionLowPrice := low
sessionOpenPrice := open
else if inSession
sessionHighPrice := math.max(sessionHighPrice, high)
sessionLowPrice := math.min(sessionLowPrice, low)
if sessionStart
sessionBox := box.new(left=bar_index, top=na, right=bar_index+nytrapOffs, bottom=na, border_color = color.new(#ffffff, 100), bgcolor=nytrapBoxColor)
sessionTopLine := line.new(x1= bar_index, y1=na, x2=bar_index+nytrapOffs, y2=na, style=line.style_solid, width=0)
sessionLowLine := line.new(x1= bar_index, y1=na, x2=bar_index+nytrapOffs, y2=na, style=line.style_solid, width=0)
if inSession
box.set_top(sessionBox, sessionHighPrice)
box.set_bottom(sessionBox, sessionLowPrice)
box.set_top(sessionBox, sessionHighPrice)
box.set_bottom(sessionBox, sessionLowPrice)
var GRPFF = 'Frankfurt Session'
ffsession = '0200-0201'
ffcolor = input.color(color.new(#787b86, 70), title='Line color', group=GRPFF)
var GRPMMM1 = 'Magic Manipulation Minute 1'
mmm1time = '0430-0431'
mmm1color = input.color(color.new(#787b86, 70), title="Line color",group=GRPMMM1)
var GRPMMM2 = 'Magic Manipulation Minute 2'
mmm2time = '0630-0631'
mmm2color = input.color(color.new(#787b86, 70), title="Line color", group=GRPMMM2)
var GRPNYO = 'New York Open'
nyosession = '0800-0801'
nyocolor = input.color(color.new(#787b86, 70),title="Line color", group=GRPNYO)
var GRPLC = 'London Close'
lcsession = '1100-1101'
lccolor = input.color(color.new(#787b86, 0),title="Line color", group=GRPLC)
asiansize = (high_val-low_val)/4
in_session_ff = time(timeframe.period, ffsession)
sessionffActive = in_session_ff and timeframe.multiplier <= 15
var line ff = na
if sessionffActive and sessionffActive == false
ff := line.new(bar_index, high+asiansize, bar_index, low-asiansize, color=ffcolor, style=line.style_solid)
in_session_mmm1 = time(timeframe.period, mmm1time)
sessionmmm1Active = in_session_mmm1 and timeframe.multiplier <= 15
var line mmm1 = na
if sessionmmm1Active and sessionmmm1Active == false
mmm1 := line.new(bar_index, high+asiansize, bar_index, low-asiansize, color=mmm1color, style=line.style_solid)
in_session_mmm2 = time(timeframe.period, mmm2time)
sessionmmm2Active = in_session_mmm2 and timeframe.multiplier <= 15
var line mmm2 = na
if sessionmmm2Active and sessionmmm2Active == false
mmm2 := line.new(bar_index, high+asiansize, bar_index, low-asiansize, color=mmm2color, style=line.style_solid)
in_session_nyo = time(timeframe.period, nyosession)
sessionnyoActive = in_session_nyo and timeframe.multiplier <= 15
var line nyo = na
if sessionnyoActive and sessionnyoActive == false
nyo := line.new(bar_index, high+asiansize, bar_index, low-asiansize, color=nyocolor, style=line.style_solid)
in_session_lc = time(timeframe.period, lcsession)
sessionlcActive = in_session_lc and timeframe.multiplier <= 15
var line lc = na
if sessionlcActive and sessionlcActive == false
lc := line.new(bar_index, high+asiansize, bar_index, low-asiansize, color=lccolor, style=line.style_solid)
Improved Stoch RSI + Supertrend Filter**Script Description: Improved Stoch RSI + Supertrend Filter**
This custom TradingView indicator combines two powerful tools—Stochastic RSI and Supertrend—to generate high-probability trade signals. It is designed for traders who prefer clear, filtered entries based on momentum and trend direction.
### Core Logic:
1. **Stochastic RSI Crossovers:**
* The indicator calculates a smoothed Stochastic RSI using user-defined lengths and smoothing parameters.
* Signals are only considered when a %K/%D crossover happens in extreme zones:
* **Bullish signal**: %K crosses above %D in the **oversold** zone.
* **Bearish signal**: %K crosses below %D in the **overbought** zone.
2. **Supertrend Filter:**
* The Supertrend indicator, based on ATR, filters trades by confirming the overall trend.
* Only **bullish crossovers** are signaled when the Supertrend is green (uptrend).
* Only **bearish crossovers** are signaled when the Supertrend is red (downtrend).
### Entry Conditions:
* **Long Entry:**
* %K crosses above %D in the oversold zone.
* Supertrend confirms an uptrend.
* **Short Entry:**
* %K crosses below %D in the overbought zone.
* Supertrend confirms a downtrend.
### Visual Aids:
* Buy and sell signals are plotted with green and red labels respectively.
* The Supertrend line is also plotted, switching color based on direction.
### Alerts:
* Custom alerts are set for both long and short conditions, making this script suitable for automated or alert-driven trading setups.
This script is ideal for swing and momentum traders looking to enter trades in strong trend conditions, filtering out noise and false reversals.
OBV PanelOBV Panel – Volume-Based Price Prediction & Signal Dashboard
Powered by Pine Script v6
🔍 Overview
This multi-functional indicator is designed around the On-Balance Volume (OBV) concept, enhancing it with prediction models, trend tracking, and actionable buy/sell signals. It uses a combination of real-time OBV movement, smoothed OBV with EMA, and linear regression-based OBV forecasts to deliver both intraday and weekly insights — all neatly displayed in a table panel and directly plotted on your chart.
⚙️ Core Components
📌 1. OBV Core
OBV is calculated based on volume flowing into or out of a stock as price moves up or down.
Tracks raw OBV and its EMA (Exponential Moving Average) for smoother trend reading.
Computes a Predicted OBV using Linear Regression (ta.linreg) over a user-defined number of bars.
🔮 2. Predicted Price Forecast
Uses OBV percentage changes combined with a user-set sensitivity factor to project next day’s expected price.
Offers an AI-style price forecast based on OBV strength, not just price action.
💹 3. Buy/Sell Signal Logic
Daily Signals: Triggered when OBV, OBV EMA, and Predicted OBV all move upward or downward from the previous day.
Weekly Signals: Based on EMA changes over a 5-bar period (approx. 1 week).
Signal markers are drawn on the chart for visual reference.
📊 Table Panel (Top-Right Overlay)
A detailed visual panel shows:
Metric Description
OBV, OBV EMA, Predicted OBV From previous close to current value
OBV - Predicted OBV Difference In lakhs (scaled for readability)
% Change Stats Daily percentage change in OBV, EMA, and Predicted OBV
Weekly OBV EMA Change Actual & % change over 5 bars
Signal Summary BUY/SELL or HOLD based on logic
OBV Dominance Whether OBV > EMA and Predicted OBV
Predicted Price (Next Day) Based on OBV dynamics and sensitivity
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
Gold Buy/Sell Signals with Engulfing & S&D ZonesTrade base on the Fast & Slow Moving Average. When the Fast MA line is below the candle, it is an uptrend to BUY. if Fast MA line is above the candle, it's time to SELL.
SUPER Signal Alert BY JAK"Buy or sell according to the signal that appears, but it should also be confirmed with other technical tools." FX:USDJPY FX:EURUSD OANDA:XAUUSD BITSTAMP:BTCUSD OANDA:GBPUSD OANDA:GBPJPY
Macro Alignment SummaryThis indicator provides a simple, color-coded summary of macro trend alignment across three benchmark assets.
It calculates how many of the selected benchmarks are currently trading above a specified moving average (configurable type, length, and timeframe).
The result is plotted as a score from 0 to 3:
🔴 0: No benchmarks aligned
🟠 1: Weak alignment
🟡 2: Partial alignment
🟢 3: Full macro alignment
🔧 Fully customizable:
Choose any 3 benchmark symbols (e.g., BTC, ETH, QQQ)
Select timeframe (e.g., daily, weekly)
Pick MA type (SMA or EMA) and length (e.g., 21, 50, 200)
Ideal for filtering trades based on broader market strength or for use in a macro trend dashboard alongside entry signals.
_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
Macro Dashboard Multi-TickerThis indicator gives you a compact, high-impact overview of up to 10 custom assets — showing whether each is currently trading above or below a key moving average on a shared timeframe.
🟩 Above MA = colored bar
⬛ Below MA = dimmed bar
Features:
Monitor up to 10 symbols (stocks, crypto, ETFs, etc.)
Customize:
- Symbol
- Color
- Timeframe
- MA type (EMA/SMA)
- MA length
Shared logic keeps the layout clean and consistent.
Use Cases:
- Build a macro trend dashboard for SPY, QQQ, BTC, ETH, ARKK, IWM, DXY, VIX, etc.
- Confirm risk-on alignment
- Identify broad market rotation or weakness
- Pair with individual asset setups to stay in sync with the environment
This tool is ideal for traders who want a one-glance check on market strength without cluttering their main charts. It's fast, flexible, and highly visual.
BTC Smart Buy/Sell//@version=5
indicator("BTC Smart Buy/Sell", overlay=true)
// === INPUTS ===
rsiPeriod = input.int(14, "RSI Period")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
atrPeriod = input.int(10, "ATR Period")
atrMultiplier = input.float(3.0, "Supertrend Multiplier")
volMultiplier = input.float(1.5, "Volume Spike Multiplier")
// === CALCULATIONS ===
rsi = ta.rsi(close, rsiPeriod)
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdCrossUp = ta.crossover(macdLine, signalLine)
macdCrossDown = ta.crossunder(macdLine, signalLine)
// Supertrend
= ta.supertrend(atrMultiplier, atrPeriod)
// Volume spike
avgVol = ta.sma(volume, 20)
volSpike = volume > avgVol * volMultiplier
volDrop = volume < avgVol * 0.7
// === CONDITIONS ===
buyCond = (rsi < 30 ? 1 : 0) + (macdCrossUp ? 1 : 0) + (supertrendDir == 1 ? 1 : 0) + (volSpike ? 1 : 0)
sellCond = (rsi > 70 ? 1 : 0) + (macdCrossDown ? 1 : 0) + (supertrendDir == -1 ? 1 : 0) + (volDrop ? 1 : 0)
buySignal = buyCond >= 3
sellSignal = sellCond >= 3
// === PLOT ===
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
10 EMA -3*ATRThis custom indicator plots the line calculated as 10-period Exponential Moving Average (EMA) minus 3 times the 14-period Average True Range (ATR). It helps traders identify dynamic support levels or pullback zones during strong trends by adjusting for market volatility. A falling line may signal increasing volatility or weakening momentum, while a rising line may indicate strengthening trend stability. Suitable for trend-following strategies and volatility-aware entries.
Momentum + OBV Triangle Signals with Multi-Day Table1. Buy & Sell Signals Using Momentum + OBV:
Buy Signal is shown as a green triangle below the candle when:
Momentum is rising (today > yesterday)
OBV is rising (today > yesterday)
Sell Signal is shown as a red triangle above the candle when:
Momentum is falling (today < yesterday)
OBV is falling (today < yesterday)
2. Multi-Day Analysis Table (Right Bottom Corner):
Displays both Momentum and OBV values for the current and past two days with the following data:
D-2: Value from 2 bars ago
D-1: Value from 1 bar ago
Now: Current bar value
Diff: Change from D-1 to Now
% Change: Percentage change from D-1 to Now
Metric D-2 D-1 Now Diff (Now - D-1) % Change
Momentum Value Value Value Change % Change
OBV Value Value Value Change % Change
Cumulative Intraday Volume with Long/Short LabelsThis indicator calculates a running total of volume for each trading day, then shows on the price chart when that total crosses levels you choose. Every day at 6:00 PM Eastern Time, the total goes back to zero so it always reflects only the current day’s activity. From that moment on, each time a new candle appears the indicator looks at whether the candle closed higher than it opened or lower. If it closed higher, the candle’s volume is added to the running total; if it closed lower, the same volume amount is subtracted. As a result, the total becomes positive when buyers have dominated so far today and negative when sellers have dominated.
Because futures markets close at 6 PM ET, the running total resets exactly then, mirroring the way most intraday traders think in terms of a single session. Throughout the day, you will see this running total move up or down according to whether more volume is happening on green or red candles. Once the total goes above a number you specify (for example, one hundred thousand contracts), the indicator will place a small “Long” label at that candle on the main price chart to let you know buying pressure has reached that level. Similarly, once the total goes below a negative number you choose (for example, minus one hundred thousand), a “Short” label will appear at that candle to signal that selling pressure has reached your chosen threshold. You can set these threshold numbers to whatever makes sense for your trading style or the market you follow.
Because raw volume alone never turns negative, this design uses candle direction as a sign. Green candles (where the close is higher than the open) add volume, and red candles (where the close is lower than the open) subtract volume. Summing those signed volume values tells you in a single number whether buying or selling has been stronger so far today. That number resets every evening, so it does not carry over any buying or selling from previous sessions.
Once you have this indicator on your chart, you simply watch the “summed volume” line as it moves throughout the day. If it climbs past your long threshold, you know buyers are firmly in control and a long entry might make sense. If it falls past your short threshold, you know sellers are firmly in control and a short entry might make sense. In quieter markets or times of low volume, you might use a smaller threshold so that even modest buying or selling pressure will trigger a label. During very active periods, a larger threshold will prevent too many signals when volume spikes frequently.
This approach is straightforward but can be surprisingly powerful. It does not rely on complex formulas or hidden statistical measures. Instead, it simply adds and subtracts daily volume based on candle color, then alerts you when that total reaches levels you care about. Over several years of historical testing, this formula has shown an ability to highlight moments when intraday sentiment shifts decisively from buyers to sellers or vice versa. Because the indicator resets every day at 6 PM, it always reflects only today’s sentiment and remains easy to interpret without carrying over past data. You can use it on any intraday timeframe, but it works especially well on five-minute or fifteen-minute charts for futures contracts.
If you want a clear gauge of whether buyers or sellers are dominating in real time, and you prefer a rule-based method rather than a complex model, this indicator gives you exactly that. It shows net buying or selling pressure at a glance, resets each session like most intraday traders do, and marks the moments when that pressure crosses the levels you decide are important. By combining a daily reset with signed volume, you get a single number that tells you precisely what the crowd is doing at any given moment, without any of the guesswork or hidden calculations that more complicated indicators often carry.
BBS – Bond Breadth Signal"When bonds scream, breadth collapses, and fear spikes — BBS listens."
🧠 BBS – Bond Breadth Signal
A reversal timing tool built on macro conviction, not price noise.
The Bond Breadth Signal (BBS) was developed to identify major market inflection points by combining four key market stress indicators:
1) 10-Year Yield ROC – Measures sharp moves in the bond market
2) Z-Score of the 10Y – Captures statistical extremes
3) NSHF (Net Highs–Lows) – Signals internal market strength or weakness
4) TLT ROC + VIX – Confirmations of flight to safety and volatility-driven fear
When all conditions align, BBS marks either a For-Sure Buy or For-Sure Sell — these are rare, high-confidence signals designed to cut through noise and focus on true market dislocations.
🔧 Features:
-Background color and signal arrows on confirmation days
-Signals remain visually active for 3 days for added clarity
-Fully adjustable thresholds and alert toggles
-Plot panel for yield, TLT, NSHF, VIX, and Z-score visuals
This tool isn’t designed to fire every day. It’s meant to wait for those moments when the market truly bends — not just wiggles.
Best used on major indices (SPY, QQQ, IWM) to assess macro turning points.
Sniper vX∞.2.M.1 — Elite UX EditionThis is part 2z
add to part one
They make it complete
This is dicription that’s needed
Smart Grid Levels - Based on High/LowSmart Fibo
- Calculation of Key Levels:
- Finds the highest and lowest price within the lookbackBars range.
- Computes the price difference (diff) between the high and low.
- Determines the step size (step) by dividing diff by levels, creating evenly spaced grid levels.
- Drawing the Grid Levels:
- A loop (for i = 0 to levels) iterates through the number of levels.
- Each level is calculated based on the lowest price plus increments of step.
- Horizontal lines (line.new) are drawn at each level and extended rightward.
- If showLabels is enabled, price labels are placed at each level.
Usage in Trading :
- Helps identify support and resistance zones based on price range.
- Useful for grid trading strategies, where traders buy near lower levels and sell near higher ones.
- Provides a structured view of price movement without relying on traditional indicators.
💩 W$J Meme Index 🧻The official W$J Meme Index — a custom-built, market cap–weighted index tracking the top 14 meme coins in real time.
This indicator calculates the percent change from each coin’s initial price, applies a weight based on estimated market cap dominance, and combines them into a single index that starts at 100.
Coins included: DOGE, SHIB, PEPE, WIF, BONK, FLOKI, BOME, MEME, MYRO, TOSHI, SPX6900, MOG, GIGA, and POPCAT.
Designed by Wall Shit Journal for maximum degeneracy and absolute transparency.
💩 Degens Business. Trust the Index.
This index is weighted. Not fair. Not equal. Just like life.
TPG Trend + MACDUser Guide for "TPG Trend + MACD"
Author: TrungChuThanh
🔎 Main Functions
The TPG Trend + MACD indicator is a combined tool that integrates:
TPG Trend Histogram (spread between fast and slow EMA)
MACD Line & Signal for confirming trend momentum
Buy/Sell signals displayed directly on the indicator panel
⚙️ Components and Meaning
1️⃣ TPG Trend Histogram
Calculated from the difference between Fast EMA (9) and Slow EMA (26).
Light gray bars = bullish trend (spread > 0)
Dark gray bars = bearish trend (spread < 0)
Signal triggers:
B1 (green label): Crossover above 0 → Buy signal
S1 (red label): Crossunder below 0 → Sell signal
2️⃣ MACD Line & Signal
Consists of:
MACD Line = EMA(12) – EMA(26)
Signal Line = EMA(9) of the MACD Line
Confirmation signals:
B2 (blue triangle): MACD crosses above Signal → Buy confirmation
S2 (orange triangle): MACD crosses below Signal → Sell confirmation
MACD Line: Blue
Signal Line: Orange
📌 How to Use
Determine the main trend using the TPG Histogram
→ When the histogram crosses above zero → Consider Buy
→ When it crosses below zero → Consider Sell
Use MACD to confirm trend direction or optimize entry timing
✅ Prefer signals when both TPG and MACD align (e.g., B1 + B2 or S1 + S2)
⚠️ Avoid using the indicator alone; combine with support/resistance, RSI, volume, or other tools for higher accuracy
🛠️ Adjustable Parameters
Fast/Slow EMA for TPG Trend
Fast/Slow/Signal for MACD
Toggle to show/hide TPG and MACD elements in the panel
⚠️ Notes
This is a technical analysis tool, not investment advice
Always apply risk management, set clear stop-loss, and confirm signals across multiple timeframes