Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=6
- indicator("Prime Oscillators Pro + [ChartPrime]", shorttitle = "Prime Oscillators Pro + [ChartPrime]", overlay = false, max_lines_count = 500, max_labels_count = 500, max_bars_back = 500)
- const string GRP_MODE = "Mode"
- const string GRP_OSC = "Main Oscillator"
- const string GRP_MF = "Money Flow Tracker"
- const string GRP_MTF = "Multi Time Frame Money Flow"
- const string GRP_VM = "Volume Matrix"
- const string GRP_PB = "Top and Bottom Power Bars"
- const string GRP_T7 = "The True 7"
- const string GRP_SIG = "Signals"
- const string GRP_PS = "Peak Seekers"
- const string GRP_DIV = "Money Flow Divergences"
- const string GRP_DS = "Diamond Shift"
- const string GRP_MVP = "MVP Oscillator"
- const string GRP_COL = "Colors"
- string modeInput = input.string("Prime Oscillator", "Oscillator Mode", options = ["Prime Oscillator", "MVP Oscillator"], group = GRP_MODE, tooltip = "Prime Oscillator: full toolkit (Main Oscillator, Money Flow Tracker, Volume Matrix, Power Bars, The True 7, Signals).\nMVP Oscillator: deep volume analysis ribbon with overextended bars and signals.")
- bool showOsc = input.bool(true, "Main Oscillator", group = GRP_OSC, inline = "osc1")
- bool showGlow = input.bool(true, "Glow", group = GRP_OSC, inline = "osc1")
- int oscLen = input.int(14, "Length", minval = 2, group = GRP_OSC, tooltip = "Base length used for the RSI, Stochastic and CCI components of the main oscillator.")
- int oscSmooth = input.int(9, "Low Lag Smoothing", minval = 1, group = GRP_OSC, tooltip = "Zero lag smoothing length applied to the oscillator.")
- float oscGain = input.float(1.25, "Gain", minval = 0.1, step = 0.05, group = GRP_OSC)
- bool showMF = input.bool(true, "Money Flow Tracker", group = GRP_MF)
- string moneyMode = input.string("Volume Weighted", "Money Mode", options = ["Volume Weighted", "Price Action"], group = GRP_MF, tooltip = "Volume Weighted: price location within the bar weighted by volume.\nPrice Action: body to range pressure without volume.")
- int mfLen = input.int(20, "Length", minval = 2, group = GRP_MF)
- int mfSmooth = input.int(5, "Low Lag Smoothing", minval = 1, group = GRP_MF)
- float mfMult = input.float(1.5, "Multiplier", minval = 0.1, step = 0.1, group = GRP_MF)
- bool mtfOn = input.bool(false, "Use Higher Timeframe", group = GRP_MTF, inline = "mtf", tooltip = "Calculates the Money Flow Tracker on a higher timeframe without repainting (confirmed higher timeframe values only).")
- string mtfTf = input.timeframe("240", "", group = GRP_MTF, inline = "mtf")
- bool showVM = input.bool(true, "Volume Matrix", group = GRP_VM)
- int vmLen = input.int(21, "Smoothing Length", minval = 2, group = GRP_VM)
- float vmHeight = input.float(40.0, "Height", minval = 5, group = GRP_VM)
- bool showPB = input.bool(true, "Top and Bottom Power Bars", group = GRP_PB)
- int pbMin = input.int(4, "Minimum Confirmations", minval = 1, maxval = 7, group = GRP_PB, tooltip = "Minimum number of the 7 conditions that must agree before a power bar is drawn. Brightness grows with the number of confirmations.")
- bool showT7 = input.bool(true, "The True 7", group = GRP_T7)
- float t7Scale = input.float(10.0, "Scale", minval = 1, step = 0.5, group = GRP_T7, tooltip = "Each rank step (from -7 to +7) is multiplied by this value on the oscillator scale.")
- int t7Fast = input.int(21, "Fast EMA", minval = 2, group = GRP_T7, inline = "t7")
- int t7Slow = input.int(50, "Slow EMA", minval = 3, group = GRP_T7, inline = "t7")
- bool showObOs = input.bool(true, "OB/OS Markers", group = GRP_SIG, inline = "ob")
- float obLevel = input.float(100.0, "OB", group = GRP_SIG, inline = "ob")
- float osLevel = input.float(-100.0, "OS", group = GRP_SIG, inline = "ob")
- bool showVS = input.bool(true, "Volume Inspired Signals", group = GRP_SIG, inline = "vs")
- string vwapAnchor = input.timeframe("D", "Anchor", group = GRP_SIG, inline = "vs")
- float vwapMult = input.float(2.0, "Band Multiplier", minval = 0.1, step = 0.1, group = GRP_SIG, tooltip = "Price fairness bands around the anchored VWAP.")
- bool showRev = input.bool(true, "Reversal Signals", group = GRP_SIG, inline = "rv")
- float revLevel = input.float(70.0, "Level", minval = 0, group = GRP_SIG, inline = "rv")
- bool showPS = input.bool(true, "Peak Seekers", group = GRP_PS)
- bool psAuto = input.bool(true, "Auto Optimize", group = GRP_PS, inline = "ps", tooltip = "Automatically optimizes the pivot lookback for the selected chart timeframe.")
- int psManual = input.int(5, "Lookback", minval = 1, group = GRP_PS, inline = "ps")
- int psMin = input.int(3, "Minimum Confluence", minval = 1, maxval = 4, group = GRP_PS, tooltip = "Number of oscillators (RSI, MFI, CCI, Main Oscillator) that must show the same divergence.")
- bool showDiv = input.bool(true, "Money Flow Divergences", group = GRP_DIV)
- bool showRegDiv = input.bool(true, "Regular", group = GRP_DIV, inline = "dv")
- bool showHidDiv = input.bool(true, "Hidden", group = GRP_DIV, inline = "dv")
- int divLeft = input.int(5, "Pivot Left", minval = 1, group = GRP_DIV, inline = "dp")
- int divRight = input.int(3, "Pivot Right", minval = 1, group = GRP_DIV, inline = "dp")
- int divMinRange = input.int(5, "Min Range", minval = 1, group = GRP_DIV, inline = "dr")
- int divMaxRange = input.int(60, "Max Range", minval = 2, group = GRP_DIV, inline = "dr")
- int divMaxLines = input.int(30, "Max Lines", minval = 1, maxval = 500, group = GRP_DIV)
- bool showDS = input.bool(true, "Diamond Shift", group = GRP_DS)
- int dsThresh = input.int(5, "Rank Threshold", minval = 1, maxval = 7, group = GRP_DS, tooltip = "The True 7 rank required (with Money Flow agreement) to confirm a change in market direction.")
- int mvpVwLen = input.int(10, "Volume Weight Length", minval = 1, group = GRP_MVP)
- int mvpLen = input.int(14, "Oscillator Length", minval = 2, group = GRP_MVP)
- int mvpSmooth = input.int(5, "Ribbon Fast", minval = 1, group = GRP_MVP, inline = "rb")
- int mvpSignal = input.int(9, "Ribbon Slow", minval = 1, group = GRP_MVP, inline = "rb")
- bool showMvpBars = input.bool(true, "Overextended Bars", group = GRP_MVP, inline = "mb")
- float mvpExt = input.float(70.0, "Level", minval = 1, maxval = 100, group = GRP_MVP, inline = "mb")
- bool showMvpSig = input.bool(true, "Signals", group = GRP_MVP, inline = "ms")
- float mvpSigLevel = input.float(60.0, "Level", minval = 1, maxval = 100, group = GRP_MVP, inline = "ms")
- color bullCol = input.color(#26E8B5, "Bullish", group = GRP_COL, inline = "c1")
- color bearCol = input.color(#F7375F, "Bearish", group = GRP_COL, inline = "c1")
- color pbHiCol = input.color(#E6FFF8, "Power Bar Peak", group = GRP_COL, inline = "c2")
- color obosCol = input.color(#FF9800, "OB/OS", group = GRP_COL, inline = "c2")
- color vsCol = input.color(#FF9800, "Volume Signals", group = GRP_COL, inline = "c3")
- color revBullCol = input.color(#00E676, "Reversal Up", group = GRP_COL, inline = "c3")
- color revBearCol = input.color(#FF5252, "Reversal Down", group = GRP_COL, inline = "c4")
- color psCol = input.color(#2196F3, "Peak Seekers", group = GRP_COL, inline = "c4")
- color divBullCol = input.color(#00BCD4, "Divergence Bull", group = GRP_COL, inline = "c5")
- color divBearCol = input.color(#FF4D6D, "Divergence Bear", group = GRP_COL, inline = "c5")
- color divHidCol = input.color(#FF9800, "Hidden Divergence", group = GRP_COL, inline = "c6")
- color dsCol = input.color(#FFEB3B, "Diamond Shift", group = GRP_COL, inline = "c6")
- color mvpUpCol = input.color(#2196F3, "MVP Up", group = GRP_COL, inline = "c7")
- color mvpDnCol = input.color(#9C27B0, "MVP Down", group = GRP_COL, inline = "c7")
- color mvpBarCol = input.color(#00E676, "MVP Bars", group = GRP_COL, inline = "c8")
- color zeroCol = input.color(color.new(#787B86, 60), "Zero Line", group = GRP_COL, inline = "c8")
- color levelCol = input.color(color.new(#787B86, 75), "Levels", group = GRP_COL, inline = "c9")
- const float VM_BASE = -130.0
- const float TOP_STRIP = 150.0
- const float BOT_STRIP = -150.0
- const float OB_Y = 165.0
- const float OS_Y = -165.0
- const float OB_TXT_Y = 176.0
- const float OS_TXT_Y = -176.0
- const float REV_Y = 125.0
- const float VS_Y = 113.0
- const float PS_Y = 140.0
- const float DS_OFFSET = 14.0
- const float MVP_SIG_Y = 115.0
- const float EPS = 1e-10
- bool isPrime = modeInput == "Prime Oscillator"
- bool isMvp = modeInput == "MVP Oscillator"
- f_zlema(float src, simple int len) =>
- int lag = math.max(int(math.floor((len - 1) / 2)), 0)
- ta.ema(src + (src - nz(src[lag], src)), len)
- f_clamp(float v, float lo, float hi) =>
- math.max(lo, math.min(hi, v))
- f_stripColor(int cnt, int minC, color base, color peak) =>
- color result = color(na)
- if cnt >= minC
- float strength = float(cnt - minC) / math.max(float(7 - minC), 1.0)
- color mixed = cnt >= 7 ? color.from_gradient(0.5, 0.0, 1.0, base, peak) : base
- float transp = 88.0 - strength * 88.0
- result := color.new(mixed, math.min(100.0, transp))
- result
- f_div(float src, bool found, simple int lb, bool isBear) =>
- var float prevPrice = na
- var float prevSrc = na
- float curPrice = isBear ? high[lb] : low[lb]
- float curSrc = src[lb]
- bool isDiv = false
- if found
- isDiv := not na(prevPrice) and not na(prevSrc) and not na(curSrc) and (isBear ? (curPrice > prevPrice and curSrc < prevSrc) : (curPrice < prevPrice and curSrc > prevSrc))
- prevPrice := curPrice
- prevSrc := curSrc
- isDiv
- f_addLine(array<line> arr, line ln, int maxN) =>
- arr.push(ln)
- while arr.size() > maxN
- line.delete(arr.shift())
- arr.size()
- f_autoLookback() =>
- int tfSec = timeframe.in_seconds(timeframe.period)
- tfSec <= 60 ? 8 : tfSec <= 300 ? 6 : tfSec <= 1800 ? 5 : tfSec <= 14400 ? 4 : tfSec <= 86400 ? 3 : 2
- bool hasVol = ta.cum(nz(volume)) > 0
- float vol = hasVol ? nz(volume) : 1.0
- float rng = math.max(high - low, syminfo.mintick)
- float rsiVal = ta.rsi(close, oscLen)
- float stochVal = ta.stoch(close, high, low, oscLen)
- float cciVal = ta.cci(hlc3, oscLen)
- float mfiRaw = ta.mfi(hlc3, oscLen)
- float rsiHlc = ta.rsi(hlc3, oscLen)
- float mfiVal = hasVol and not na(mfiRaw) ? mfiRaw : rsiHlc
- float rsiN = (nz(rsiVal, 50) - 50) * 2
- float stochN = (nz(stochVal, 50) - 50) * 2
- float cciN = f_clamp(nz(cciVal) / 2, -150, 150)
- float oscRaw = (rsiN + stochN + cciN) / 3
- float oscZl = f_zlema(oscRaw, oscSmooth)
- float osc = ta.ema(oscZl, 2) * oscGain
- bool oscUp = osc >= nz(osc[1], osc)
- color oscCol = oscUp ? bullCol : bearCol
- float clv = ((close - low) - (high - close)) / rng
- float mfVolRaw = math.sum(clv * vol, mfLen) / math.max(math.sum(vol, mfLen), EPS) * 100
- float mfPriceRaw = ta.ema((close - open) / rng, mfLen) * 100
- float mfRaw = moneyMode == "Volume Weighted" and hasVol ? mfVolRaw : mfPriceRaw
- float mfLocal = f_clamp(f_zlema(nz(mfRaw), mfSmooth) * mfMult, -100, 100)
- bool useHtf = mtfOn and timeframe.in_seconds(mtfTf) > timeframe.in_seconds(timeframe.period)
- float mfHtf = useHtf ? request.security(syminfo.tickerid, mtfTf, mfLocal[1], lookahead = barmerge.lookahead_on) : na
- float mf = useHtf and not na(mfHtf) ? mfHtf : mfLocal
- float bullVolSrc = close > open ? vol : close < open ? 0.0 : vol * 0.5
- float bearVolSrc = close < open ? vol : close > open ? 0.0 : vol * 0.5
- float bullV = ta.ema(bullVolSrc, vmLen)
- float bearV = ta.ema(bearVolSrc, vmLen)
- float vmDelta = (bullV - bearV) / math.max(bullV + bearV, EPS)
- float volEma = ta.ema(vol, vmLen)
- float volHi = ta.highest(volEma, 200)
- float vmNorm = nz(volEma / math.max(nz(volHi, volEma), EPS), 0.5)
- float vmTop = VM_BASE + 8.0 + (0.5 * vmNorm + 0.5 * math.abs(nz(vmDelta))) * vmHeight
- color vmBaseCol = color.from_gradient(nz(vmDelta), -0.6, 0.6, bearCol, bullCol)
- float emaFast = ta.ema(close, t7Fast)
- float emaSlow = ta.ema(close, t7Slow)
- [macdLine, macdSig, _] = ta.macd(close, 12, 26, 9)
- bool c1 = close > emaFast
- bool c2 = emaFast > emaSlow
- bool c3 = nz(rsiVal, 50) > 50
- bool c4 = nz(macdLine) > nz(macdSig)
- bool c5 = nz(mfiVal, 50) > 50
- bool c6 = oscUp
- bool c7 = mf > 0
- int bullCount = (c1 ? 1 : 0) + (c2 ? 1 : 0) + (c3 ? 1 : 0) + (c4 ? 1 : 0) + (c5 ? 1 : 0) + (c6 ? 1 : 0) + (c7 ? 1 : 0)
- int bearCount = 7 - bullCount
- int rank = bullCount - bearCount
- bool rankWeak = math.abs(rank) < math.abs(nz(rank[1], rank))
- bool vwapReset = timeframe.change(vwapAnchor)
- [_, vwapUp, vwapDn] = ta.vwap(hlc3, vwapReset, vwapMult)
- bool vsBearRaw = hasVol and not na(vwapUp) and nz(close[1]) > nz(vwapUp[1]) and close <= vwapUp
- bool vsBullRaw = hasVol and not na(vwapDn) and nz(close[1]) < nz(vwapDn[1]) and close >= vwapDn
- int psLb = psAuto ? f_autoLookback() : psManual
- float pricePH = ta.pivothigh(high, psLb, psLb)
- float pricePL = ta.pivotlow(low, psLb, psLb)
- bool phFound = not na(pricePH)
- bool plFound = not na(pricePL)
- bool bearRsi = f_div(rsiVal, phFound, psLb, true)
- bool bearMfi = f_div(mfiVal, phFound, psLb, true)
- bool bearCci = f_div(cciVal, phFound, psLb, true)
- bool bearOsc = f_div(osc, phFound, psLb, true)
- bool bullRsi = f_div(rsiVal, plFound, psLb, false)
- bool bullMfi = f_div(mfiVal, plFound, psLb, false)
- bool bullCci = f_div(cciVal, plFound, psLb, false)
- bool bullOsc = f_div(osc, plFound, psLb, false)
- int psBearCnt = (bearRsi ? 1 : 0) + (bearMfi ? 1 : 0) + (bearCci ? 1 : 0) + (bearOsc ? 1 : 0)
- int psBullCnt = (bullRsi ? 1 : 0) + (bullMfi ? 1 : 0) + (bullCci ? 1 : 0) + (bullOsc ? 1 : 0)
- float oscPH = ta.pivothigh(osc, divLeft, divRight)
- float oscPL = ta.pivotlow(osc, divLeft, divRight)
- float hiAtPivot = high[divRight]
- float loAtPivot = low[divRight]
- float vwPrice = math.sum(hlc3 * vol, mvpVwLen) / math.max(math.sum(vol, mvpVwLen), EPS)
- float mvpRaw = (nz(ta.rsi(vwPrice, mvpLen), 50) - 50) * 2
- float mvpFast = f_clamp(ta.ema(mvpRaw, mvpSmooth), -100, 100)
- float mvpSlow = ta.ema(mvpFast, mvpSignal)
- bool mvpUp = mvpFast >= mvpSlow
- bool mvpCrossUp = ta.crossover(mvpFast, mvpSlow)
- bool mvpCrossDn = ta.crossunder(mvpFast, mvpSlow)
- bool mvpOverExt = math.abs(mvpFast) >= mvpExt
- bool mfCrossUp = ta.crossover(mf, 0.0)
- bool mfCrossDn = ta.crossunder(mf, 0.0)
- bool revBear = osc[1] >= revLevel and osc < osc[1] and osc[1] >= nz(osc[2], osc[1])
- bool revBull = osc[1] <= -revLevel and osc > osc[1] and osc[1] <= nz(osc[2], osc[1])
- bool obCond = osc >= obLevel
- bool osCond = osc <= osLevel
- bool psBear = psBearCnt >= psMin
- bool psBull = psBullCnt >= psMin
- bool mvpBuy = mvpCrossUp and nz(mvpFast[1]) <= -mvpSigLevel
- bool mvpSell = mvpCrossDn and nz(mvpFast[1]) >= mvpSigLevel
- var int mktDir = 0
- int prevDir = mktDir
- if rank >= dsThresh and mf > 0
- mktDir := 1
- else if rank <= -dsThresh and mf < 0
- mktDir := -1
- bool dsBull = mktDir == 1 and prevDir == -1
- bool dsBear = mktDir == -1 and prevDir == 1
- var int obStart = na
- var int osStart = na
- var label obLbl = na
- var label osLbl = na
- if isPrime and showObOs
- if obCond and not obCond[1]
- obStart := bar_index
- obLbl := label.new(bar_index, OB_TXT_Y, "OB", xloc = xloc.bar_index, yloc = yloc.price, color = color(na), style = label.style_none, textcolor = obosCol, size = size.tiny)
- else if obCond and not na(obLbl)
- label.set_x(obLbl, int(math.round((obStart + bar_index) / 2.0)))
- if osCond and not osCond[1]
- osStart := bar_index
- osLbl := label.new(bar_index, OS_TXT_Y, "OS", xloc = xloc.bar_index, yloc = yloc.price, color = color(na), style = label.style_none, textcolor = obosCol, size = size.tiny)
- else if osCond and not na(osLbl)
- label.set_x(osLbl, int(math.round((osStart + bar_index) / 2.0)))
- var array<line> divLines = array.new<line>()
- var float lastHOsc = na
- var float lastHPrice = na
- var int lastHBar = na
- var float lastLOsc = na
- var float lastLPrice = na
- var int lastLBar = na
- bool regBear = false
- bool hidBear = false
- bool regBull = false
- bool hidBull = false
- bool drawDiv = isPrime and showDiv
- if not na(oscPH)
- int curBar = bar_index - divRight
- if not na(lastHOsc) and not na(lastHBar)
- int dist = curBar - lastHBar
- if dist >= divMinRange and dist <= divMaxRange
- regBear := showRegDiv and hiAtPivot > lastHPrice and oscPH < lastHOsc
- hidBear := showHidDiv and hiAtPivot < lastHPrice and oscPH > lastHOsc
- if drawDiv and regBear
- f_addLine(divLines, line.new(lastHBar, lastHOsc, curBar, oscPH, xloc = xloc.bar_index, color = divBearCol, width = 2), divMaxLines)
- if drawDiv and hidBear
- f_addLine(divLines, line.new(lastHBar, lastHOsc, curBar, oscPH, xloc = xloc.bar_index, color = divHidCol, width = 2), divMaxLines)
- lastHOsc := oscPH
- lastHPrice := hiAtPivot
- lastHBar := curBar
- if not na(oscPL)
- int curBar = bar_index - divRight
- if not na(lastLOsc) and not na(lastLBar)
- int dist = curBar - lastLBar
- if dist >= divMinRange and dist <= divMaxRange
- regBull := showRegDiv and loAtPivot < lastLPrice and oscPL > lastLOsc
- hidBull := showHidDiv and loAtPivot > lastLPrice and oscPL < lastLOsc
- if drawDiv and regBull
- f_addLine(divLines, line.new(lastLBar, lastLOsc, curBar, oscPL, xloc = xloc.bar_index, color = divBullCol, width = 2), divMaxLines)
- if drawDiv and hidBull
- f_addLine(divLines, line.new(lastLBar, lastLOsc, curBar, oscPL, xloc = xloc.bar_index, color = divHidCol, width = 2), divMaxLines)
- lastLOsc := oscPL
- lastLPrice := loAtPivot
- lastLBar := curBar
- hline(0, "Zero Line", color = zeroCol, linestyle = hline.style_solid)
- hline(75, "Upper Level", color = levelCol, linestyle = hline.style_solid)
- hline(-75, "Lower Level", color = levelCol, linestyle = hline.style_solid)
- hline(100, "Upper Extreme", color = levelCol, linestyle = hline.style_dotted)
- hline(-100, "Lower Extreme", color = levelCol, linestyle = hline.style_dotted)
- bool vmOn = isPrime and showVM
- plot(vmOn ? vmTop : na, "Volume Matrix", color = color.new(vmBaseCol, 78), style = plot.style_columns, histbase = VM_BASE)
- plot(vmOn ? vmTop : na, "Volume Matrix Line", color = color.new(vmBaseCol, 45), linewidth = 1)
- bool mfOn = isPrime and showMF
- pZero = plot(mfOn ? 0.0 : na, "Money Flow Base", display = display.none, editable = false)
- pMfPos = plot(mfOn ? math.max(mf, 0.0) : na, "Money Flow Positive", display = display.none, editable = false)
- pMfNeg = plot(mfOn ? math.min(mf, 0.0) : na, "Money Flow Negative", display = display.none, editable = false)
- fill(pMfPos, pZero, mfOn ? math.max(mf, 0.01) : na, 0.0, color.new(bullCol, 45), color.new(bullCol, 96), "Money Flow In")
- fill(pZero, pMfNeg, 0.0, mfOn ? math.min(mf, -0.01) : na, color.new(bearCol, 96), color.new(bearCol, 45), "Money Flow Out")
- plot(mfOn ? mf : na, "Money Flow Tracker", color = color.new(mf >= 0 ? bullCol : bearCol, 35), linewidth = 2)
- bool t7On = isPrime and showT7
- color t7Col = color.new(rank > 0 ? bullCol : bearCol, rankWeak ? 72 : 45)
- plot(t7On ? rank * t7Scale : na, "The True 7", color = t7Col, linewidth = 1, style = plot.style_stepline)
- bool pbOn = isPrime and showPB
- plot(pbOn ? TOP_STRIP : na, "Top Power Bar", color = f_stripColor(bullCount, pbMin, bullCol, pbHiCol), linewidth = 4, style = plot.style_linebr)
- plot(pbOn ? BOT_STRIP : na, "Bottom Power Bar", color = f_stripColor(bearCount, pbMin, bearCol, pbHiCol), linewidth = 4, style = plot.style_linebr)
- bool oscOn = isPrime and showOsc
- bool glowOn = oscOn and showGlow
- plot(glowOn ? osc : na, "Oscillator Glow", color = color.new(oscCol, 82), linewidth = 6)
- plot(oscOn ? osc : na, "Main Oscillator", color = oscCol, linewidth = 2)
- plotshape(isPrime and showObOs and obCond ? OB_Y : na, "OB Marker", style = shape.square, location = location.absolute, color = obosCol, size = size.tiny)
- plotshape(isPrime and showObOs and osCond ? OS_Y : na, "OS Marker", style = shape.square, location = location.absolute, color = obosCol, size = size.tiny)
- plotchar(isPrime and showVS and vsBearRaw ? VS_Y : na, "Volume Signal Down", char = "⇣", location = location.absolute, color = vsCol, size = size.tiny)
- plotchar(isPrime and showVS and vsBullRaw ? -VS_Y : na, "Volume Signal Up", char = "⇡", location = location.absolute, color = vsCol, size = size.tiny)
- plotshape(isPrime and showRev and revBear ? REV_Y : na, "Reversal Down", style = shape.triangledown, location = location.absolute, color = revBearCol, size = size.tiny, offset = -1)
- plotshape(isPrime and showRev and revBull ? -REV_Y : na, "Reversal Up", style = shape.triangleup, location = location.absolute, color = revBullCol, size = size.tiny, offset = -1)
- plotshape(isPrime and showPS and psBear ? PS_Y : na, "Peak Seeker Bearish", style = shape.circle, location = location.absolute, color = psCol, size = size.tiny, offset = -psLb)
- plotshape(isPrime and showPS and psBull ? -PS_Y : na, "Peak Seeker Bullish", style = shape.circle, location = location.absolute, color = psCol, size = size.tiny, offset = -psLb)
- plotshape(isPrime and showDS and dsBear ? osc + DS_OFFSET : na, "Diamond Shift Bearish", style = shape.diamond, location = location.absolute, color = dsCol, size = size.tiny)
- plotshape(isPrime and showDS and dsBull ? osc - DS_OFFSET : na, "Diamond Shift Bullish", style = shape.diamond, location = location.absolute, color = dsCol, size = size.tiny)
- color mvpCol = mvpUp ? mvpUpCol : mvpDnCol
- plot(isMvp and showMvpBars and mvpOverExt ? mvpFast : na, "MVP Overextended Bars", color = color.new(mvpBarCol, 35), style = plot.style_columns, histbase = 0.0)
- pMvpFast = plot(isMvp ? mvpFast : na, "MVP Ribbon Fast", color = mvpCol, linewidth = 2)
- pMvpSlow = plot(isMvp ? mvpSlow : na, "MVP Ribbon Slow", color = color.new(mvpCol, 40), linewidth = 1)
- fill(pMvpFast, pMvpSlow, color.new(mvpCol, 55), "MVP Ribbon Fill")
- plotshape(isMvp and showMvpSig and mvpBuy ? -MVP_SIG_Y : na, "MVP Buy Signal", style = shape.arrowup, location = location.absolute, color = mvpUpCol, size = size.small)
- plotshape(isMvp and showMvpSig and mvpSell ? MVP_SIG_Y : na, "MVP Sell Signal", style = shape.arrowdown, location = location.absolute, color = mvpDnCol, size = size.small)
- string tk = syminfo.ticker + " (" + timeframe.period + ")"
- string pre = "Prime Oscillators: "
- if isPrime and revBull
- alert(pre + "Bullish reversal on " + tk, alert.freq_once_per_bar_close)
- if isPrime and revBear
- alert(pre + "Bearish reversal on " + tk, alert.freq_once_per_bar_close)
- if isPrime and obCond and not obCond[1]
- alert(pre + "Overbought on " + tk, alert.freq_once_per_bar_close)
- if isPrime and osCond and not osCond[1]
- alert(pre + "Oversold on " + tk, alert.freq_once_per_bar_close)
- if isPrime and vsBullRaw
- alert(pre + "Volume signal up on " + tk, alert.freq_once_per_bar_close)
- if isPrime and vsBearRaw
- alert(pre + "Volume signal down on " + tk, alert.freq_once_per_bar_close)
- if isPrime and psBull
- alert(pre + "Bullish Peak Seeker on " + tk, alert.freq_once_per_bar_close)
- if isPrime and psBear
- alert(pre + "Bearish Peak Seeker on " + tk, alert.freq_once_per_bar_close)
- if isPrime and regBull
- alert(pre + "Bullish divergence on " + tk, alert.freq_once_per_bar_close)
- if isPrime and regBear
- alert(pre + "Bearish divergence on " + tk, alert.freq_once_per_bar_close)
- if isPrime and hidBull
- alert(pre + "Hidden bullish divergence on " + tk, alert.freq_once_per_bar_close)
- if isPrime and hidBear
- alert(pre + "Hidden bearish divergence on " + tk, alert.freq_once_per_bar_close)
- if isPrime and dsBull
- alert(pre + "Diamond Shift bullish on " + tk, alert.freq_once_per_bar_close)
- if isPrime and dsBear
- alert(pre + "Diamond Shift bearish on " + tk, alert.freq_once_per_bar_close)
- if isPrime and mfCrossUp
- alert(pre + "Money Flow above zero on " + tk, alert.freq_once_per_bar_close)
- if isPrime and mfCrossDn
- alert(pre + "Money Flow below zero on " + tk, alert.freq_once_per_bar_close)
- if isMvp and mvpBuy
- alert(pre + "MVP buy on " + tk, alert.freq_once_per_bar_close)
- if isMvp and mvpSell
- alert(pre + "MVP sell on " + tk, alert.freq_once_per_bar_close)
- if isMvp and mvpOverExt and not mvpOverExt[1]
- alert(pre + "MVP overextended on " + tk, alert.freq_once_per_bar_close)
Add Comment
Please, Sign In to add comment