8 Nostradamus
8 Nostradamus
8 Nostradamus
top = ta.highest(bbars)
bot = ta.lowest(bbars)
dist = (top - bot) / 500
step = (top - bot) / cnum
if barstate.islast
// calculate/get volume for each channel and candle
volumes = array.new_float(cnum * 2, 0.)
for bars = 0 to bbars - 1 by 1
body_top = math.max(close[bars], open[bars])
body_bot = math.min(close[bars], open[bars])
itsgreen = close[bars] >= open[bars]
maxvol = array.max(totalvols)
for x = 0 to cnum * 2 - 1 by 1
array.set(volumes, x, array.get(volumes, x) * bbars / (3 * maxvol))
// Draw VP rows
var vol_bars = array.new_box(cnum * 2, na)
for x = 0 to cnum - 1 by 1
box.delete(array.get(vol_bars, x))
box.delete(array.get(vol_bars, x + cnum))
array.set(vol_bars, x, box.new(bar_index - bbars + 1,
array.get(levels5, x + 1) - dist,
bar_index - bbars + 1 +
math.round(array.get(volumes, x)),
array.get(levels5, x) + dist,
border_width=0,
bgcolor=x >= down and x <= up ? vup_color :
up_color))
array.set(vol_bars, x + cnum, box.new(bar_index - bbars + 1 +
math.round(array.get(volumes, x)),
array.get(levels5, x + 1) - dist,
bar_index - bbars + 1 +
math.round(array.get(volumes, x)) + math.round(array.get(volumes, x + cnum)),
array.get(levels5, x) + dist,
border_width=0,
bgcolor=x >= down and x <= up ?
vdown_color : down_color))
//Checks if the Current State is an Uptrend or Downtrend for the Trend Panel
up7 = '🟢'
down = '🔴'
oneMTrend = oneMUp ? up7 : down
fiveMTrend = fiveMUp ? up7 : down
fifteenMTrend = fifteenMUp ? up7 : down
thirtyMTrend = thirtyMUp ? up7 : down
oneHTrend = oneHUp ? up7 : down
twoHTrend = twoHUp ? up7 : down
fourHTrend = fourHUp ? up7 : down
weeklyTrend = weeklyUp ? up7 : down
monthlyTrend = monthlyUp ? up7 : down
dailyTrend = dailyUp ? up7 : down
if dashOn
label lemonLabel = label.new(time, close, text='☁️ TABLETA MEGA POWER V3 ☁️' +
'\n━━━━━━━━━━━━━━━━━' + '\n 💵 informacion de mercado 💵' + '\
n━━━━━━━━━━━━━━━━━' + '\n🟡 Volatilidad | ' + str.tostring(percentVol,
'##.##') + '%' + '\n🟡 Volumen | ' + str.tostring(volumeDash,
'##.##') + '\n🟡 RSI | ' + str.tostring(rsiDash, '##.##') + '\n🟡
Sentimiento mercado | ' + totalSentTxt + '\n━━━━━━━━━━━━━━━━━' + '\n 📈
Trend Panel ━
' + '\n━━━━━━━━━━━━━━━━ ' + '\n 1 Minute | ' + oneMTrend + '
2 Hour | ' + twoHTrend + '\n 5 Minute | ' + fiveMTrend + ' 4 Hour | ' +
fourHTrend + '\n 15 Minute | ' + fifteenMTrend + ' Weekly | ' +
weeklyTrend + '\n 30 Minute | ' + thirtyMTrend + ' Monthly | ' +
monthlyTrend + '\n 1 Hour | ' + oneHTrend + ' Daily | ' +
dailyTrend + '\n━━━━━━━━━━━━━━━━━' + '\n 🔱CRIPTOM4N 🔱',
color=dashColor, xloc=xloc.bar_time, style=label.style_label_left,
textcolor=dashTextColor, textalign=text.align_left)
// Inputs EMA
src = input(close, title='Tipo EMA')
len = input.int(minval=1, defval=200, title='EMA 200')
ema_color = input(color.rgb(255, 242, 0), title="Color de la EMA") // Nuevo input
para el color de la EMA
// Cálculo
ema = ta.ema(src, len)
// Determinación de señales
long = close > ema
short = close < ema
//
ShowPAC = input(false, title='Show EMA Wave')
ShowBarColor = input(true, title='Show Coloured GRaB Candles')
// Colour bars according to the close position relative to the PAC selected.
bColour = close >= open ? close >= pacHi ? lime100 : close <= pacLo ? red100 :
aqua100 : close >= pacHi ? green100 : close <= pacLo ? darkred100 : blue100
barcolor(ShowBarColor ? bColour : na, title='Bar Colours')
//@version=5
indicator("NOSTRADAMUS"
, overlay = true
, max_labels_count = 500
, max_lines_count = 500
, max_boxes_count = 500
, max_bars_back = 500)
//
===================================================================================
====
// MODULO DE SEÑALES PARA MEGA POWER
//
===================================================================================
====
indicator_name = "Simplealgo.io - MEGAPOWER "
//
===================================================================================
====
changeCond = bull or bear //NECESARIO PARA EL MODULO DE TPS
//
===================================================================================
====
numTP_tip = " Number of Take Profit Levels, min 1 max 10 / Número de niveles de
toma de ganancias, mínimo 1 máximo 10 "
numTP = input.int(3, "Number of Take Profit Levels 🎱", minval=1, maxval=5,tooltip
=numTP_tip ,group=groupEnTpSl)
trigger = bull ? 1 : 0
atrBand = ta.atr(atrLen) * atrRisk
atrStop = trigger == 1 ? low - atrBand : high + atrBand
if PercentOrATR == "ATR"
atrStop := atrStop
atrSL := atrStop
else
// Lógica para las opciones "PERCENTAGE" y "PREDICTUM"
if PercentOrATR == "PERCENTAGE"
atrStop := Distance_CTp
atrSL := Distance_CSL
else if PercentOrATR == "PREDICTUM"
atrStop := Distance_CTpre // Ajusta según tu lógica específica para
"PREDICTUM"
atrSL := Distance_CSL
//numTP := 8
if trigger
countOfCandles := 0
else
countOfCandles := na(countOfCandles) ? 0 : countOfCandles + 1
//ENTRADA
entry = levels ? label.new(time, close, "ENTRY 🙈 " +
str.tostring(lastTrade(close), decimals), xloc.bar_time, yloc.price, color.rgb(0,
145, 255), label.style_label_left, color.white, size.normal) : na
label.set_x(entry, label.get_x(entry) + math.round(ta.change(time) * lvlDistance))
label.set_y(entry, lastTrade(close))
label.delete(entry[1])
//StopLoss
stop_y = lastTrade(atrSL)
stop = levels ? label.new(time, close, "STOP LOSS : " + str.tostring(stop_y,
decimals), xloc.bar_time, yloc.price, red2, label.style_label_left, color.white,
size.normal) : na
label.set_x(stop, label.get_x(stop) + math.round(ta.change(time) * lvlDistance))
label.set_y(stop, stop_y)
label.delete(stop[1])
plot( stop_y , title="SL" ,editable = false , color = #ffffff00)
linestop = levels and lvlLines ? line.new(bar_index - countOfCandles, stop_y,
bar_index + lvlDistance ,stop_y, xloc.bar_index, extend.none,red2,stylelvl,
width=lvlLinesw ) : na
line.delete(linestop[1]) // Corregido aquí
// FILLING
if filllvlLineson
linefill.new(linestop, lineEntry, color = color.new(color.red, filllvlLines))
//################################################################
tf = timeframe.period
//miSimbolo = ticker.standard(syminfo.tickerid)
//========================================================================
//*********************************************************
// Función para crear TP y líneas by CoMgUnNeR
// ¡Codigo mas simplificado da creditos al autor! me costo bastante.
//*********************************************************
if PercentOrATR == "PREDICTUM"
if level == 1
tp_y := (lastTrade(close) - lastTrade(atrStop)) * level +
lastTrade(close)
else
tp_y := tp_y + (tp_y - lastTrade(close)) * 0.618
if lvlLines
tpLine = line.new(bar_index - countOfCandles, tp_y, bar_index +
lvlDistance, tp_y, xloc.bar_index, extend.none, lineColor, stylelvl,
width=lvlLinesw)
array.push(tpLines, tpLine)
if array.size(tpLines) > numTP
line.delete(array.get(tpLines, 0))
array.shift(tpLines)
if filllvlLineson
if level == 1
tp_y
if PercentOrATR == "PREDICTUM"
if level_info == 1
tp_y2 := (lastTrade(close) - lastTrade(atrStop)) * level_info +
lastTrade(close)
else
tp_y2 := tp_y2 + (tp_y2 - lastTrade(close)) * 0.618
label.delete(lab_buy[1])
//################################################################
//*****************************************************************************
// Module - Max Profit by CoMgUnNeR
//-----------------------------------------
//*********************************************************
//* Module *
//* Max Profit *
//*********************************************************
// Cálculos idea original de CoMgUnNeR
//--------
// Grupo : Opciones del Module INFOBOX
groupmaxprofit_maxpro = "====== Max Profit ======"
// Separación visual
plot(na)
/////////////////////////////////////////////////////////////
// CONFIGURAR LAS ENTRADAS if (buy) if (sell)
/////////////////////////////////////////////////////////////
leverage_maxpro = input.int(title="Leverage x", defval=1, minval=1, maxval=125,
group=groupmaxprofit_maxpro)
levelsmaxpro = input(title='Show Labels Max Profit / Mostrar Etiquetas Max
Profit', defval=false)
yposmaxpro = input.int(title="Y Label Position Max Profit", defval=1, minval=1,
maxval=10)
if (bull)
shortLabel_maxpro := na
longHigh_maxpro := high
if levelsmaxpro == true
longLabel_maxpro := label.new(bar_index, high, str.tostring(high),
color=lux_maxpro, textcolor=color.white)
if (bear)
longLabel_maxpro := na
shortLow_maxpro := low
if levelsmaxpro == true
shortLabel_maxpro := label.new(bar_index, low, str.tostring(low),
style=label.style_label_up, color=lux_maxpro, textcolor=color.white)
//*****************************************************************************
//MODO FACIL SIN PERSONALIZACION
//import protradingart/pta_plot/6 as pp
//pp.peakprofit(buy, sell)
//https://www.tradingview.com/script/Bcm0mGop-pta-plot/
//Instruction: Don't forget to add ,max_labels_count=500, max_bars_back=500
//*****************************************************************************
//
//SETTINGS
//
// INDICATOR SETTINGS
swing_length = input.int(10, title = 'Swing High/Low Length', group = 'Settings',
minval = 1, maxval = 50)
history_of_demand_to_keep = input.int(20, title = 'History To Keep', minval = 5,
maxval = 50)
box_width = input.float(2.5, title = 'Supply/Demand Box Width', group = 'Settings',
minval = 1, maxval = 10, step = 0.5)
//
//END SETTINGS
//
//
//FUNCTIONS
//
else if swing_type == -1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HL'
else
label_text := 'LL'
label.new(bar_index - swing_length, array.get(array,0), text = label_text,
style=label.style_label_up, textcolor = swing_type_color, color =
color.new(swing_type_color, 100), size = size.tiny)
atr_threshold = atr * 2
okay_to_draw = true
for i = 0 to array.size(box_array) - 1
top = box.get_top(array.get(box_array, i))
bottom = box.get_bottom(array.get(box_array, i))
poi = (top + bottom) / 2
if box_type == 1
box_top := array.get(value_array, 0)
box_bottom := box_top - atr_buffer
poi := (box_top + box_bottom) / 2
else if box_type == -1
box_bottom := array.get(value_array, 0)
box_top := box_bottom + atr_buffer
poi := (box_top + box_bottom) / 2
//delete oldest box, and then create a new box and add it to the array
if box_type == 1 and okay_to_draw
box.delete( array.get(box_array, array.size(box_array) - 1) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right =
box_right, bottom = box_bottom, border_color = supply_outline_color,
bgcolor = supply_color, extend = extend.right, text = 'SUPPLY',
text_halign = text.align_center, text_valign = text.align_center, text_color =
poi_label_color, text_size = size.small, xloc = xloc.bar_index))
if zone_type == 1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_top(array.get(box_array,i))
// if ta.crossover(close, level_to_break)
if close >= level_to_break
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
mid = (box.get_top(array.get(box_array,i)) +
box.get_bottom(array.get(box_array,i))) / 2
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.set_extend( array.get(bos_array,0), extend.none)
box.set_right( array.get(bos_array,0), bar_index)
box.set_text( array.get(bos_array,0), 'BOS' )
box.set_text_color( array.get(bos_array,0), bos_label_color)
box.set_text_size( array.get(bos_array,0), size.small)
box.set_text_halign( array.get(bos_array,0), text.align_center)
box.set_text_valign( array.get(bos_array,0), text.align_center)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
if zone_type == -1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_bottom(array.get(box_array,i))
// if ta.crossunder(close, level_to_break)
if close <= level_to_break
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
mid = (box.get_top(array.get(box_array,i)) +
box.get_bottom(array.get(box_array,i))) / 2
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.set_extend( array.get(bos_array,0), extend.none)
box.set_right( array.get(bos_array,0), bar_index)
box.set_text( array.get(bos_array,0), 'BOS' )
box.set_text_color( array.get(bos_array,0), bos_label_color)
box.set_text_size( array.get(bos_array,0), size.small)
box.set_text_halign( array.get(bos_array,0), text.align_center)
box.set_text_valign( array.get(bos_array,0), text.align_center)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
for i = 0 to array.size(box_array) - 1
box.set_right(array.get(box_array, i), bar_index + 100)
//
//END FUNCTIONS
//
//
//CALCULATIONS
//
// CALCULATE ATR
atr = ta.atr(50)
f_extend_box_endpoint(current_supply_box)
f_extend_box_endpoint(current_demand_box)
//ZIG ZAG
h = ta.highest(high, swing_length * 2 + 1)
l = ta.lowest(low, swing_length * 2 + 1)
f_isMin(len) =>
l == low[len]
f_isMax(len) =>
h == high[len]
f_drawLine() =>
_li_color = show_zigzag ? zigzag_color : color.new(#ffffff,100)
line.new(timeHigh - swing_length, lastHigh, timeLow - swing_length, lastLow,
xloc.bar_index, color=_li_color, width=2)
if dirUp
if f_isMin(swing_length) and low[swing_length] < lastLow
lastLow := low[swing_length]
timeLow := bar_index
line.delete(li)
li := f_drawLine()
li
if not dirUp
if f_isMax(swing_length) and high[swing_length] > lastHigh
lastHigh := high[swing_length]
timeHigh := bar_index
line.delete(li)
li := f_drawLine()
li
if f_isMin(swing_length) and low[swing_length] < lastHigh
lastLow := low[swing_length]
timeLow := bar_index
dirUp := true
li := f_drawLine()
if f_isMax(swing_length) and high[swing_length] > lastLow
lastHigh := high[swing_length]
timeHigh := bar_index
dirUp := false
li := f_drawLine()
li
// if barstate.islast
// label.new(x = bar_index + 10, y = close[1], text =
str.tostring( array.size(current_supply_poi) ))
// label.new(x = bar_index + 20, y = close[1], text =
str.tostring( box.get_bottom( array.get(current_supply_box, 0))))
// label.new(x = bar_index + 30, y = close[1], text =
str.tostring( box.get_bottom( array.get(current_supply_box, 1))))
// label.new(x = bar_index + 40, y = close[1], text =
str.tostring( box.get_bottom( array.get(current_supply_box, 2))))
// label.new(x = bar_index + 50, y = close[1], text =
str.tostring( box.get_bottom( array.get(current_supply_box, 3))))
// label.new(x = bar_index + 60, y = close[1], text =
str.tostring( box.get_bottom( array.get(current_supply_box, 4))))