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

Indicador Nordic

This document defines an indicator for a trading strategy that uses the exponential moving average (EMA) and simple moving average (SMA) to generate buy and sell signals. It sets input parameters for the EMA and SMA periods. It calculates the EMA and SMA values, defines buy and sell conditions based on a crossover of the EMA and SMA, and plots the signals as up and down triangles on the chart in green and red colors respectively.

Uploaded by

Murilo Barbosa
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)
125 views2 pages

Indicador Nordic

This document defines an indicator for a trading strategy that uses the exponential moving average (EMA) and simple moving average (SMA) to generate buy and sell signals. It sets input parameters for the EMA and SMA periods. It calculates the EMA and SMA values, defines buy and sell conditions based on a crossover of the EMA and SMA, and plots the signals as up and down triangles on the chart in green and red colors respectively.

Uploaded by

Murilo Barbosa
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 = 'Nordic',
short_name = 'Nordic',
icon =
'https://i.pinimg.com/474x/c8/7b/cf/c87bcf1c27a47222f6174f67b729bb83.jpg',
overlay = true
}

EMA_PERIOD = input(3,"EMA Period",input.integer,1,1000,1)


CANDLE_VALUE = input(1,"Candle Value", input.string_selection,inputs.titles)

SMA_AUX_PERIOD = input(6,"SMA Aux Period",input.integer,1,1000,1)

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

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

local candleValue = inputs[CANDLE_VALUE]

-- Moving Average EMA


emaValue = ema(candleValue, EMA_PERIOD)
input_group {
"front.middle line",
middle_line_visible = input { default = true, type = input.plot_visibility },
middle_line_color = input { default = "purple", type = input.color },
middle_line_width = input { default = 1, type = input.line_width }
}

-- Moving Average SMA aux


smaValueAux = sma(candleValue, SMA_AUX_PERIOD)

plot (emaValue, "Middle", middle_line_color, middle_line_width)


plot(smaValueAux, "Middle", middle_line_color, middle_line_width)

BUY_CONDITION = conditional((emaValue > smaValueAux and emaValue > smaValueAux[1])


and (emaValue[1] < smaValueAux and emaValue[1] < smaValueAux[1]))
SELL_CONDITION = conditional((emaValue < smaValueAux and emaValue < smaValueAux[1])
and (emaValue[1] > smaValueAux and emaValue[1] > smaValueAux[1]))

plot_shape(
(BUY_CONDITION),
"CALL",
shape_style.triangleup,
shape_size.auto,
colorBuy,
shape_location.belowbar,
0,
"CALL",
"green"
)
plot_shape(
(SELL_CONDITION),
"PUT",
shape_style.triangledown,
shape_size.auto,
colorSell,
shape_location.abovebar,
0,
"PUT",
"red"
)

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