0% found this document useful (0 votes)
22 views2 pages

SR_Rang Trading Indicator Setup

The document defines a trading instrument called 'SR_Rang' with various input parameters for moving averages and signal periods. It includes conditions for buy and sell signals based on the comparison of fast and slow exponential moving averages, along with plotting shapes for these signals. Additionally, it features input groups for color customization and activation keys, along with horizontal lines for various high and low levels over different periods.
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)
22 views2 pages

SR_Rang Trading Indicator Setup

The document defines a trading instrument called 'SR_Rang' with various input parameters for moving averages and signal periods. It includes conditions for buy and sell signals based on the comparison of fast and slow exponential moving averages, along with plotting shapes for these signals. Additionally, it features input groups for color customization and activation keys, along with horizontal lines for various high and low levels over different periods.
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

instrument {

name = 'SR_Rang',
short_name = 'super',

overlay = true
}

MaFast_period = input(7,"Ma Fast period",[Link],1,100,1)


MaValue = input(5,"Ma Value", input.string_selection,[Link])

MaSlow_period = input(25,"Ma Slow period",[Link],1,100,1)

Signal_period = input(5,"Signal period",[Link],1,100,1)

input_group {
"Compra",
colorBuy = input { default = "turquoise", type = [Link] },
visibleBuy = input { default = true, type = input.plot_visibility }
}

input_group {
"Venda",
colorSell = input { default = "turquoise", type = [Link] },
visibleSell = input { default = true, type = input.plot_visibility }
}

local titleValue = inputs[MaValue]

smaFast = ema(titleValue, MaFast_period)

smaSlow = ema(titleValue, MaSlow_period)

buffer1 = smaFast - smaSlow

buffer2 = wma(buffer1, Signal_period)

buyCondition = conditional(buffer1 > buffer2 and buffer1[1] < buffer2[1] and not
(buffer1 < buffer2 and buffer1[1] > buffer2[1]))
buyCondition = conditional(buffer1 > buffer2 and buffer1[1] < buffer2[1])

sellCondition = conditional(buffer1 < buffer2 and buffer1[1] > buffer2[1] and not
(buffer1 > buffer2 and buffer1[1] < buffer2[1]))
sellCondition = conditional(buffer1 < buffer2 and buffer1[1] > buffer2[1] )

plot_shape(
(buyCondition),
"COMPRA",
shape_style.triangleup,
shape_size.huge,
colorBuy,
shape_location.belowbar,
-1,
"R_Buy",
"greenish"
)

plot_shape(
(sellCondition),
"VENDA",
shape_style.triangledown,
shape_size.huge,
colorSell,
shape_location.abovebar,
-1,
"R_Sell",
"reddish"
)
instrument{name="SR_Rang",
icon = 'TEST TRADE',
overlay=true}
method_id = input (1, "", input.string_selection, { "" })
local function a()local
b=make_series()local c=high[2]

if not get_value(c)then
return b end;
local d=high<=c and high[1]<=c and high[3]<=c and high[4]<=c;
b:set(iff(d,c,b[1]))return b end;
local function e()local b=make_series()local c=low[2]if not get_value(c)then return
b end;
local d=low>=c and low[1]>=c and low[3]>=c and low[4]>=c;
b:set(iff(d,c,b[1]))return b end;
input_group{"Color",color=input{default="yellow",type=[Link]},
width=input{default=1,type=input.line_width}}

h=a()l=e()

hline(h,"High",color,high_width)
hline(l,"Low",color,width)
hline(highest(10)[1],"HH10",color,1)hline(lowest(10)[1],"LL10",color,1)
hline(highest(30)[1],"HH30",color,1)
hline(lowest(30)[1],"LL30",color,1)
hline(highest(60)[1],"HH60",color,1)

input_group {
"KEY CHAVE",
Chave_de_Ativacao = input {default = "", type = [Link]}
}
hline(lowest(60)[1],"LL60",color,1)
hline(highest(100)[1],"HH100",color,1)
hline(lowest(100)[1],"LL100",color,1)
hline(highest(150)[1],"HH150",color,1)
hline(lowest(150)[1],"LL150",color,1)
hline(highest(200)[1],"HH200",color,1)
hline(lowest(200)[1],"LL200",color,1)

You might also like