Professional Documents
Culture Documents
1112
1112
//Momentum Conditions
sc1 = sz >= 0
sc2 = sz < 0
sc3 = sz >= sz[1]
sc4 = sz < sz[1]
clr = sc1 and sc3 ? #00FF00 : sc1 and sc4 ? #008000 : sc2 and sc4 ? #FF0000 : sc2
and sc3 ? #800000 : color.gray
//SQUEEZE
useTrueRange = true
// Calculate BB
source = close
basis = ta.sma(source, lengths)
dev = multKC * ta.stdev(source, lengths)
upperBB = basis + dev
lowerBB = basis - dev
// Calculate KC
ma = ta.sma(source, lengthKC)
range_1 = useTrueRange ? ta.tr : high - low
rangema = ta.sma(range_1, lengthKC)
upperKC = ma + rangema * multKC
lowerKC = ma - rangema * multKC
dirmov(len) =>
up = ta.change(high)
down = -ta.change(low)
truerange = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(up > down and up > 0 ? up : 0, len) / truerange)
minus = fixnan(100 * ta.rma(down > up and down > 0 ? down : 0, len) /
truerange)
[plus, minus]
///////////////////////////////////////////////////////////////
biggest(series) =>
max = 0.0
max := nz(max[1], series)
if series > max
max := series
max
max
bgcolor(adxValue > adxValue[1] and adxValue > 23 and show_Momen and show_bg ? clr :
na, transp=95)
//RSI
show_rsi = input(true, title='------------Show RSI---------')
show_RSIfondo = input(true, title='Show RSI background')
len = input.int(14, minval=1, title='Length RSI 1')
upperR = input(70, title='Upper band')
middleR = input(50, title='Middle band')
lowerR = input(30, title='Lower band')
rsi = ta.rsi(src, len)
rsiColor = rsi <= lowerR ? color.green : rsi >= upperR ? color.red : #da00ff
rsi_scale = rsi * ni / scale
/////////
/////// estocastico
k1 = k * ni / scale
d1 = d * ni / scale
plot(show_stoch ? k1 : na, title='%K', color=color.new(#2962FF, 0))
plot(show_stoch ? d1 : na, title='%D', color=color.new(#FF6D00, 0))
upS = input(80, title='Upper band')
lowS = input(20, title='Lower band')
/////////////////AWESOME
show_ao = input(false, title='-----------Show AO-------')
show_aoF = input(false, title='Show ao away 0 point')
farAO = input(-30, title='Away from 0 point')
aoColor = ao >= 0 ? ao[1] < ao ? #26A69A : #B2DFDB : ao[1] < ao ? #FFCDD2 : #EF5350
/////////////////////
////////////////////////////////////
///////MACD
/////////////////////////////
show_macd = input(false, title='-----------Show MACD-------')
show_macdF = input(false, title='Show MACD area away 0 point')
show_macdLF = input(false, title='Show MACD lines away 0 point')
macdF = input(-30, title='Away 0 point')
show_macdL = input(false, title='Show MACD lines')
fast_length = input(title='Fast Length', defval=12)
slow_length = input(title='Slow Length', defval=26)
//src = input(title="Source", type=input.source, defval=close)
signal_length = input.int(title='Signal Smoothing', minval=1, maxval=50, defval=9)
sma_source = input.string(title='Oscillator MA Type', defval='EMA', options=['SMA',
'EMA'])
sma_signal = input.string(title='Signal Line MA Type', defval='EMA',
options=['SMA', 'EMA'])
macdScale = input(2, title='MACD scale')
//calculating
fast_ma = sma_source == 'SMA' ? ta.sma(src, fast_length) : ta.ema(src, fast_length)
slow_ma = sma_source == 'SMA' ? ta.sma(src, slow_length) : ta.ema(src, slow_length)
macd1 = fast_ma - slow_ma
signal = sma_signal == 'SMA' ? ta.sma(macd1, signal_length) : ta.ema(macd1,
signal_length)
hist = macd1 - signal
//color
macdColor = hist >= 0 ? hist[1] < hist ? #26A69A : #B2DFDB : hist[1] < hist ?
#FFCDD2 : #EF5350
histo = hist * macdScale
macd = macd1 * macdScale
sign = signal * macdScale
////////////////////////////////////////
////////////////////// KONOCORDE "Koncorde Inversiones en el Mundo by lkdml all the
credits for them
/////////////////////////////////
show_K = input(true, title='---------------Show Koncorde-------------')
scaleK = input(8, title='Koncorde scale')
showKF = input(true, title='Show Koncorde away 0 point')
fark = input(-40, title='Away from 0 point')
show_KD = input(true, title='Show Koncorde Diamond')
kon_pos = input(30, title='Position diamonds Bull')
kon_posn = input(30, title='Position diamonds Bear')
srcTprice = input(ohlc4, title='Fuente para Precio Total')
srcMfi = input.source(hlc3, title='Fuente MFI', group='Money Flow Index')
tprice = srcTprice
nvim = ta.ema(ta.nvi, m)
nvimax = ta.highest(nvim, longitudNVI)
nvimin = ta.lowest(nvim, longitudNVI)
azul = (ta.nvi - nvim) * 100 / (nvimax - nvimin)
// Bands Calculation
basisK = ta.sma(tprice, boLength) //Find the 20-day moving average average (n1 +
n2 ... + n20)/20
devK = mult * ta.stdev(tprice, boLength) //Find the standard deviation of the 20-
days
upper = basisK + devK //Upper Band = 20-day Moving Average + (2 x standard
deviation of the 20-days)
lower = basisK - devK //Lower Band = 20-day Moving Average - (2 x standard
deviation of the 20-days)
OB1 = (upper + lower) / 2.0
OB2 = upper - lower
////////////////////////////////////////
////////////////////// END KONCORDE
/////////////////////////////////
////////////////////////////////////////
////////////////////// Elliot oscilator
/////////////////////////////////
show_eo = input(false, title='------------Show Elliot Oscillator---------')
////////////////////////////////////////
////////////////////// END elliot
/////////////////////////////////
////////////////////////////////////////
////////////////////// CCI
/////////////////////////////////
show_cci = input(false, title='------------Show CCI---------')
cci_len = input(14, 'CCI length')
cci_src = input(close, 'CCI source')
upperCCI = input(100, 'CCI Upper band')
lowerCCI = input(-100, 'CCI lower band')
b1cci = upperCCI * ni / scale * 30 / 100
b0cci = lowerCCI * ni / scale * 30 / 100
cci = ta.cci(cci_src, cci_len)
////////////////////////////////////////
////////////////////// END CCI
/////////////////////////////////
///////////////////
////////
////////////////////
colorcm = show_cci ? color.blue : color.white
band1 = plot(show_rsi ? b1s : show_stoch ? h1s : na, color=bar_index % 2 == 0 ?
color.white : #00000000, transp=60)
band0 = plot(show_rsi ? b0s : show_stoch ? h0s : show_cci ? b0cci : na,
color=bar_index % 2 == 0 ? color.white : #00000000, transp=60)
bandm = plot(show_cci ? b1cci : show_rsi ? bm : na, color=bar_index % 2 == 0 ?
colorcm : #00000000, transp=70)
band00 = plot(show_cci ? b0cci : na, color=bar_index % 2 == 0 ? color.blue :
#00000000, transp=60)
fill(band1, band0, color=show_rsi and show_RSIfondo ? color.purple : na, title='RSI
background', transp=90)
//////////////
////////
/////////////////////\/
/////////////MFI i got the code fo=rom the CIPHER indicator by vumanchu
//////////////////////
// RSI+MFI
f_rsimfi(_period, _multiplier, _tf) =>
request.security(syminfo.tickerid, _tf, ta.sma((close - open) / (high - low) *
_multiplier, _period) - rsiMFIPosY)
//wt
CALC(n1, n2, smooth) =>
ap = hlc3
esa = ta.ema(ap, n1)
dw = ta.ema(math.abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * dw)
tci = ta.ema(ci, n2)
wt1 = tci
wt2 = ta.sma(wt1, smooth)
wave = wt1 - wt2
wavecolor = wave >= 0 ? color.lime : color.red
[wave, wavecolor]
//CIPHERR
[wave, wavecolor] = CALC(n1, n2, smooth)
middle = 0
condWt = ta.cross(wave, middle) ? true : na
wtjeje = show_Momen ? sz : show_ao ? ao : show_macd ? macd : show_eo ? eo : na
plot(condWt and show_cphr ? wtjeje : na, title='Buy and sell circle',
color=wavecolor, style=plot.style_circles, linewidth=3, transp=15)
/////plot ADX
///
///////////////
// ESTADOOO
show_status = input(true, title='------Show STATUS----------')
dist = input(3, title='Distancia del monitor')
dashColor = input.color(color.new(#696969, 90), 'label Color', inline='Dash Line')
dashTextColor = input.color(color.new(#ffffff, 0), 'Text Color', inline='Dash
Line')
a1 = adxValue >= 23
a2 = adxValue < 23
a3 = adxValue >= adxValue[1]
a4 = adxValue < adxValue[1]
iMom = sc1 and sc3 ? 'Direccionalidad alcista' : sc1 and sc4 ? 'Direccionalidad
bajista' : sc2 and sc4 ? 'Direccionalidad bajista' : sc2 and sc3 ? 'Direccinalidad
alcista' : '-'
igral = a1 and a3 and sc1 and sc3 ? 'Fuerte movimiento alcista' : a1 and a3 and sc1
and sc4 ? 'Monitor muestra rango-caida pero\nel movimiento tiene fuerza' : a1 and
a3 and sc2 and sc4 ? 'Fuerte movimiento bajista' : a1 and a3 and sc2 and sc3 ?
'Monitor muestra rango-subida pero\nel movimiento tiene fuerza' : a1 and a4 and sc1
and sc3 ? 'Movimiento alcista sin fuerza' : a1 and a4 and sc1 and sc4 ? 'Monitor
muestra rango-caida\n pendiente negativa en ADX (venta)' : a1 and a4 and sc2 and
sc4 ? 'Movimiento bajista sin fuerza' : a1 and a4 and sc2 and sc3 ? 'Monitor
muestra rango-subida con \npendiente negativa en ADX (compra)' : a2 and a4 and sc1
and sc3 ? 'Movimiento alcista sin fuerza' : a2 and a4 and sc1 and sc4 ? 'Monitor
muestra rango-caida sin fuerza ' : a2 and a4 and sc2 and sc4 ? 'Movimiento bajista
sin fuerza' : a2 and a4 and sc2 and sc3 ? 'Monitor muestra rango-subida sin fuerza
' : a2 and a3 and sc1 and sc3 ? 'Movimiento alcista que \n quiere agarrar fuerza' :
a2 and a3 and sc1 and sc4 ? 'Monitor muestra rango-caida,\n el movimiento quiere
agarrar fuerza' : a2 and a3 and sc2 and sc4 ? 'Movimiento bajista que \n quiere
agarrar fuerza' : a2 and a3 and sc2 and sc3 ? 'Monitor muestra rango-subida,\n el
movimiento quiere agarrar fuerza' : '-'
s = '\n'
scr_label = 'Info ADX: ' + iAdx + s + 'Info monitor: ' + iMom + s + 'Info general:'
+ s + igral
// Plot Label on the chart
// Plot Label on the chart
if show_status
//DIVERGENCIAS BUENNNNNNNAS
show_div = input(false, title='------Divergencias--------')
lbR = input(title='Pivot Lookback Right', defval=1)
lbL = input(title='Pivot Lookback Left', defval=1)
rangeUpper = input(title='Max of Lookback Range', defval=60)
rangeLower = input(title='Min of Lookback Range', defval=1)
plotBull = input(title='Plot Bullish', defval=true)
plotHiddenBull = input(title='Plot Hidden Bullish', defval=true)
plotBear = input(title='Plot Bearish', defval=true)
plotHiddenBear = input(title='Plot Hidden Bearish', defval=true)
plotlab = input(title='Plot label', defval=false)
bearColor = #ff0000
bullColor = #1bff00
hiddenBullColor = #a4ff99
hiddenBearColor = #ff9e9e
textColor = color.white
noneColor = color.new(color.white, 100)
//FUNCTIONS
plFound(osc) =>
na(ta.pivotlow(osc, lbL, lbR)) ? false : true
phFound(osc) =>
na(ta.pivothigh(osc, lbL, lbR)) ? false : true
_inRange(cond) =>
bars = ta.barssince(cond == true)
rangeLower <= bars and bars <= rangeUpper
_findDivRB(osc) =>
// Osc: Higher Low
oscHL = osc[lbR] > ta.valuewhen(plFound(osc), osc[lbR], 1) and
_inRange(plFound(osc)[1])
//-----------------------------------------------------------------------------
-
// Hidden Bullish
//-----------------------------------------------------------------------------
-
// Hidden Bearish
////////////////////RSI DIV//////////////////
[rsi_bullCond, rsi_hiddenBullCond, rsi_bearCond, rsi_hiddenBearCond] =
_findDivRB(rsi_scale)
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////