Ultra Algo
Ultra Algo
//...................../´¯¯/)
//...................,/¯.../
//.................../..../
//.............../´¯/'..'/´¯¯`·¸
//.........../'/.../..../....../¨¯\
//..........('(....´...´... ¯~/'..')
//...........\..............'...../
//............\....\.........._.·´
//.............\..............(
//..............\..............\
//----
//---------
// Calculations
src := use_ema_smoother == "Yes" ? ta.ema(src, src_ema_period) : src // Source;
// Plottings
// Alerts
f_ma(malen) =>
float result = 0
if matype == 'EMA'
result := ta.ema(src, malen)
result
if matype == 'SMA'
result := ta.sma(src, malen)
result
result
htf_ma1 = f_ma(ma_len1)
htf_ma2 = f_ma(ma_len2)
htf_ma3 = f_ma(ma_len3)
htf_ma4 = f_ma(ma_len4)
htf_ma5 = f_ma(ma_len5)
htf_ma6 = f_ma(ma_len6)
htf_ma7 = f_ma(ma_len7)
htf_ma8 = f_ma(ma_len8)
htf_ma9 = f_ma(ma_len9)
htf_ma10 = f_ma(ma_len10)
//Volume %
short = ta.ema(volume, 5)
long = ta.ema(volume, 10)
osc = 100 * (short - long) / long
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
at https://mozilla.org/MPL/2.0/
// © divudivu600
//@version = 5
White = #FDFEFE
Black = #000000
Bearish = #e91e62
Bullish = #18e0ff
Strong_Bullish = #2962ff
Bullish2 = #00bedc
Blue1 = #00D4FF
Blue2 = #009BBA
orange = #FF8B00
yellow = #FFFB00
LEZ = #0066FF
purp = #FF33CC
// Colouring
ha_htf = ''
show_ha = input.bool(true, "Show HA Plot/ Market Bias", group="HA Market Bias")
ha_len = input(7, 'Period', group="HA Market Bias")
ha_len2 = input(10, 'Smoothing', group="HA Market Bias")
// Calculations {
o = ta.ema(open, ha_len)
c = ta.ema(close, ha_len)
h1 = ta.ema(high, ha_len)
l1 = ta.ema(low, ha_len)
haclose = tf(ha_htf, (o + h1 + l1 + c) / 4, 0)
xhaopen = tf(ha_htf, (o + c) / 2, 0)
haopen = na(xhaopen[1]) ? (o + c) / 2 : (xhaopen[1] + haclose[1]) / 2
hahigh = math.max(h1, math.max(haopen, haclose))
halow = math.min(l1, math.min(haopen, haclose))
osc_len = 8
sigcolor =
(osc_bias > 0) and (osc_bias >= osc_smooth) ? color.new(Bullish, 35) :
(osc_bias > 0) and (osc_bias < osc_smooth) ? color.new(Bullish2, 75) :
(osc_bias < 0) and (osc_bias <= osc_smooth) ? color.new(Bearish, 35) :
(osc_bias < 0) and (osc_bias > osc_smooth) ? color.new(Bearish, 75) :
na
// }
nsc1 = nsc
nsc2 = nsc + 5
nsc3 = nsc + 10
nsc4 = nsc + 15
nsc5 = nsc + 20
nsc6 = nsc + 25
nsc7 = nsc + 30
nsc8 = nsc + 35
nsv1 = nsv - 5
nsv2 = nsv - 10
nsv3 = nsv - 15
nsv4 = nsv - 20
nsv5 = nsv - 25
nsv6 = nsv - 30
nsv7 = nsv - 35
nsv8 = nsv - 40
ap = hlc3
esa = ta.ema(ap, n1)
di = ta.ema(math.abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * di)
tci = ta.ema(ci, n2)
wt1 = tci
wt2 = ta.sma(wt1, 4)
direction = 0
direction := ta.rising(wt1, reaction_wt) ? 1 : ta.falling(wt1, reaction_wt) ? -1 :
nz(direction[1])
Change_of_direction = ta.change(direction, 1)
pcol = direction > 0 ? Strong_Bullish : direction < 0 ? Bearish : na
rsi = ta.rsi(close,14)
color greengrad = color.from_gradient(rsi, 10, 90, #00ddff, #007d91)
color redgrad = color.from_gradient(rsi, 10, 90, #8b002e, #e91e62)
p1 = plot(wt1, color=#00dbff01)
p2 = plot(wt2, color=#e91e6301)
plot(wt1 - wt2, color=wt2 - wt1 > 0 ? redgrad : greengrad,
style=plot.style_columns)
fill(ob1,ob2,color = #e91e6350)
fill(os1,os2,color = #00dbff50)
BullSale = ta.crossunder(wt1, wt2) and wt1 >= nsc and Buy_sales == true
BearSale = ta.crossunder(wt1, wt2) and Buy_sales == false
Bullishh = ta.crossover(wt1, wt2) and wt1 <= nsv and Sell_sales == true
Bearishh = ta.crossover(wt1, wt2) and Sell_sales == false
f_top_fractal(_src) =>
_src[4] < _src[2] and _src[3] < _src[2] and _src[2] > _src[1] and _src[2] >
_src[0]
f_bot_fractal(_src) =>
_src[4] > _src[2] and _src[3] > _src[2] and _src[2] < _src[1] and _src[2] <
_src[0]
f_fractalize(_src) =>
f_top_fractal(_src) ? 1 : f_bot_fractal(_src) ? -1 : 0
////////////////////////////////////////////////-MISTERMOTA
MOMENTUM-/////////////////////////////////////
source = input(close)
responsiveness = math.max(0.00001, input.float(0.9, minval=0.0, maxval=1.0))
periodd = input(50)
sd = ta.stdev(source, 50) * responsiveness
//momentum := raw_momentum
signal = nz(momentum[1])
trend = math.abs(momentum) <= math.abs(momentum[1])
////////////////////////////////////////////////-GROWING/
FAILING-//////////////////////////////////////////
deltaText=(delta > 0 ? (delta > delta[1]? " MOM > 0 and ▲ Growing, MOM = " +
str.tostring(delta[0], "#.##") :" MOM > 0 and ▼ Falling, MOM = " +
str.tostring(delta[0], "#.##") ) : (delta > delta[1] ? "MOM < 0 and ▲ Growing, MOM
= " + str.tostring(delta[0], "#.##"): " MOM < 0 and ▼ Falling, MOM = " +
str.tostring(delta[0], "#.##")))
oneDay = 24 * 60 * 60 * 1000
barsAhead = 3
tmf = if timeframe.ismonthly
barsAhead * oneDay * 30
else if timeframe.isweekly
barsAhead * oneDay * 7
else if timeframe.isdaily
barsAhead * oneDay
else if timeframe.isminutes
barsAhead * oneDay * timeframe.multiplier / 1440
else if timeframe.isseconds
barsAhead * oneDay * timeframe.multiplier / 86400
else
0
angle(_src) =>
rad2degree = 180 / 3.14159265359 //pi
ang = rad2degree * math.atan((_src[0] - _src[1]) / ta.atr(14))
ang
emae = angle(smoothingLine)
emaanglestat = emae > emae[1] ? "▲ Growing": "▼ Falling"
deltaTextxxx = "MOM MA/ATR angle value is " + str.tostring(emae, "#.##") + "° and
is " + emaanglestat
deltacolorxxx = emae >0 and emae >=emae[1] ? txtcol_grow_above : txtcol_fall_below
// Label
label lpt1 = label.new(time, -30, text=deltaTextxxx[0], color=deltacolorxxx,
xloc=xloc.bar_time, style=label.style_label_left, textcolor=color.white,
textalign=text.align_left, size=size.normal)
label.set_x(lpt1, label.get_x(lpt1) + tmf)
label.delete(lpt1[1])
//...................../´¯¯/)
//...................,/¯.../
//.................../..../
//.............../´¯/'..'/´¯¯`·¸
//.........../'/.../..../....../¨¯\
//..........('(....´...´... ¯~/'..')
//...........\..............'...../
//............\....\.........._.·´
//.............\..............(
//..............\..............\
//----
//---------