Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 7

// ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄

▄▄▄▄▄▄▄▄▄▄
//▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▐░░░░░░░░░░▌
//▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀
▐░█▀▀▀▀▀▀▀█░▌
//▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌
//▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌
▐░▌
//▐░░░░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌ ▐░▌ ▐░▌
▐░▌
// ▀▀▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌
▐░▌
// ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌
// ▄▄▄▄▄▄▄▄▄█░▌ ▄ ▐░▌ ▄ ▐░█▄▄▄▄▄▄▄█░▌ ▄ ▐░▌ ▄ ▄▄▄▄█░█▄▄▄▄ ▄
▐░█▄▄▄▄▄▄▄█░▌▄
//▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ ▐░░░░░░░░░░░▌▐░▌▐░▌▐░▌
▐░░░░░░░░░░░▌▐░▌▐░░░░░░░░░░▌▐░▌
// ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀
▀▀▀▀▀▀▀▀▀▀ ▀
//
// ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄

//▐░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░▌
▐░▌
//▐░█▀▀▀▀▀▀▀█░▌▀▀▀▀█░█▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀
▐░▌░▌ ▐░▌
//▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌▐░▌ ▐░▌
//▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌
//▐░░░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌
//▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░▌
//▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌▐░▌
//▐░█▄▄▄▄▄▄▄█░▌▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄█░█▄▄▄▄ ▐░▌
▐░▐░▌
//▐░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌
▐░░▌
// ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀
▀▀

//
// 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.

// What is S.T.U.P.I.D.? AI reviewed and reported on every trading view indicator


video published to YouTube.
// Next, AI parsed most major YouTube stock/crypto channels into a key-word
language model.
// Human brains analyzed the AI results using Six Sigma.
// Six Sigma is priority based risk management to reduce errors.
// Next, We added Hoffman IRBs', Nikola Tesla Math, Game Theory.
// What is Robert J. Hoffman Award Winning Wick retracement? He can explain it to
you.
// His method merged with PVSRA to increase in profitability.
// PVSRA is a 200% fixed volume trigger with 4 stages of color.
// S.T.U.P.I.D. Vector candles are the result of PVSRA improvement. They use 12
triggers, plus color compression.
// Next, retail traders can not control paraxial errors. They make approximations
to a chart, which produce false signals.
// Removing data sources, like influences producing paraxial errors, increased
winning trade experiences.
// Next, the methodology considers the bad habits of retail traders.
// Next, a Game Theory model emerged. It uses the OODA loop, platonic dice theory,
and blackjack basic strategy.
// Example 1, alter Fibonacci numbers with Tesla values. The result in gaming and
trading, is more winning experiences.
// Example 2, entry/exit on rounded dollar values of 333 or 666, result in more
winning trades than 250/500/750.
// Proper numbers (generally are):
1,3,5,6,9,11,13,18,21,22,24,26,33,36,39,44,48,52,63,66,77,88,96,99,111,144,163,188,
199,222,333,369,396,444,555,639,666,693,777,888,936,963,993,996,999
// Six Sigma reallocates all prior data for development of 100 indicators.
// Each indicator was tested using Bitcoin.
// Development back tested over 3000 variations of code sequencing.
// Development defined edge cases using game theory. Six Sigma again filtered the
indicator data.
// Two-thirds of the indicators built, got eliminated. Out of 100 indicators the
top 33 remain.

// About S.T.U.P.I.D. Vector Candles


// Vector Candles enhance the old PVSRA, using six sigma.
// Price action is the candle. Volume explains how price action happens.
// Support and Resistance are not target points, they are broad areas.
// Color plays a critical role, reducing the number of charts to consult.
// It prevents eye strain, reduces mental mathematics, and presents 1000s of data
points.
// Over 12 stages of buying and selling volume are shown using color, and the
absence of color.
// Vector candle can encode the wick with volume data, based on color.
// Color Compression lookback is used to verify vector candle recovery.
// During recovery or the absence of volume, the color is absent from the candle
body.
// Chart data using vector colors will reflect these same values.
// Vector candles will display trigger volume on multi-stage candle sweeps.

