OPEN-SOURCE SCRIPT
Directional filter VERSION 2

The idea is to make it more visible if the moment is to seek buying or selling, based on moving averages, being SMA 21 and EMA 9.
best BUYBAR has the EMA9 and SMA21 rising and closing above them. "relevance A"
best SELLBAR has the EMA9 and SMA21 dropping and closing below them. "relevance A"
Conditions for all colors of the candlesticks:
BuyBar A = price closes above EMA9 and SMA21 with EMA9 and SMA21 rising.
BuyBar B = price closes above SMA21 with SMA21 rising OR price closes above EMA9 and SMA21.
BuyBar C = price closes above EMA9 with EMA9 rising and SMA21 falling.
BuyBar Neutral = close> open.
SellBar A = price closes below EMA9 and SMA21 with EMA9 and SMA21 falling.
SellBar B = price closes below SMA21 with SMA21 falling OR price closes below EMA9 and SMA21.
SellBar C = price closes below EMA9 with EMA9 falling and SMA21 rising.
SellBar Neutral = close <open.
The moving averages also change according to the direction in which they are:
EMA 9 up = blue
EMA 9 down = orange
SMA 21 up = green
SMA21 down = red
PT-BR
A idéia é deixar mais visivel se o momento é buscar compra ou venda, se baseando nas médias moveis , sendo elas SMA 21 e EMA 9.
melhor BUYBAR possui a EMA9 e SMA21 subindo e fecha acima delas. "relevância A"
melhor SELLBAR possui a EMA9 e SMA21 caindo e fecha abaixo delas. "relevância A"
Condições para todas as cores dos candlesticks:
BuyBar A = preço fecha acima de EMA9 e SMA21 com EMA9 e SMA21 subindo.
BuyBar B = preço fecha acima de SMA21 com SMA21 subindo OU preço fecha acima de EMA9 e SMA21.
BuyBar C = preço fecha acima de EMA9 com EMA9 subindo e SMA21 caindo.
BuyBar Neutral = fechamento > abertura.
SellBar A = preço fecha abaixo de EMA9 e SMA21 com EMA9 e SMA21 caindo.
SellBar B = preço fecha abaixo de SMA21 com SMA21 caindo OU preço fecha abaixo de EMA9 e SMA21.
SellBar C = preço fecha abaixo de EMA9 com EMA9 caindo e SMA21 subindo.
SellBar Neutral = fechamento < abertura.
As medias moveis também alteram de acordo com a direção em que estão:
EMA 9 subindo = azul
EMA 9 caindo = laranja
SMA 21 subindo = verde
SMA21 caindo = vermelho
best BUYBAR has the EMA9 and SMA21 rising and closing above them. "relevance A"
best SELLBAR has the EMA9 and SMA21 dropping and closing below them. "relevance A"
Conditions for all colors of the candlesticks:
BuyBar A = price closes above EMA9 and SMA21 with EMA9 and SMA21 rising.
BuyBar B = price closes above SMA21 with SMA21 rising OR price closes above EMA9 and SMA21.
BuyBar C = price closes above EMA9 with EMA9 rising and SMA21 falling.
BuyBar Neutral = close> open.
SellBar A = price closes below EMA9 and SMA21 with EMA9 and SMA21 falling.
SellBar B = price closes below SMA21 with SMA21 falling OR price closes below EMA9 and SMA21.
SellBar C = price closes below EMA9 with EMA9 falling and SMA21 rising.
SellBar Neutral = close <open.
The moving averages also change according to the direction in which they are:
EMA 9 up = blue
EMA 9 down = orange
SMA 21 up = green
SMA21 down = red
PT-BR
A idéia é deixar mais visivel se o momento é buscar compra ou venda, se baseando nas médias moveis , sendo elas SMA 21 e EMA 9.
melhor BUYBAR possui a EMA9 e SMA21 subindo e fecha acima delas. "relevância A"
melhor SELLBAR possui a EMA9 e SMA21 caindo e fecha abaixo delas. "relevância A"
Condições para todas as cores dos candlesticks:
BuyBar A = preço fecha acima de EMA9 e SMA21 com EMA9 e SMA21 subindo.
BuyBar B = preço fecha acima de SMA21 com SMA21 subindo OU preço fecha acima de EMA9 e SMA21.
BuyBar C = preço fecha acima de EMA9 com EMA9 subindo e SMA21 caindo.
BuyBar Neutral = fechamento > abertura.
SellBar A = preço fecha abaixo de EMA9 e SMA21 com EMA9 e SMA21 caindo.
SellBar B = preço fecha abaixo de SMA21 com SMA21 caindo OU preço fecha abaixo de EMA9 e SMA21.
SellBar C = preço fecha abaixo de EMA9 com EMA9 caindo e SMA21 subindo.
SellBar Neutral = fechamento < abertura.
As medias moveis também alteram de acordo com a direção em que estão:
EMA 9 subindo = azul
EMA 9 caindo = laranja
SMA 21 subindo = verde
SMA21 caindo = vermelho
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.