Professional Documents
Culture Documents
Dynamic ? Chop Zones
Dynamic ? Chop Zones
▄▄▄▄▄▄▄▄▄▄
//▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▐░░░░░░░░░░▌
//▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀
▐░█▀▀▀▀▀▀▀█░▌
//▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌
//▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌
▐░▌
//▐░░░░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌ ▐░▌ ▐░▌
▐░▌
// ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌
▐░▌
// ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌
// ▄▄▄▄▄▄▄▄▄█░▌ ▄ ▐░▌ ▄ ▐░█▄▄▄▄▄▄▄█░▌ ▄ ▐░▌ ▄ ▄▄▄▄█░█▄▄▄▄ ▄
▐░█▄▄▄▄▄▄▄█░▌▄
//▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░░░░░░░░░░░▌▐░▌▐░▌▐░▌
▐░░░░░░░░░░░▌▐░▌▐░░░░░░░░░░▌▐░▌
// ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀
▀▀▀▀▀▀▀▀▀▀ ▀
//
// ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄
▄
//▐░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌
▐░▌
//▐░█▀▀▀▀▀▀▀█░▌▀▀▀▀█░█▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀
▐░▌░▌ ▐░▌
//▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌▐░▌ ▐░▌
//▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌
//▐░░░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌
//▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌
//▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌▐░▌
//▐░█▄▄▄▄▄▄▄█░▌▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄█░█▄▄▄▄ ▐░▌
▐░▐░▌
//▐░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌
▐░░▌
// ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀
▀▀
//
// S.UPER T.REND U.LTIMATE P.ROJECT I.NTELLIGENT D.ESIGN
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
at https://mozilla.org/MPL/2.0/
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0
International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// Over 1000 indicator were referenced, credit goes to EACH AND EVERY CREATOR ON
TRADINGVIEW. It is impossible to list everyone. Thus, everyone gets credit.
// Extra Credit to PVSRA, KIVANC, via-negativa, Texasmoonbeam, and Zeiierman;
// The summary of this code is work done by @ Stupid_Bitcoin 2024 and beyond.
// S.T.U.P.I.D. Donations ~ paypal ~ djyourstory@gmail.com
// A Market Maker and Casino are identical. They do not change the game.
// They understand your indicator, or your mind-set will keep changing.
// The Human Brain can not make a security call to the asset, but AI can.
// A majority of popular indicators are old, regardless of ratings.
// Many of these indicators can not upgrade into Version 5 of Pine Script.
// Before indicator design the 13 TEMA, 66 DEMA, created a tested trading
foundation.
// S.T.U.P.I.D. Disclaimer
// Game Theory proves the psychology of printing winning results will attract
criminals. It IS NOT suggested for indicator design.
// However, at the same time private use of printing winning rates on chart, will
expose that win rates vary by exchange.
// For example, "Exchange A" on every time frame posts better than an 80% win
rate.
// On the same asset and time frames "Exchange B" is 3% to 6% lower win rate, who
might claim to have "lower fees" than Exchange A.
// Private use of AI enhances scam detection and can catch criminals who exploit
the markets.
// However, errors may be present, pine script has limitations, I am not perfect,
everything is random, and each individual uses trading data differently.
//@version=5
indicator("Dynamic 🍀 Chop Zones", overlay=true, max_bars_back = 100)
string GROUP_PLS = 'Labels'
bool showLabelsPriceScaleInput = input.bool(false, 'Show Labels on Price
Scale.', tooltip="", group=GROUP_PLS)
// options
labelDisplay = showLabelsPriceScaleInput ? display.all : display.pane // , editable
= false, display=labelDisplay)
cold0 = color.rgb(255, 0, 0)
cold1 = color.rgb(200, 0, 0, 11)
cold2 = color.rgb(200, 0, 0, 22)
cold3 = color.rgb(255, 45, 45, 33)
cold4 = color.rgb(255, 80, 80, 44)
cold5 = color.rgb(169, 89, 89, 55)
color_1 = vold0 ? cold0 : vold1 ? cold1 : vold2 ? cold2 : vold3 ? cold3 : vold4 ?
cold4 : vold5 ? cold5 : volu0 ? colu0 : volu1 ? colu1 : volu2 ? colu2 : volu3 ?
colu3 : volu4 ? colu4 : volu5 ? colu5 : na
plotcandle(open, high, low, close, title=' Vector Candle', color=(open < close) ?
color_1 : color_1, wickcolor=color_1, bordercolor=color_1, editable = false,
display=labelDisplay)
//
// ATR calculation
ATR(src, l) =>
tr = math.max(src[1] - math.min(low, src[1]), math.max(high - low, src[1] -
high))
ta.ema(tr, l)
atr = ATR(hl2, 100)
//
// Supertrend calculation
supertrend(factor, atrL) =>
src = hl2
u = src + factor * atr
l = src - factor * atr
prevL = nz(l[1])
prevU = nz(u[1])
l := l > prevL or close[1] < prevL ? l : prevL
u := u < prevU or close[1] > prevU ? u : prevU
d = int(na)
t = float(na)
prevT = t[1]
d := na(atr[1]) ? 1 : prevT == prevU ? close > u ? -1 : 1 : close < l ? 1 : -1
t := d == -1 ? l : u
[t, d]
[t, d] = supertrend(mult, len*2)
//
// Trend calculation
Trends(close, t, down, up, atr, Cloudwidth) =>
tA = 0.0
tA := close > t ? math.avg(t, down, ta.lowest(close, len) + atr) : math.avg(t,
up, ta.highest(close, len) + atr)
tZ = 0.0
tZ := close > tA ? tA + atr*Cloudwidth : tA - atr*Cloudwidth
[tA, tZ]
[tA, tZ] = Trends(close, t, down, up, atr, Cloudwidth)
//
get_highslows()=>
highs= array.new_float(0)
lows= array.new_float(0)
starttimes= array.new_int(0)
for n = 0 to r+leftbars
array.push(highs, high[n])
array.push(lows, low[n])
array.push(starttimes, time[n])
[highs, lows, starttimes]
if (barstate.islast)
ishpivot = true
highest = true
a = 0
x = 0
for a = 0 to (array.size(highs)-leftbars-1)
for b = a to 0
//
break
else
highest:= true
islpivot = true
lowest = true
c = 0
n = 0
for c = 0+rightbars to (array.size(lows)-leftbars)-1
for b = c to 0
//
break
else
lowest:= true
// Plot Clouds
sig = d != 0
sigL = plot(sig and ((d<0 and d[1]<0) or (d>0) and (d[1] > 0))? tA : na,
title="Smart Trailing", color=close > tA ? dncol: upcol, style=plot.style_linebr,
offset = -6, editable = false, display=labelDisplay)
zoneL = plot(sig and ((d>0) or (d < 0))? tZ : na, title="Cloud",
color=color.new(color.gray, 100), display=display.none, style=plot.style_linebr,
offset = -6, editable = false, display=labelDisplay)
fill(sigL, zoneL, title="Cloud", color=close > tA ? color.new(dncol, 90) :
color.new(upcol, 90))
//