0% found this document useful (0 votes)
66 views

MarketCipherBpinescript

The document is a TradingView script for an indicator called 'MarketCipher B' that utilizes WaveTrend and RSI/MFI for trading signals. It defines various visual elements like circles and triangles to indicate market conditions such as overbought or oversold levels, as well as bullish or bearish divergences. The script includes customizable parameters for displaying different indicators and alerts for buy and sell signals based on WaveTrend crossings.

Uploaded by

parvejmodel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

MarketCipherBpinescript

The document is a TradingView script for an indicator called 'MarketCipher B' that utilizes WaveTrend and RSI/MFI for trading signals. It defines various visual elements like circles and triangles to indicate market conditions such as overbought or oversold levels, as well as bullish or bearish divergences. The script includes customizable parameters for displaying different indicators and alerts for buy and sell signals based on WaveTrend crossings.

Uploaded by

parvejmodel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

//@version=5

//
// CIRCLES & TRIANGLES:
// - LITTLE CIRCLE: They appear at all WaveTrend wave crossings.
// - GREEN CIRCLE: The wavetrend waves are at the oversold level and have
crossed up (bullish).
// - RED CIRCLE: The wavetrend waves are at the overbought level and have
crossed down (bearish).
// - GOLD/ORANGE CIRCLE: When RSI is below 20, WaveTrend waves are below or
equal to -80 and have crossed up after good bullish divergence (DONT BUY WHEN GOLD
CIRCLE APPEAR).
// - None of these circles are certain signs to trade. It is only information
that can help you.
// - PURPLE TRIANGLE: Appear when a bullish or bearish divergence is formed and
WaveTrend waves crosses at overbought and oversold points.

indicator(title='MarketCipher B', shorttitle='MarketCipher B')

// WaveTrend
wtShow = input(true, title='Show Waves')
Showvwap = input(true, title='Show Fast Waves')
wtDotsShow = input(true, title='Show Dots')
rsiMFIShow = input(true, title='Show MFI')
rsiShow = input(true, title='Show RSIs')

// RSI
rsiSRC = close
rsiLen = 14
rsiOversold = 30
rsiOverbought = 60

rsiMFIperiod = 60
rsiMFIMultiplier = 200
rsiMFIPosY = 2.5

wtChannelLen =9
wtAverageLen = 12
wtMASource = hlc3
wtMALen = 3
obLevel = 53
obLevel2 = 60
obLevel3 = 100
osLevel = -53
osLevel2 = -60
osLevel3 = -100

// Colors
colorRed = #ff0000
colorPurple = #e600e6
colorGreen = #3fff00
colorOrange = #e2a400
colorYellow = #ffeb3b
colorWhite = #ffffff
colorPink = #ff00f0
colorBluelight = #31c0ff

colorWT1 = #90caf9
colorWT2 = #0d47a1
// f_vfi(fviPeriod=60, coef=0.2, vCoef=2.5) =>
// avg = nz(hlc3)
// inter = math.log(avg) - math.log(avg[1])
// vInter = ta.stdev(inter, 30)
// cutOff = coef * vInter * close
// vAve = ta.sma(volume[1], fviPeriod)
// vMax = vAve * vCoef
// vC = math.min(volume, vMax)
// mf = avg - avg[1]
// vCp = mf > cutOff? vC: (mf < -cutOff? -vC: 0)
// sVfi = math.sum(vCp, fviPeriod) / vAve
// vfi = ta.sma(sVfi, 5)
// vfi

smma(src,len)=>
smma = 0.0
smma := na(smma[1]) ? ta.sma(src, len) : (smma[1] * (len - 1) + src) / len
smma

// normalize(_src, _min=-100, _max=100) =>


// // Normalizes series with unknown min/max using historical min/max.
// // _src : series to rescale.
// // _min, _min: min/max values of rescaled series.
// var _historicMin = 10e10
// var _historicMax = -10e10
// _historicMin := math.min(nz(_src, _historicMin), _historicMin)
// _historicMax := math.max(nz(_src, _historicMax), _historicMax)
// _min + (_max - _min) * (_src - _historicMin) / math.max(_historicMax -
_historicMin, 10e-10)

// RSI+MFI
f_rsimfi(_period, _multiplier) =>
mf = ta.sma(((close - open) / (high - low)) * _multiplier, _period) -
rsiMFIPosY
smma(mf, 3)

// WaveTrend
f_wavetrend(src, chlen, avg, malen) =>
tfsrc = src
esa = ta.ema(tfsrc, chlen)
de = ta.ema(math.abs(tfsrc - esa), chlen)
ci = (tfsrc - esa) / (0.015 * de)
wtf1 = ta.ema(ci, avg)
wtf2 = ta.sma(wtf1, malen)
wt1 = wtf1
wt2 = wtf2
wtVwap = wt1 - wt2
wtOversold = wt1 <= -60 and wt2 <= -60
wtOverbought = wt2 >= 60 and wt1 >= 60
wtCross = ta.cross(wt1, wt2)
wtCrossUp = wt2 - wt1 <= 0
wtCrossDown = wt2 - wt1 >= 0
wtCrosslast = ta.cross(wt1[2], wt2[2])
wtCrossUplast = wt2[2] - wt1[2] <= 0
wtCrossDownlast = wt2[2] - wt1[2] >= 0
[wt1, wt2, wtOversold, wtOverbought, wtCross, wtCrossUp, wtCrossDown,
wtCrosslast, wtCrossUplast, wtCrossDownlast, wtVwap]
// Stochastic RSI
f_stochrsi(_src, _stochlen, _rsilen, _smoothk, _smoothd, _log, _avg) =>
src = _log ? math.log(_src) : _src
rsi = ta.rsi(src, _rsilen)
kk = ta.sma(ta.stoch(rsi, rsi, rsi, _stochlen), _smoothk)
d1 = ta.sma(kk, _smoothd)
avg_1 = math.avg(kk, d1)
k = _avg ? avg_1 : kk
[k, d1]

