Adaptive Quadratic Kernel EnvelopeThis study draws a fair-value curve from a quadratic-weighted (Nadaraya-Watson) regression. Alpha sets how sharply weights decay inside the look-back window, so you trade lag against smoothness with one slider. Band half-width is ATRslow times a bounded fast/slow ATR ratio, giving an instant response to regime shifts without overshooting on spikes. Work in log space when an instrument grows exponentially, equal percentage moves then map to equal vertical steps. NearBase and FarBase define a progression of adaptive thresholds, useful for sizing exits or calibrating mean-reversion logic. Non-repaint mode keeps one-bar delay for clean back-tests, predictive mode shows the zero-lag curve for live decisions.
Key points
- Quadratic weights cut phase error versus Gaussian or SMA-based envelopes.
- Dual-ATR scaling updates width on the next bar, no residual lag.
- Log option preserves envelope symmetry across multi-decade data.
- Alpha provides direct control of curvature versus noise.
- Built-in alerts trigger on the first adaptive threshold, ready for automation.
Typical uses
Trend bias from the slope of the curve.
Entry timing when price pierces an inner threshold and momentum stalls.
Breakout confirmation when closes hold beyond outer thresholds while volatility expands.
Stops and targets anchored to chosen thresholds, automatically matching current noise.
サイクル
Ichimoku AdvancedGreetings. I present to you an improved version of the indicator from LuxAlgo - Ichimoku Theories.
I am grateful to them for the work they have done, since I myself have no experience in programming on Pine Script.
I have supplemented their indicator with such functions as:
Multi-timeframe Tenkan and Kijun lines - you will always know where on the lower timeframe there is a stronger resistance/support.
Ichimoku line formation areas - they can be used as a visualization of the number of bars that appear in the near lines, and for forecasting when the growth of the lines is caused by the fading of candles. They can also be used as measures for setting stop orders.
3-line pattern detector - Marker showing when the price is above/below the lines Tenkan ----> Kijun ----> Senkou A.
Please note that the calculation takes into account the CLOSING price of the candle.
3 Chikou Span lines - for those who use the 3 Chikou Span strategy -9, -26, -52 from the current bar ----> forward.
Points of the expected next direction of the Tenkan, Kijun, Senkou A and B lines and Senkou A and B with 0 offset.
Senkou A and B lines with 0 offset - for visualization of possible resistance/support
Calculation of the angle of inclination of the Ichimoku lines - for better perception of the trend strength. A 90° scale is used for measurement, where 0 is the horizontal position of the line
Measuring the distance from the current price to the Tenkan and Kijun lines - for better interpretation of the next possible price movements
Table - all key points for opening a position are displayed in the table. But please CONSIDER THE CONTENT and THE THEORY OF CYCLES AND WAVES by Goichi Hosoda.
May the take profit be with you!
Multi-Indicator Switch PanelAdaptive Entry Toolkit
This powerful indicator combines three high-quality trading systems into one modular, easy-to-use panel. Each system is independently toggleable, enabling full customization based on your trading style and market conditions.
📦 INCLUDED MODULES:
1. RSI Pullback Signals
Identifies momentum exhaustion and possible reversal zones using the Relative Strength Index.
Conditions tuned to detect when RSI pulls back after reaching oversold (for buys) or overbought (for sells) levels.
Highlights potential early entry points in trending markets.
2. Double EMA Pullback
Detects pullbacks in strong trends using a fast and slow EMA (default: 50 & 200).
Buy/Sell signals generated when price crosses back over the faster EMA in the direction of the larger trend.
Great for trend continuation entries.
🧠 ADVANCED FEATURES
Fully customizable inputs for each module
Alerts for every signal (RSI pullback, EMA cross, breakout from suppression)
Minimalistic and lightweight for real-time use
Overlay-based for clean integration with your price chart
🧰 Best Used For:
Anticipating breakouts
Trend continuation setups
Low-volatility squeeze detection
Confluence-based entries
Smart Pro Strategy – Buy/Sell + Elliott + Squeeze + Dashboard📊 Smart Momentum Pro – Complete Intraday Strategy for Stocks, Crypto, and Indices
✅ What’s Included:
• Buy/Sell signals based on price action, volume, and momentum
• Elliott Wave detection (1, 3, 5, A, B, C)
• Live market summary table with trend direction and volatility
• Fibonacci-based reversal zone
• Squeeze alert system with visual chart notifications
• Smart EMA 8/21/50/200 tracking
• Fully designed for black charts and red/green candles
• Perfect for BTC, ETH, SPY, HIMS, and more
🧠 Timeframes: Ideal for 5min, 15min, 1h, and Daily charts.
PRO Investing - LevelPRO Investing - Level
📊 Dynamic Support/Resistance
This indicator plots the PRO Investing Level, defined as the midpoint between the highest high and lowest low over the past 252 trading days (default lookback period, equivalent to ~1 year). It acts as a key mean-reversion reference level, useful for identifying potential support/resistance zones or market equilibrium levels.
Features:
🕰️ Option to display only today’s level or historical levels.
⚙️ Customizable lookback period for flexibility across timeframes and strategies.
📉 Teal line plotted directly on the chart, highlighting this institutional-grade level.
Ideal for traders looking to anchor price action to significant historical ranges—particularly useful in mean-reversion, breakout, or volatility compression strategies.
Touch 30 EMA & 150 EMA - Candle Signal//@version=5
indicator("Touch 30 EMA & 150 EMA - Candle Signal", overlay=true)
// Calculate EMAs
ema30 = ta.ema(close, 30)
ema150 = ta.ema(close, 150)
// Candle types
isGreen = close > open
isRed = close < open
// Candle touches both EMAs (either open-high-low-close range includes both)
touchesBothEMAs = low <= ema30 and high >= ema30 and low <= ema150 and high >= ema150
// Signals
greenArrow = isGreen and touchesBothEMAs
redArrow = isRed and touchesBothEMAs
// Plot arrows
plotshape(greenArrow, title="Green Candle Touch", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
plotshape(redArrow, title="Red Candle Touch", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)
// Plot EMAs for reference
plot(ema30, color=color.orange, title="EMA 30")
plot(ema150, color=color.blue, title="EMA 150")
BTC Buy/Sell SignalUse in higher time frames (weekly works best)
Condition Interpretation:
Red Shading: Indicates a scenario where Copper/Gold is strong (above zero), Copper/Bitcoin is weak (below zero), and the difference between them is pronounced (Smoothed MA Difference above Copper/Gold Z-Score).
Green Shading: Indicates the opposite, where Copper/Gold is weak, Copper/Bitcoin is strong, and the difference is below the Copper/Gold Z-Score.
The zones only indicate that the trader should consider buying or selling. Use with another indicator to confirm.
SlopeDirectionLine_TWSlopeDirectionLine_TW
___________________________
Tried to copy a MT4 indicator
Market Sessions Indicator by NomadTradesCustomisable Market session indicator
This indicator visually marks the high and low price levels for the Asia, London, and New York trading sessions directly on the chart, using distinct horizontal lines and color-coding for each session. Each session’s high and low are labelled for easy identification, allowing traders to quickly assess key support and resistance levels established during major global market hours. The indicator is designed for clear session demarcation, helping users identify price reactions at these significant levels and supporting multi-session analysis for intraday and swing trading strategies
Holy Grail (100% Win Rate)tldr:
1. Here you go folks – no repaint, no dodgy stuff, and 100% win rate
2. DO NOT TRADE THIS
________________________________________
Key points:
• Assets to trade: SPY, NASDAQ, DAX, FTSE, Bitcoin
• Time Frame: 1D or higher
________________________________________
What does the script do?
The script buys a certain amount of the asset every time we're in a pullback, and sells when we make a new All-Time High (ATH). More specifically, it waits for the first green candle after the lowest point of the pullback, and then adds to the position. We assume that when we see a green candle, the pullback is over. If we go even lower – we wait for another green candle. The script sells on the first red candle after an ATH.
The pullback is identified using a simple moving average (MA) – if we're below the MA, we're in a pullback.
You can set the MA length in the settings. I considered adding different types of MAs, but decided against it as it wouldn't change much in terms of the general idea.
You can also set the percentage of your account to invest on the very first candle – this is an initial pre-filling of the position, so you have something to sell if the price goes straight up after you start trading. If you think we’re in a bear market and the only way is up, you might want to set a higher number. On the other hand, if you believe we’re near the top of a bull market, set a lower one.
You can set the percentage of the position to sell on each red candle after ATH under Settings → Input → Exit % . Similarly, you can set the percentage to buy on each green candle after a pullback low under Settings → Properties → Order Size . Since bull markets tend to last longer than bear market pullbacks, you’ll typically want Exit % to be larger than Order Size — though this may vary depending on your initial pre-fill.
________________________________________
Why these assets?
These are assets that are expected to go up over the long run. I call them “number go up” assets. Meaning: no matter where they are now, at some point in the future they’ll make a new ATH. That’s why this might not work on individual stocks like Nvidia or Tesla — there’s no guarantee they won’t go bust tomorrow. We all remember big companies from the past (Enron, Lehman Brothers, etc.) that collapsed unexpectedly.
With SPY, you're betting on the American economy. And the American economy will go up at least because of inflation. If you believe inflation will continue, then you believe we’ll eventually see a new ATH in SPY. It may take years — like from 2007 to 2013 — but it happened. And there was a bull run after that.
And if you think the American economy will never grow again — well, if that’s true, we’ll all have much bigger problems than trading scripts.
________________________________________
Why this time frame?
Because, as mentioned, it may take a long time to reach a new ATH. You can use a shorter time frame, but that requires a higher TradingView subscription plan to view multi-year data.
Also, if you choose a shorter time frame, you should reduce the Order Size and Exit % accordingly, because the script will jump in on every new green candle after a pullback. On a 1-minute chart, that could mean 100x more entries compared to daily. Conversely, if you go to a higher time frame, increase the sizes — otherwise, too much of your capital will just sit unused.
________________________________________
So if everything is so great and it has a real 100% win rate – why not trade it?
If you turn on the “buy & hold equity” curve, you’ll see that the profit from all closed trades (with a 100% win rate) is smaller than if you had simply bought the asset and held it for years.
Real-world slippage and fees will reduce your actual profits even more.
If you’re unlucky and start trading at the very top of a bull market, it might take 10 years before even a single trade is closed.
Some assets that seem like they can only go up long-term... might not. Take Bitcoin. Many believe it can only go up in the long term, but it could still die — just like anything else. The only reason I included it is because many people treat it as a “number go up” asset. And I know some will try to trade it. You've been warned. But I don’t want to start holy wars in the holy grail description (pun intended), so let’s move on.
________________________________________
What if, after all this, you do decide to trade this strategy?
Why would you? Maybe not for profit, but just to impress your friends with a 100% win rate. Or maybe you skipped the entire explanation above and just want to jump in because it sounds like a sure win.
Whatever your reason, first you should research the asset’s historical max time (in years) between ATHs. That’s how long you might need to keep a trade open. My other script – Cycles Analysis – might help with this.
Second, experiment with the input parameters. There aren't many, so it should be easy to find what works best for your asset. You can also enable “Show stats table” in settings – it’ll help you see how many entries/exits the script makes, which will help you find the right Order Size to Exit % ratio.
Yes, this might lead to over-optimization — but hey, if we’re at this stage, who cares, right?
That said, I did find some rare cases where specific parameter setups caused performance to dip below 100% due to a mandatory close at the wrong time.
Also, since trades can last for years, don’t use this with futures — you'd have to keep rolling them over. Use ETFs or similar long-holdable assets.
________________________________________
The final word
In short, this is a glorified “Buy the Dip” strategy. It only works long-term on a very limited set of assets, and in most cases performs worse than just buying and holding for the same period.
I created this script as a teaching tool — to show new traders that win rate isn’t everything. Even if the win rate is 100%. Trust me: it’s extremely hard to beat the market (especially without leverage), and this script is just more proof of that.
Mariam Smart FlipPurpose
This tool identifies high-probability intraday reversals by detecting when price flips through the daily open after strong early-session commitment.
How It Works
A valid flip occurs when:
The previous daily candle is bullish or bearish
The first hour today continues in the same direction
Then, the price flips back through the daily open with a minimum break threshold (user-defined)
This setup is designed to catch liquidity grabs or fakeouts near the daily open, where early buyers or sellers get trapped after showing commitment
Signal Logic
Buy Flip
Previous day bearish → first hour bearish → price flips above open
Sell Flip
Previous day bullish → first hour bullish → price flips below open
Features
Configurable flip threshold in percentage
Signals only activate after the first hour ends
Daily open line displayed on chart
Simple triangle markers with no visual clutter
Alerts ready to use for automation or notifications
Usage Tips
Use "Once Per Bar" alert mode to get notified immediately when the flip happens
Works best in active markets like FX, indices, or crypto
Adjust threshold based on asset volatility
Suggested stop loss: use the previous daily high for sell flips or the previous daily low for buy flips
Suggested take profit: secure at least 30 pips to aim for a 1:3 risk-to-reward ratio on average
Log Regression Oscillator (caN)fi(ki)=>'ra'
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © fikira
//@version=6
indicator('Log Regression Oscillator', max_bars_back=5000, max_labels_count=500, max_lines_count=500, overlay=false)
________________________________________________________________________________________________________________________ ='
⎞ Settings ⎛
(__--------__) '
cGREEN = #089981, cRED = #F23645, cGRAY = #757a79
threshold = input.int (300 , minval=150)
proactive = input.bool (false )
GRE = input.color(cGREEN , 'Bull' , group='Style' )
RED = input.color(cRED , 'Bear' , group='Style' )
GRY = input.color(cGRAY , 'Unconfirmed Bull/Bear' , group='Style' )
showDsh = input.bool ( true , 'Show Dashboard' , group='Dashboard' )
dshLoc = str.replace(str.lower(input.string('Top Right', 'Location', group='Dashboard', options= )), ' ', '_')
txtSize = str.lower(input.string('Normal' , 'Size' , group='Dashboard', options= ) )
________________________________________________________________________________________________________________________ :='
⎞ Constants and general variables ⎛
(__-------------------------------__) '
INV = color(na)
n = bar_index
________________________________________________________________________________________________________________________ :='
⎞ Functions ⎛
(__---------__) '
dot(x, y)=>
if x.size() > 1 and y.size() > 1
m1 = matrix.new()
m2 = matrix.new()
m1.add_col(m1.columns(), y)
m2.add_row(m2.rows (), x)
m1.mult (m2)
.eigenvalues()
.sum()
//Closed form solution to best fit log function
log_reg(log_x, log_x2, log_y) =>
sum_log_x = log_x . sum()
sum_y = log_y . sum()
sum_log_x_y = dot(log_x ,log_y)
sum_log_x_sq = log_x2 . sum()
n_ = log_x .size()
//Closed-form solutions for a and b
a = (n_ * sum_log_x_y - sum_log_x * sum_y)
/ (n_ * sum_log_x_sq - math.pow(sum_log_x , 2))
b = ( sum_y - a * sum_log_x ) / n_
//Variables declared for draw()
var arrayarr = array.new(4, na)
proActH = false, proActL = false
var lastHi = 0., var lastLi = 0.
draw(aTop_x, aTop_x2, aTop_y, aBot_x, aBot_x2, aBot_y, top_points, prc_points, btm_points, refit) =>
var label labH = na, var label labL = na
vTop = 0.
vBtm = 0.
if refit
top_points.clear(), prc_points.clear(), btm_points.clear()
= log_reg(aTop_x, aTop_x2, aTop_y), arr.set(0, a_top), arr.set(1, b_top)
= log_reg(aBot_x, aBot_x2, aBot_y), arr.set(2, a_btm), arr.set(3, b_btm)
for i = 0 to n
top = math.exp(a_top * math.log(i) + b_top)
btm = math.exp(a_btm * math.log(i) + b_btm)
avg = math.avg(top, btm)
if i == n
vTop := top
vBtm := btm
ix = n - i
if ix < 4999
hi = high
lo = low
cl = close
getC = hi > avg ? hi : lo < avg ? lo : cl
prc_points.push(chart.point.from_index(i, 100 * math.max(-1.5, math.min(1.5, (getC - btm) / (top - btm)))))
for lab in label.all
lab.delete()
firstH = proactive ? true : false
firstL = proactive ? true : false
color colH = na, color colL = na
sz = prc_points.size()
if aTop_x.size() > 0
for i = aTop_x.size() -1 to 0
idx = int(math.exp(aTop_x.get(i)))
if idx < sz and idx > n - 5000 and idx >= 0
if firstH
if aTop_x.last() != lastHi
colH := GRY
firstH := false
else
colH := RED
else
colH := RED
top = math.exp(a_top * math.log(idx) + b_top)
btm = math.exp(a_btm * math.log(idx) + b_btm)
label.new(idx , 100 *
math.max(-1.5, math.min(1.5, (high - btm)
/ (top - btm)
) ), '●', textcolor = colH, color=INV, size=8)
if aBot_x.size() > 0
for i = aBot_x.size() -1 to 0
idx = int(math.exp(aBot_x.get(i)))
if idx < sz and idx > n - 5000 and idx >= 0
if firstL
if aBot_x.last() != lastLi
colL := GRY
firstL := false
else
colL := GRE
else
colL := GRE
top = math.exp(a_top * math.log(idx) + b_top)
btm = math.exp(a_btm * math.log(idx) + b_btm)
label.new(idx , 100 *
math.max(-1.5, math.min(1.5, (low - btm)
/ (top - btm)
) ), '●', textcolor = colL, color=INV, size=8
, style = label.style_label_up)
else
top = math.exp(arr.get(0) * math.log(n) + arr.get(1))
btm = math.exp(arr.get(2) * math.log(n) + arr.get(3))
avg = math.avg(top, btm)
vTop := top
vBtm := btm
hi = high, lo = low, cl = close
getC = hi > avg ? hi : lo < avg ? lo : cl
prc_points.push(chart.point.from_index(n, 100 * math.max(-1.5, math.min(1.5, (getC - btm) / (top - btm)))))
for poly in polyline.all
poly.delete()
if barstate.islast
labH.delete(), labH := label.new(n, 100, str.tostring(vTop, format.mintick), color=color.new(chart.fg_color, 85), textcolor=RED, style=label.style_label_lower_left, size=12)
labL.delete(), labL := label.new(n, 0, str.tostring(vBtm, format.mintick), color=color.new(chart.fg_color, 85), textcolor=GRE, style=label.style_label_upper_left, size=12)
polyline.new(prc_points.size() >= 5000 ? prc_points.slice(prc_points.size()-4999, prc_points.size()-1) : prc_points, line_color=chart.fg_color)
________________________________________________________________________________________________________________________ :='
⎞ Variables ⎛
(__---------__) '
//bool trigerring fit
refit = false
var top_points = array.new(0)
var prc_points = array.new(0)
var btm_points = array.new(0)
//Variables arrays
var peaks_y = array.new(0)
var peaks_x = array.new(0)
var peaks_x2 = array.new(0)
var btms_y = array.new(0)
var btms_x = array.new(0)
var btms_x2 = array.new(0)
var tb = table.new(dshLoc, 4, 8
, bgcolor = #1e222d
, border_color = #373a46
, border_width = 1
, frame_color = #373a46
, frame_width = 1)
________________________________________________________________________________________________________________________ :='
⎞ Exec ⎛
(__----__) '
//Top Bottom detection
max = ta.max(high)
var min = low
min := max == high ? low
: math.min(low , min)
barsmax = ta.barssince(high == max)
barsmin = ta.barssince(low == min)
if barsmax == threshold
nmax = n-barsmax
if peaks_x .size() > 0 and peaks_x.last() != lastHi
peaks_y .set(-1, math.log( max) )
peaks_x .set(-1, math.log(nmax) )
peaks_x2.set(-1, math.pow(math.log(nmax), 2))
else
peaks_y .push( math.log(max) )
peaks_x .push( math.log(nmax) )
peaks_x2.push( math.pow(math.log(nmax), 2))
lastHi := math.log(nmax)
refit := true
else
min := math.min(low , min)
if barsmin == threshold
nmin = n-barsmin
if btms_x .size() > 0 and btms_x.last() != lastLi
btms_y .set(-1, math.log(min) )
btms_x .set(-1, math.log(nmin) )
btms_x2 .set(-1, math.pow(math.log(nmin), 2))
else
btms_y .push( math.log( min) )
btms_x .push( math.log(nmin) )
btms_x2.push( math.pow(math.log(nmin), 2))
lastLi := math.log(nmin)
refit := true
chMax = ta.change(max) , chMin = ta.change(min)
if (chMax != 0 or chMin != 0) and proactive and not refit and n > threshold
= log_reg(peaks_x, peaks_x2, peaks_y)
= log_reg( btms_x, btms_x2, btms_y)
top = math.exp(a_top * math.log(n) + b_top)
btm = math.exp(a_btm * math.log(n) + b_btm)
if 100 * ((high - btm) / (top - btm)) > 90
if peaks_x.last() == lastHi
peaks_y .push(math.log(max))
peaks_x .push(math.log(n))
peaks_x2.push(math.log(n)
*math.log(n))
else
peaks_y .set(-1, math.log(max))
peaks_x .set(-1, math.log(n))
peaks_x2.set(-1, math.log(n)
* math.log(n))
arr.set(0, a_top), arr.set(1, b_top)
arr.set(2, a_btm), arr.set(3, b_btm)
refit := true
proActH := true
if 100 * ((low - btm) / (top - btm)) < 10
if btms_x.last() == lastLi
btms_y .push(math.log(min))
btms_x .push(math.log(n))
btms_x2.push(math.log(n)
*math.log(n))
else
btms_y .set(-1, math.log(min))
btms_x .set(-1, math.log(n))
btms_x2.set(-1, math.log(n)
* math.log(n))
arr.set(0, a_top), arr.set(1, b_top)
arr.set(2, a_btm), arr.set(3, b_btm)
refit := true
proActL := true
enough = peaks_x.size() > 1 and btms_x.size() > 1
if enough
draw(peaks_x, peaks_x2, peaks_y, btms_x, btms_x2, btms_y, top_points, prc_points, btm_points, refit)
else
if barstate.islast
txt = ''
if peaks_x.size() < 2
txt += str.format('{0} Top Swing', peaks_x.size())
if btms_x .size() < 2
if txt != ''
txt += ', '
txt += str.format('{0} Bottom Swing', btms_x .size())
txt += ' Change "Threshold" or timeframe for more Swings'
tb.cell(0, 0, txt, text_color=chart.fg_color, text_size=txtSize)
________________________________________________________________________________________________________________________ :='
⎞ Plot ⎛
(__----__) '
plot(n%2==0? 30 : na,'30' , color=color.new(chart.fg_color, 50), style=plot.style_linebr, display=display.pane)
plot(n%2==0? 70 : na,'70' , color=color.new(chart.fg_color, 50), style=plot.style_linebr, display=display.pane)
_100 = plot(100, 'na(100)', display=display.none)
_70 = plot( 70, 'na(70)' , display=display.none)
_60 = plot( 60, 'na(60)' , display=display.none)
_50 = plot( 50, 'na(50)' , display=display.none)
_40 = plot( 40, 'na(40)' , display=display.none)
_30 = plot( 30, 'na(30)' , display=display.none)
_00 = plot( 0, 'na(0)' , display=display.none)
fill(_100, _70, 100, 70, color.new(RED, 50), INV)
fill( _60, _50, 60, 50, INV, color.new(chart.fg_color, 85))
fill( _50, _40, 50, 40, color.new(chart.fg_color, 85), INV)
fill( _30, _00, 30, 0, INV, color.new(GRE, 75))
________________________________________________________________________________________________________________________ :='
⎞ End ⎛
(__---__) '
Luma DCA Tracker (BTC)Luma DCA Tracker (BTC) – User Guide
Function
This indicator simulates a regular Bitcoin investment strategy (Dollar Cost Averaging). It calculates and visualizes:
Accumulated BTC amount
Average entry price
Total amount invested
Current portfolio value
Profit/loss in absolute and percentage terms
Settings
Investment per interval
Fixed amount to be invested at each interval (e.g., 100 USD)
Start date
The date when DCA simulation begins
Investment interval
Choose between:
daily, weekly, every 14 days, or monthly
Show investment data
Displays additional chart lines (total invested, value, profit, etc.)
Chart Elements
Orange line: Average DCA entry price
Grey dots: Entry points based on selected interval
Info box (bottom left): Live summary of all key values
Notes
Purchases are simulated at the closing price of each interval
No fees, slippage, or taxes are included
The indicator is a simulation only and not linked to an actual portfolio
Copper to Gold Ratioratio = copper / gold: Calculates the ratio by dividing copper price by gold price.
plot(ratio): Plots the ratio as a blue line.
ma = ta.sma(ratio, 20): Adds a 20-period simple moving average (optional) to smooth the ratio, plotted as a red line.
A rising Copper/Gold ratio often signals economic expansion (strong copper demand relative to gold), while a falling ratio may indicate economic uncertainty or recession fears, as gold outperforms copper.
The ratio is also used as a leading indicator for 10-year U.S. Treasury yields, with a rising ratio often correlating with higher yields.
Confluence Pannel📊 RSI / MACD / ADX Info Panel — Indicator Overview
This Pine Script v6 indicator is a compact visual dashboard that displays real-time insights from three popular technical indicators — RSI, MACD, and ADX — in a color-coded panel at the top-right of your TradingView chart.
🔍 What It Shows
✅ RSI (Relative Strength Index)
Measures momentum and potential overbought/oversold conditions.
Green background: RSI is above 50 (bullish momentum).
Red background: RSI is below 50 (bearish momentum).
Extra label:
"OVER BOUGHT" if RSI > input threshold (default 70)
"OVER SOLD" if RSI < input threshold (default 30)
✅ MACD (Moving Average Convergence Divergence)
Indicates trend strength and direction.
Green background: MACD line is above signal line → Bullish
Red background: MACD line is below signal line → Bearish
Label displays: "Bullish" or "Bearish"
✅ ADX (Average Directional Index)
Measures the strength of the trend, not its direction.
Background and label color changes:
🔴 Red: ADX < 20 → "Bad" (no trend)
🟠 Orange: 20 ≤ ADX < 25 → "Weak" (choppy trend)
🟢 Green: 25 ≤ ADX < 30 → "Good" (valid trend)
🔵 Blue: ADX ≥ 30 → "Best" (strong trend)
🧠 How to Use It
Add to Chart: Paste the script into TradingView’s Pine Editor, click “Add to Chart,” and you’ll see a table appear in the top-right corner.
Interpret Quickly: Use the panel to quickly assess:
Is momentum building or fading? (RSI)
Is there a trend direction? (MACD)
Is the trend strong enough to trade? (ADX)
Make Fast Trade Decisions:
Look for all green/blue for optimal bullish conditions.
Mixed colors may indicate range-bound or weakening setups.
Use it as a confluence check before entering trades.
Yelober - Intraday ETF Dashboard# How to Read the Yelober Intraday ETF Dashboard
The Intraday ETF Dashboard provides a powerful at-a-glance view of sector performance and trading opportunities. Here's how to interpret and use the information:
## Basic Dashboard Reading
### Color-Coding System
- **Green values**: Positive performance or bullish signals
- **Red values**: Negative performance or bearish signals
- **Symbol colors**: Green = buy signal, Red = sell signal, Gray = neutral
### Example 1: Identifying Strong Sectors
If you see XLF (Financials) with:
- Day % showing +2.65% (green background)
- Symbol in green color
- RSI of 58 (not overbought)
**Interpretation**: Financial sector is showing strength and momentum without being overextended. Consider long positions in top financial stocks like JPM or BAC.
### Example 2: Spotting Weakness
If you see XLK (Technology) with:
- Day % showing -1.20% (red background)
- Week % showing -3.50% (red background)
- Symbol in red color
- RSI of 35 (approaching oversold)
**Interpretation**: Technology sector is showing weakness across multiple timeframes. Consider avoiding tech stocks or taking short positions in names like MSFT or AAPL, but be cautious as the low RSI suggests a bounce may be coming.
## Advanced Interpretations
### Example 3: Sector Rotation Detection
If you observe:
- XLE (Energy) showing +2.10% while XLK (Technology) showing -1.50%
- Both sectors' Week % values showing the opposite trend
**Interpretation**: This suggests money is rotating out of technology into energy stocks. This rotation pattern is actionable - consider reducing tech exposure and increasing energy positions (look at XOM, CVX in the Top Stocks column).
### Example 4: RSI Divergences
If you see XLU (Utilities) with:
- Day % showing +0.50% (small positive)
- RSI showing 72 (overbought, red background)
**Interpretation**: Despite positive performance, the high RSI suggests the sector is overextended. This divergence between price and indicator suggests caution - the rally in utilities may be running out of steam.
### Example 5: Relative Strength in Weak Markets
If SPY shows -1.20% but XLP (Consumer Staples) shows +0.30%:
**Interpretation**: Consumer staples are showing defensive strength during market weakness. This is typical risk-off behavior. Consider defensive positions in stocks like PG, KO, or PEP for protection.
## Practical Application Scenarios
### Day Trading Setup
1. **Morning Market Assessment**:
- Check which sectors are green pre-market
- Focus on sectors with Day % > 1% and RSI between 40-70
- Identify 2-3 stocks from the Top Stocks column of the strongest sector
2. **Midday Reversal Hunting**:
- Look for sectors with symbol color changing from red to green
- Confirm with RSI moving away from extremes
- Trade stocks from that sector showing similar pattern changes
### Swing Trading Application
1. **Trend Following**:
- Identify sectors with positive Day % and Week %
- Look for RSI values in uptrend but not overbought (45-65)
- Enter positions in top stocks from these sectors, using daily charts for confirmation
2. **Contrarian Setups**:
- Find sectors with deeply negative Day % but RSI < 30
- Look for divergence (price making new lows but RSI rising)
- Consider counter-trend positions in the stronger stocks within these oversold sectors
## Reading Special Conditions
### Example 6: Risk-Off Environment
If you observe:
- XLP (Consumer Staples) and XLU (Utilities) both green
- XLK (Technology) and XLY (Consumer Disc) both red
- SPY slightly negative
**Interpretation**: Classic risk-off rotation. Investors are moving to safety. Consider defensive positioning and reducing exposure to growth sectors.
### Example 7: Market Breadth Analysis
Count the number of sectors in green vs. red:
- If 7+ sectors are green: Strong bullish breadth, consider aggressive long positioning
- If 7+ sectors are red: Weak market breadth, consider defensive positioning or shorts
- If evenly split: Market is indecisive, focus on specific sector strength instead of broad market exposure
Remember that this dashboard is most effective when combined with broader market analysis and appropriate risk management strategies.
Copper to Bitcoin RatioRatio: Divides copper price by Bitcoin price (copper / bitcoin). Since copper is in USD per pound and Bitcoin is in USD, the ratio is unitless but reflects copper’s value relative to Bitcoin.
Plotting: The ratio is plotted as a blue line, with an optional 20-period simple moving average (red line) for smoothing.
This can reflect market sentiment (e.g., industrial demand vs. crypto speculation).
Weekly High/Low + Breakout Probabilities (Debug Fixed)This script will tell you which day created the high or low of the week, the probability of it being that day and the probability that a day will break last weeks H/L
Swing Counter – Alleen eerste label per reeksCounts upward en downward swings. Number 7 or 8 is a warning.
Candle Range Detector by TradeTech AnalysisCandle Range Detector by TradeTech Analysis
This advanced indicator identifies and visualizes price compression zones based on inside bar formations, then tracks how price behaves around those zones — offering valuable insights into liquidity sweeps, range expansions, and trap/mitigation behavior.
The script builds upon the foundational concept of range-based price action, commonly used by institutional traders, and adds automation, mitigation tracking, and sweep detection to map how price reacts around these critical ranges.
🔍 How It Works:
• Range Formation: A new range is detected when the current candle forms entirely within the high and low of the previous candle (i.e., an inside bar). This behavior often indicates price compression and potential breakout zones.
• Range Extension: Once a range is confirmed, the script projects upper and lower boundaries (using either a percentage-based multiplier or Fibonacci log extension), providing context for expected breakout zones.
• Mitigation Tracking: The script continuously monitors whether price breaks above or below the projected extensions, marking that range as mitigated — useful for confirming whether liquidity was absorbed.
• Sweep Detection: If price re-visits a mitigated zone and shows signs of a liquidity sweep (via wick + close behavior), the indicator triggers visual sweep labels and optional alerts.
🧠 Optional Visual Enhancements:
• Highlight range-forming candles with light blue background (toggle on/off)
• Midpoint dotted line for symmetry analysis
• Labels for “Range High” and “Range Low” for visual clarity
• Dynamic box drawing that adapts upon mitigation or continuation
⚙️ Customizable Features:
• Choose between Normal and Fibonacci-based detection modes
• Toggle visibility of range boxes, extension lines, and sweep markers
• Configure sweep alerts, mitigation window size, and visual transparency
⸻
🧪 Use Cases
• Identify consolidation zones before major price moves
• Confirm liquidity sweeps for entry/exit traps
• Visualize and test mitigation behavior of past zones
• Combine with Order Flow or Volume Profile tools to enhance context
⸻
⚠️ This is a fully original implementation that goes beyond classical inside-bar scanners by incorporating mitigation, extension projection, and liquidity sweeps — making it a powerful tool for intraday, swing, and even Smart Money-based trading setups.
Crypto Swing Trading Strategy (1-5 Day)Crypto Swing Trading Strategy Overview
This Pine Script implements a comprehensive 1-5 day swing trading strategy designed specifically for cryptocurrencies like BITSTAMP:BTCUSD (BTC), COINBASE:ETHUSD (ETH), and COINBASE:XRPUSD (XRP).
Here's what makes this strategy effective:
Core Philosophy: "Trade With The Trend"
The strategy follows the fundamental principle of trend-following - only taking trades in the direction of the prevailing market trend to maximize probability of success.
Key Components:
🔍 Trend Identification
Uses 50-day and 200-day EMAs to determine market direction
Only goes long when 50 EMA > 200 EMA (uptrend)
Only goes short when 50 EMA < 200 EMA (downtrend)
⚡ Smart Entry Timing
Waits for pullbacks within the trend (price near 50 EMA)
Uses RSI to identify oversold conditions in uptrends (RSI < 45) or overbought conditions in downtrends (RSI > 70)
Enters when momentum confirms trend resumption (RSI crosses back)
🛡️ Advanced Risk Management
ATR-based stop losses that adapt to market volatility
Position sizing ensures consistent 1% risk per trade
Wider stops in volatile markets, tighter stops in calm markets
💰 Profit Optimization
Takes 50% profit at 2:1 reward-to-risk ratio
Trails remaining position with ATR-based stops
Lets winners run while protecting gains
Why It Works:
High Probability Setups: Only trades with the trend during pullbacks
Volatility Adaptive: ATR ensures stops aren't too tight or too wide
Emotion-Free: All rules are clearly defined for automated execution
Capital Preservation: Strong risk management prevents large losses
Best Used For:
4-hour timeframes on major cryptocurrencies - Such as BTC - ETH - XRP
Trending markets (avoid during sideways consolidation)
Traders who want systematic, rule-based approach
This strategy combines the reliability of trend-following with the precision of momentum indicators, creating a robust system for capturing crypto market swings while managing downside risk effectively.