// 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.

// Information contained in (Super Trend Ultimate Project Intelligent Design) or


S.T.U.P.I.D does not constitute financial advice or a solicitation to buy or sell
any securities of any type.
// Open Source code, or its publisher, does not accept liability for any loss or
damage, including without limitation any loss of profit, which may arise directly
or indirectly from the use of
// or reliance on such information. All investments involve risk. Investors are
fully responsible for all decisions they make.
// My open source code is for educational purposes.
// © Stupid_Bitcoin

//@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)

// VWAP ATR Cloud with Support and Resistance


mult = input.float(6.9, step=0.1, minval=1,title="Mult", group = "Settings",
inline="mult")
len = input.int(26,minval=2, title="Len", group = "Settings", inline="mult")
Smooth = input.int(9,minval=1, step=5,title="Smoothness", group = "Settings",
inline="")
Cloudwidth = input.float(1.66, step=0.3,minval=0, title="Cloud width", group
="Style", inline="Style")
nucol = input.color(color.rgb(255, 255, 0, 20), title='', group='Style',
inline="Style")
upcol = input.color(color.rgb(255, 0, 0, 20), title='', group='Style',
inline="Style")
dncol = input.color(color.rgb(0, 255, 0, 20), title='', group='Style',
inline="Style")
timeframe = input.timeframe(defval = '60')
r = input.int(defval = 33, title = "Look back", minval = 11, maxval = 99,
tooltip="A longer look back for long time frames may be needed")
leftbars = input.int(defval = 9, title = "Left Bars", minval = 1, tooltip="More
bars left of the pivot means it came from a longer trend")
rightbars = input.int(defval = 9, title = "Right Bars", minval = 1, tooltip="More
bars right of the pivot means it went into a longer trend")
untested = input.bool(defval = true, title = 'Untested Only?')
HighCol = input.color(color.rgb(0, 255, 0, 20), "Highs", inline="2")
HighWidth = input.int(defval=1, title="Width", minval=1, maxval = 4, inline="2")
LowCol = input.color(color.rgb(255, 0, 0, 20), "Lows", inline="3")
LowWidth = input.int(defval=1, title="Width", minval=1, maxval = 4, inline="3")

//----------Simple Vector Candles----------//


vlength = input.int(9, 'Vector Candle Volume Lookback', minval=1)
avrg = ta.vwma(volume, vlength)

vold0 = volume > avrg * 1.88 and close < open


vold1 = volume > avrg * 1.44 and volume <= avrg * 1.87 and close < open
vold2 = volume > avrg * 1.22 and volume <= avrg * 1.43 and close < open
vold3 = volume >= avrg * 0.90 and volume <= avrg * 1.21 and close < open
vold4 = volume < avrg * 0.60 and volume <= avrg * 0.89 and close < open
vold5 = volume < avrg * 0.30 and close < open

volu0 = volume > avrg * 1.88 and close > open,


volu1 = volume > avrg * 1.44 and volume <= avrg * 1.87 and close > open
volu2 = volume > avrg * 1.44 and volume <= avrg * 1.43 and close > open
volu3 = volume >= avrg * 0.90 and volume <= avrg * 1.21 and close > open
volu4 = volume < avrg * 0.60 and volume <= avrg * 0.89 and close > open
volu5 = volume < avrg * 0.30 and close < open

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)

colu0 = color.rgb(4, 255, 0)


colu1 = color.rgb(3, 200, 0, 11)
colu2 = color.rgb(3, 200, 0, 22)
colu3 = color.rgb(75, 255, 75, 33)
colu4 = color.rgb(75, 175, 75, 44)
colu5 = color.rgb(66, 120, 66, 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)
//

// Hybrid Movement calculation {


gd(src, l, f) =>
e1 = ta.sma(src, l)
e2 = ta.ema(e1, l)
e3 = ta.hma(e2, l)
c1 = -f * f * f
c2 = 3 * f * f + 3 * f * f * f
c3 = -6 * f * f - 3 * f - 3 * f * f * f
c4 = 1 + 3 * f + f * f * f + 3 * f * f
c1 * e3 + c2 * e2 + c3 * e1 + c4 * src
//

// ~~ Dynamic VWAP Support and Resistance {


dev = atr*mult
up = ta.vwap(gd(high, len, -1.3) + dev, Smooth)
down = ta.vwap(gd(low, len, -1.3) - dev, Smooth)
//

// 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)
//

// ~~ Dynamic Banded Chop Wedges


sqlen = input.int(26, title='Length', minval=1)
aa = close - ta.ema(close, sqlen)
ba = aa < 0 ? aa * -1 : aa
da = ta.ema(ba, len)
basis = ta.ema(close, sqlen)
upper = basis + da
lower = basis - da
max = math.max(upper, close)
smooth = ta.ema(max, sqlen)
min = math.min(close, lower)
smooth2 = ta.ema(min, sqlen)

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]