// RSI
rsi =ta.rsi(rsiSRC, rsiLen)
newRSI = ta.sma(ta.stoch(close, high, low, 40), 2)
rsiColor = rsi <= rsiOversold ? colorGreen : rsi >= rsiOverbought ? colorRed :
colorPurple

// RSI + MFI Area


rsiMFI = f_rsimfi(rsiMFIperiod, rsiMFIMultiplier)
// rsiMFIColor = rsiMFI > 0 ? #3ee145 : #ff3d2e
rsiMFIColor = rsiMFI > 0 ? #3fff00 : #ff1100

// Calculates WaveTrend
[wt1, wt2, wtOversold, wtOverbought, wtCross, wtCrossUp, wtCrossDown, wtCross_last,
wtCrossUp_last, wtCrossDown_last, wtVwap] = f_wavetrend(wtMASource, wtChannelLen,
wtAverageLen, wtMALen)

// Stochastic RSI
SRSI_k_Fast = ta.sma(ta.stoch(close, high, low, 81), 2)
newStochColor = SRSI_k_Fast < newRSI ? colorGreen : SRSI_k_Fast >= newRSI ?
colorRed : colorPurple

// Small Circles WT Cross


signalColor = wt2 - wt1 > 0 ? color.red : color.lime

// Buy signal.
buySignal = wtCross and wtCrossUp and wtOversold

// Sell signal
sellSignal = wtCross and wtCrossDown and wtOverbought

// } CALCULATE INDICATORS

// DRAW {

// WT Areas
plot(wtShow ? wt1 : na, style=plot.style_area, title='WT Wave 1', color=colorWT1,
transp=0)
plot(wtShow ? wt2 : na, style=plot.style_area, title='WT Wave 2', color=colorWT2,
trackprice=true, transp=10)

// MFI BAR
rsiMfiBarTopLine = plot(rsiMFIShow ? -90 : na, title='MFI Bar TOP Line',
transp=100)
rsiMfiBarBottomLine = plot(rsiMFIShow ? -100 : na, title='MFI Bar BOTTOM Line',
transp=100)
fill(rsiMfiBarTopLine, rsiMfiBarBottomLine, title='MFI Bar Colors',
color=rsiMFIColor, transp=70)

// VWAP
plot(Showvwap ? wtVwap : na, title='VWAP', color=colorYellow,
style=plot.style_area, transp=0)

// hline(0, linestyle=hline.style_dotted, color=color.white)


zLine = plot(0, color=color.white, linewidth=1, transp=0, trackprice=true)

// MFI AREA
rsiMFIplot = plot(rsiMFIShow? rsiMFI : na, title='RSI+MFI Area', color=rsiMFIColor,
trackprice=true, style=plot.style_area, linewidth=2, transp=60)
fill(rsiMFIplot, zLine, rsiMFIColor, transp=100)

// RSI
//plot(rsiShow ? rsi : na, title = 'RSI', color = rsiColor, linewidth = 1, transp =
0)
plot(rsiShow?newRSI:na, title='RSI', color=color.new(#e600e6, 0), linewidth=1)
plot(rsiShow?SRSI_k_Fast:na, title='Stoch', color=newStochColor, linewidth=2,
transp=0)

// Draw Overbought & Oversold lines


plot(obLevel, title='Over Bought Level 1', color=colorWhite, linewidth=1,
style=plot.style_circles, transp=50)
plot(obLevel2, title='Over Bought Level 2', color=colorWhite, linewidth=2,
style=plot.style_line, transp=25)
plot(obLevel3, title='Over Bought Level 3', color=colorWhite, linewidth=1,
style=plot.style_circles, transp=50)
plot(osLevel, title='Over Sold Level 1', color=colorWhite, linewidth=1,
style=plot.style_circles, transp=50)
plot(osLevel2, title='Over Sold Level 2', color=colorWhite, linewidth=2,
style=plot.style_line, transp=25)

// Circles
plot(wtDotsShow and wtCross ? wt2 : na, title='Buy and sell circle',
color=signalColor, style=plot.style_circles, linewidth=3, transp=15)
// plotshape(wtDotsShow and buySignal ? -95 : na, title='Buy circle',
style=shape.circle, color=color.new(#3fff00, 0), location=location.bottom,
size=size.tiny)
// plotshape(wtDotsShow and sellSignal ? -95 : na, title='Sell circle',
style=shape.circle, color=color.new(#ff1100, 0), location=location.bottom,
size=size.tiny)
// plotshape(sellSignal ? 95 : na, title='Sell circle', style=shape.circle,
color=color.new(#ff1100, 0), location=location.top, size=size.tiny)

alertcondition(buySignal or wtCross and wtCrossUp, 'Buy', 'Buy')


alertcondition(sellSignal or wtCross and wtCrossDown, 'Sell', 'Sell')

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy