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

Script American

The document defines a trading indicator script with the following elements: 1) It sets up various moving averages, EMAs and bands to analyze price data on different timeframes. 2) It defines inputs for customizing period lengths and indicator sources. 3) It plots shapes to identify buy and sell signals based on crosses and divergences between the defined indicators.

Uploaded by

Fábio
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)
303 views

Script American

The document defines a trading indicator script with the following elements: 1) It sets up various moving averages, EMAs and bands to analyze price data on different timeframes. 2) It defines inputs for customizing period lengths and indicator sources. 3) It plots shapes to identify buy and sell signals based on crosses and divergences between the defined indicators.

Uploaded by

Fábio
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

instrument {overlay = true,

name = 'SCRIPT Americano',

short_name = 'btsctp',

icon="indicators:ADX"}

sec = security(current_ticker_id, "1m")

sec = security(current_ticker_id, "5m")

sec = security(current_ticker_id, "15m")

smaa = sma(close, '3')

smab = sma(close, '50')

smaao = sma(open, '3')

smabo = sma(open, '50')


plot(smaa, "SMA", smaa_color)
plot(smab, "SMA", smab_color)

emaa = ema(close, '100')

period = input (12, "front.period", input.integer, 1)

source = input (1, "front.ind.source", input.string_selection, inputs.titles)

fn = input (1, "front.newind.average", input.string_selection, averages.titles)

input_group {
"front.newind.barcolors",

up_color = input { default = "#2CAC40", type = input.color },

down_color = input { default = "#DB4931", type = input.color }

}
local sourceSeries = inputs [source]

local averageFunction = averages [fn]

mean = averageFunction (sourceSeries, period)

mad = sourceSeries - mean

rect {
first = 0,

second = mad,

color = mad >= mad [1] and up_color or down_color,

width = 0.4

if

( mad <= 0 and ( mad[1] > mad) and (smaa < smab) and (smaao > smabo) and close <=
emaa ) then

plot_shape(1,

'Bear_Engulfing',

shape_style.diamond,

shape_size.huge,"yellow",

shape_location.abovebar,

0,

"Vender","red")

end

if
( mad >= 0 and (mad > mad[1]) and (smaa > smab) and close >= emaa and smaao <
smabo)

then

plot_shape(1,

'Bull_Engulfing',

shape_style.diamond,
shape_size.huge,"blue",

shape_location.belowbar,

0,

"Comprar","green")

end

base = sma(open, '17')


high_band = base + (stdev(open, 17) * 2)

low_band = base - (stdev(open, 17) * 2)

media = sma(close, '20')

up_band = media + (stdev(close, 20) * 2.5)

down_band = media - (stdev(close, 20) * 2.5)

expo = ema(close,'100')

plot_shape((open < up_band and high > up_band and close <= up_band and expo >
up_band),

"SELL1",

shape_style.arrowdown,

shape_size.huge,"white",

shape_location.abovebar,

0,

"RETRACE", "white")

plot_shape((open > down_band and low < down_band and close >= down_band and expo <
down_band),

"BUY1",

shape_style.arrowup,

shape_size.huge,"white",

shape_location.belowbar,

0,

"RETRACAO", "white")

plot_shape((open > high_band and close < high_band),


"Vender",

shape_style.diamond,

shape_size.little,"yellow",

shape_location.abovebar,

0,

"Forte Venda","red")
plot_shape((open < low_band and close > low_band),

"Comprar",

shape_style.diamond,

shape_size.little,"blue",

shape_location.belowbar,

0,

"Forte Compra","green")

You might also like