[highs, lows, starttimes] = request.security(syminfo.tickerid, timeframe,


get_highslows(), lookahead = barmerge.lookahead_off, ignore_invalid_symbol = true)

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

if (array.get(highs, a) < array.get(highs, b))


highest := false

//
break
else
highest:= true

for x = (a+leftbars) to (a-rightbars > 0 ? a - rightbars : 0)


if (array.get(highs, x) > array.get(highs, a))
ishpivot:=false
break
else
ishpivot:= true

if (untested == true ? highest == true and ishpivot == true : ishpivot ==


true )
//label.new(x=bar_index[a], y=high[a], text=str.tostring(high[a])+'
'+str.tostring(ishpivot)+' '+str.tostring(x), color=color.lime)
line.new(x1= array.get(starttimes, a), y1= array.get(highs, a), x2=
array.get(starttimes, a)+86400000/4+(timenow-array.get(starttimes, a)), y2=
array.get(highs, a), xloc= xloc.bar_time, color= HighCol, style= line.style_solid,
width= HighWidth)

islpivot = true
lowest = true
c = 0
n = 0
for c = 0+rightbars to (array.size(lows)-leftbars)-1
for b = c to 0

if (array.get(lows, c) > array.get(lows, b))


lowest := false

//
break
else
lowest:= true

for n = (c+leftbars) to (c-rightbars > 0 ? c - rightbars : 0)


if (array.get(lows, n) < array.get(lows, c))
islpivot:=false
break
else
islpivot:= true
if (untested == true ? lowest == true and islpivot == true : islpivot ==
true )
//label.new(x=bar_index[a], y=high[a], text=str.tostring(high[a])+'
'+str.tostring(ispivot)+' '+str.tostring(x)+' '+str.tostring(last_bar_index))
line.new(x1= array.get(starttimes, c), y1= array.get(lows, c), x2=
array.get(starttimes, c)+86400000/4+(timenow-array.get(starttimes, c)), y2=
array.get(lows, c), xloc= xloc.bar_time, color= LowCol, style= line.style_solid,
width= LowWidth)
//

// Plot Chop Hunter


plot(smooth2, style=plot.style_linebr, linewidth=1, color = dncol, editable =
false, display=labelDisplay)
smaa = ta.ema(smooth2, sqlen)
plot(smooth, style=plot.style_linebr, linewidth=1, color = upcol, editable = false,
display=labelDisplay)
smaa2 = ta.ema(smooth, sqlen)

rising = ta.rising(smooth2, sqlen / 5)


falling0 = ta.falling(smooth, sqlen / 5)
wedge = rising and falling0 ? smooth : na
wedge2 = rising and falling0 ? smooth2 : na
plot(wedge, style=plot.style_linebr, linewidth=6, color = upcol, editable = false,
display=labelDisplay)
plot(wedge2, style=plot.style_linebr, linewidth=6, color = dncol, editable = false,
display=labelDisplay)

range_1 = smooth - smooth2


falling = ta.falling(range_1, sqlen)
falling2 = falling ? close : na
plot(falling2, style=plot.style_linebr, linewidth=3, color = nucol, editable =
false, display=labelDisplay)

// 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))
//

You might also like