Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © Deewithme
- //@version=5
- indicator("Non-Repainting ZigWave Analytics™", "", true, max_labels_count = 500)
- //@TrendPulseNXT
- //~~ Inputs {
- int prd = input.int(12, "Period", minval=1, inline="setting")
- float mult = input.float(2.0, "Mult", minval=0.1, step=0.1, inline="setting")
- bool showZigZag = input.bool(true, "ZigZag", inline="zigzag")
- string signal = input.string("Signal", "", ["Signal", "Peak Distance"], inline="zigzag")
- string dev = input.string("ZigZag", "", ["ZigZag", "High/Low", "Close"], inline="zigzag")
- bool showTable = input.bool(false, "Average/Median Distance")
- bool showTP = input.bool(false, "Take Profit", inline="tp")
- string Tp = input.string("Median", "", ["Median", "Average"], inline="tp")
- //~~ Types & Variables {
- type ZigZag
- int [] x1
- float [] y1
- float [] diff
- bool [] direction // true = up, false = down
- type SuperBollingerTrend
- float s
- color c
- bool confirmed
- int confirmedIndex
- float confirmedPrice
- bool confirmedDirection
- type Alerts
- bool Long = false
- bool Short = false
- bool LongTp = false
- bool ShortTp = false
- var zz = ZigZag.new(array.new<int>(), array.new<float>(), array.new<float>(), array.new<bool>())
- var sbt = SuperBollingerTrend.new(0.0, na, false, na, na, na)
- var alerted = Alerts.new()
- // Calculations (only use confirmed values)
- float bbup = ta.sma(high, prd) + ta.stdev(high, prd) * mult
- float bbdn = ta.sma(low, prd) - ta.stdev(low, prd) * mult
- //~~ Methods {
- // ZigZag - only updates on confirmed bars
- method zigzag(ZigZag z, color c, float p, bool l) =>
- if barstate.isconfirmed
- y2 = dev == "ZigZag" ? sbt.s :
- dev == "High/Low" ? p :
- close
- if z.x1.size() > 0
- x1 = z.x1.get(0)
- y1 = z.y1.get(0)
- z.diff.unshift(math.abs(y2 - y1))
- line.new(x1, y1, bar_index, y2, color=color.new(color.gray, 0), style=line.style_dashed)
- style = signal == "Signal" ? (l ? label.style_triangleup : label.style_triangledown) :
- (l ? label.style_label_up : label.style_label_down)
- txt = signal == "Signal" ? na : str.tostring(y2 - y1, format.mintick) + "p"
- label.new(bar_index, sbt.s, txt, color=c, size=size.small, style=style, textcolor=chart.bg_color)
- z.x1.unshift(bar_index)
- z.y1.unshift(y2)
- z.direction.unshift(l)
- // SuperBollingerTrend - only confirms on closed bars
- method SBT(SuperBollingerTrend s, bool cond, float val, color col, float p, bool l) =>
- if barstate.isconfirmed
- // Only update trend if bar is closed
- s.s := na(bbdn) or na(bbup) ? 0.0 : close > sbt.s ? math.max(sbt.s, bbdn) : close < sbt.s ? math.min(sbt.s, bbup) : s.s
- if cond
- s.s := val
- s.c := col
- s.confirmed := true
- s.confirmedIndex := bar_index
- s.confirmedPrice := p
- s.confirmedDirection := l
- if showZigZag
- zz.zigzag(col, p, l)
- alerted.Long := l ? true : false
- alerted.Short := l ? false : true
- else
- s.confirmed := false
- // Run Methods (only on confirmed bars)
- sbt.SBT(ta.crossover(close, sbt.s), bbdn, color.lime, low, true)
- sbt.SBT(ta.crossunder(close, sbt.s), bbup, color.red, high, false)
- //~~ Plot & Table {
- // Plot confirmed trend only
- plot(sbt.confirmed ? sbt.s : na, "SuperBollingerTrend", sbt.c)
- // TP Line - non-repainting version
- var line tp = na
- var label ltp = na
- var float lockedTP = na
- if barstate.isconfirmed and showTP and zz.y1.size() > 0
- dist = Tp == "Median" ? zz.diff.median() : zz.diff.avg()
- pos = sbt.confirmedDirection
- if sbt.confirmed and (na(tp) or sbt.confirmedIndex != sbt.confirmedIndex[1])
- x = sbt.confirmedIndex
- y = pos ? sbt.confirmedPrice + dist : sbt.confirmedPrice - dist
- lockedTP := y
- if not na(tp)
- line.delete(tp)
- if not na(ltp)
- label.delete(ltp)
- tp := line.new(x, y, bar_index + 10, y, color=color.new(pos ? color.lime : color.red, 0))
- ltp := label.new(bar_index + 10, y, "TP", color=color(na), style=label.style_label_left, textcolor=chart.fg_color)
- alerted.LongTp := pos ? high >= lockedTP and high[1] < lockedTP : false
- alerted.ShortTp := pos ? false : low <= lockedTP and low[1] > lockedTP
- // Table - unchanged
- var table tbl = na
- if barstate.islast and showZigZag and showTable
- dist = Tp == "Median" ? zz.diff.median() : zz.diff.avg()
- tbl := table.new(position.top_right, 1, 1, chart.bg_color,
- frame_color=color.new(color.gray, 50), frame_width=3, border_width=1)
- tbl.cell(0, 0, Tp == "Median" ? "Median ZigZag Distance: " + str.tostring(dist, format.mintick) + "p" : "Avg ZigZag Distance: " + str.tostring(dist, format.mintick) + "p", text_color=chart.fg_color)
- //~~ Alerts {
- alertcondition(alerted.Long and barstate.isconfirmed, "Long Alert", "Long Signal")
- alertcondition(alerted.Short and barstate.isconfirmed, "Short Alert", "Short Signal")
- alertcondition(alerted.LongTp and barstate.isconfirmed, "Long TP Alert", "Long TP")
- alertcondition(alerted.ShortTp and barstate.isconfirmed, "Short TP Alert", "Short TP")
- // === Branding Table ===
- var table brandingTable = table.new(position.top_center, 1, 1, border_width=1, frame_color=color.black, bgcolor=color.white)
- table.cell(brandingTable, 0, 0, "Telegram & Youtube[Setting's] Join: @TrendPulseNXT [V2 - Non-Repainting]", bgcolor=color.white, text_color=color.black, text_size=size.small)
- //////
- //////
- //dicator(shorttitle="BB", title="Bollinger Bands", overlay=true, timeframe="", timeframe_gaps=true)
- length = input.int(20, minval=1)
- maType = input.string("SMA", "Basis MA Type", options = ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
- srcc = input(close, title="Source")
- multt = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
- ma(source, length, _type) =>
- switch _type
- "SMA" => ta.sma(source, length)
- "EMA" => ta.ema(source, length)
- "SMMA (RMA)" => ta.rma(source, length)
- "WMA" => ta.wma(source, length)
- "VWMA" => ta.vwma(source, length)
- basis = ma(srcc, length, maType)
- devv = multt * ta.stdev(srcc, length)
- upper = basis + devv
- lower = basis - devv
- offset = input.int(0, "Offset", minval = -500, maxval = 500, display = display.data_window)
- plot(basis, "Basis", color=#2962FF, offset = offset)
- p1 = plot(upper, "Upper", color=#F23645, offset = offset)
- p2 = plot(lower, "Lower", color=#089981, offset = offset)
- fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=ilcltrtmpy
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment