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

Script Futuro

The document defines an indicator script with input parameters to calculate moving averages and generate buy and sell signals. It takes in fast and slow moving average periods, a signal period, and color options. It calculates the fast and slow EMAs, their difference and a weighted moving average of the difference to generate buy and sell signals plotted as shapes.

Uploaded by

Daniel Rosa 01
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)
117 views2 pages

Script Futuro

The document defines an indicator script with input parameters to calculate moving averages and generate buy and sell signals. It takes in fast and slow moving average periods, a signal period, and color options. It calculates the fast and slow EMAs, their difference and a weighted moving average of the difference to generate buy and sell signals plotted as shapes.

Uploaded by

Daniel Rosa 01
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/ 2

instrument {

name = 'SCRIPT FUTURO',


short_name = 'super',

overlay = true
}

MaFast_period = input(7,"Ma Fast period",input.integer,1,100,1)


MaValue = input(5,"Ma Value", input.string_selection,inputs.titles)

MaSlow_period = input(25,"Ma Slow period",input.integer,1,100,1)

Signal_period = input(5,"Signal period",input.integer,1,100,1)

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

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

local titleValue = inputs[MaValue]

-- mdia mvel linear rpida


smaFast = ema(titleValue, MaFast_period)

-- mdia mvel linear devagar


smaSlow = ema(titleValue, MaSlow_period)

-- calculo diferencial - serie


buffer1 = smaFast - smaSlow

-- clculo da mdia mvel ponderada - serie


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,
"lll",
"greenish"
)
plot_shape(
(sellCondition),
"VENDA",
shape_style.triangledown,
shape_size.huge,
colorSell,
shape_location.abovebar,
-1,
"lll",
"reddish"
)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy