heeger

Color Candles - Didi's Needles setup [HeegerBot]

heeger Updated   
Coloration Indicator based on Didi Aguiar's needle setup.
Indicador de Coloração baseado no setup de agulhadas do Didi Aguiar.

The setup consists of the crossover of three moving averages, along with the analysis of an ascending trend in the ADX and the opening of Bollinger Bands.

The setup involves the crossing of three moving averages, along with the trend analysis in the ADX and the open Bollinger Bands.

The moving averages will be named "Didi Index". We will have the 3-period average as "Fast Average", the 8-period average as "Median Average", and the 20-period average as "Slow Average". When the Fast Average crosses the Median Average, we will have an alert, and when the Slow Average crosses the Median Average, we will have a confirmation. To adjust the Didi Index in the signals, the Median Average was normalized, that is, it will always be equal to 0. For the Slow and Fast Average, we will only consider the percentage difference in relation to the Median Average.
In addition to the moving averages, we analyze whether the ADX is rising, with DI+ above DI- to indicate an uptrend, or if the ADX is rising, with DI- above DI+ to indicate a downtrend. We also check if the Bollinger Bands are open. With these conditions, we will have a Needle.

Now I'm going to detail how I set this up on the indicator and some filters that I inserted for my personal use, along with some additional signals from the setup.

# Needle Alert
Firstly, we have the "Needle Alert" signal. This signal occurs when the Fast Average crosses the Median Average, along with the trend confirmation in the ADX and the opening of the Bollinger Bands. The filter is set at "1", which means we will only consider the needle alert when the percentage difference between the Slow Average and the Median Average is below 1%. This signal can be used as an entry point or to monitor the asset. Let's go through the examples:
• For a "Buy Alert", the Fast Average must cross the Median Average from bottom to top, and the percentage difference between the Slow Average and the Median Average should be less than +1% and greater than 0, as indicated by the Didi Index.
• For a "Sell Alert", the Fast Average must cross the Median Average from top to bottom, and the percentage difference between the Slow Average and the Median Average should be greater than -1% and less than 0, as indicated by the Didi Index.
We also have the alert projection, which serves as a signal to attract attention and monitor the asset. I use a "0.1" filter, which means that the percentage difference between the Fast Average and the Median Average must be equal to or less than 0.1%. Let's look at the example:
• For a "Buy Alert Projection", the Fast Average should be below the Median Average, and the percentage difference between the Fast Average and the Median Average should be greater than -0.1% and less than 0. In addition, the Slow Average should be above the Median Average in the Didi Index.
• For a "Buy Alert Projection", the Fast Average should be below the Median Average, and the percentage difference between the Fast Average and the Median Average should be greater than -0.1% and less than 0. In addition, the Slow Average should be above the Median Average in the Didi Index.

# Needle
After the Needle Alert, we have the Needle Confirmation, which occurs when the Slow Average crosses the Median Average after the alert. This signal is used to enter the operation. Let's divide this signal into two parts:
1. Needle: We use a filter of "3" (adjustable). This means that, to be considered a "Needle", the candle distance between the Alert (crossing of the Fast Average with the Median Average) and the Confirmation (crossing of the Slow Average with the Median Average) must be equal to or less than 3 candles. Also, there needs to be a trend on the ADX and the Bollinger Bands should be open.
2. Queijo Minas Needle (QM): Essentially, it's a Needle that occurs outside of the filter, with a candle distance between the Alert and the Confirmation above "3" candles. A trend on the ADX and open Bollinger Bands are also necessary.
To anticipate the Needle Confirmation, we use the "Needle Projection" signal. This signal has two filters: the "Needle Projection with Alert", set as "0.1%", and the "Needle Projection after the Alert", set as "0.3%".
1. The "Needle Projection with Alert" generates the signal when the "Needle Alert" occurs (crossing of the Fast Average with the Median Average), as long as the difference between the Slow Average and the Median Average is less than 0.1%.
2. The "Needle Projection after the Alert" generates the signal when the Fast Average has already crossed the Median Average, and the difference between the Slow Average and the Median Average should be less than 0.3%.

# BJMA (Spider Woman's Kiss)
There is another variation of the needle called BJMA. Essentially, it occurs when the Fast Average and the Slow Average approach the Median Average (each on one pole), but do not cross the Median and return to where they came from. In this signal, we have two filters: "Delta BJMA previous candle" and "Delta BJMA current candle". Let's see an example:
• Buy BJMA: First, we observe the previous candle, where the Fast Average must be above 0 (above the Median Average) and the percentage difference should be less than 0.02. In relation to the Slow Average, the configuration is the same, but in the negative sense, that is, it should be below 0 and above -0.02. Now, in the current candle, the Fast Average should be above 0 and below 0.05, while the Slow Average should be below 0 and above -0.05.
• Sell BJMA: First, we observe the previous candle, where the Fast Average must be below 0 (below the Median Average) and the percentage difference should be greater than -0.02. In relation to the Slow Average, the configuration is the same, but in the positive sense, that is, it should be above 0 and below 0.02. Now, in the current candle, the Fast Average should be below 0 and above -0.05, while the Slow Average should be above 0 and below 0.05.

Now, let's look at two signals that are commonly used to stay in a position.
# Fake Point
The Fake Point is primarily used to identify retracements before a continuation of the prevailing trend. Typically, it is preceded by a Needle Confirmation or BJMA signal. Here are some examples:
• Fake Sell (Signal to Maintain a Buy Position): The Fast Average crosses the Median from top to bottom (entering the negative pole of the Didi Index), while the Slow Average, which is already below the Median (below 0), continues to decline further, increasing the percentage difference between the Fast and Slow Averages in the negative pole.
• Fake Buy (Signal to Maintain a Sell Position): It is the same as the fake sell scenario but in the positive pole. The Fast Average crosses the Median, entering the positive pole of the Didi Index, while the Slow Average, which was already above the Median, continues to increase the percentage difference with the Median. For example, if the Slow Average was at +1 on the Didi Index, it would now be at +1.3.
There is also another variation of the Fake Breakout that takes into consideration the ADX (Average Directional Index) to confirm the trend direction. In other words, if we have a fake sell signal that suggests a buy position, we want the ADX to indicate a buying trend, and vice versa.

# Bought and Sold
This signal basically checks whether the indicators continue to confirm the previous signals. There are two variations: "Bought/Sold" and "Bought/Sold without Bollinger Bands". Let's see an example:
• Bought: The Didi Index is in the buying position, which means the Fast Average is above the Median Average (above 0), and the Slow Average is below the Median Average. Additionally, the ADX is indicating a buying trend and the Bollinger Bands are open.
• Sold: The Didi Index is in the selling position, which means the Fast Average is below 0 and the Slow Average is above 0. Moreover, the ADX is indicating a selling trend and the Bollinger Bands are open.
• Bought/Sold without Bollinger Bands: It's the same signal, but without considering whether the Bollinger Bands are open or not.
We can also consider the "Bought/Sold" signal based on the Trix and Stochastic, which would be additional confirmations of the movement.
Personally, I do not activate the Bought/Sold signal.

Now we come to signals to exit the position or take partial profits.
# Close
This exit signal is based on the following indicators: ADX, Bollinger Bands, Trix, and Stochastic. We wait for the ADX Kick or the falling ADX, along with the Bollinger Bands closing, and the Trix and Stochastic changing to the opposite side. Let's see some examples:
• Close a Buy: The ADX was in a buying trend (ADX rising and DI+ above DI-), but then the ADX Kick occurs or the ADX starts to fall. In addition, the Bollinger Bands close, and the Trix and Stochastic should switch to the sell signal.
• Close a Sell: The ADX was in a selling trend (ADX rising and DI- above DI+), but then the ADX Kick occurs or the ADX starts to fall. Also, the Bollinger Bands close, and the Trix and Stochastic should switch to the buy signal.
All indicators must provide signals together, but it is not necessary for all to occur in the exact same candle. For example:
1. The ADX Kick may occur, and the Trix and Stochastic switch to the buy signal, but the Bollinger Bands still remain open. In this case, we still do not have the exit signal.
2. In the next candle, the ADX continues to fall (after the Kick), the Trix and Stochastic continue to indicate buying, but this time the Bollinger Bands close. In this case, we have the "Close a Sell" signal.
It is important that all indicators are in accordance with the necessary signals, even if they occur in different candles, in order for the exit signal to be triggered.

# Close with Alert
This signal occurs when the Didi Index switches to the opposite side from where it was, along with a trend on the ADX, provided it's not a fake point. Let's see some examples:
• Close Buy - Sell Alert: Suppose we were in a buy position on the previous candle. In the current candle, the Fast Average crosses the Median Average from top to bottom, and the ADX indicates a sell trend. In this case, we completely close our buy position or make a partial realization.
• Close Sell - Buy Alert: Suppose we were in a sell position on the previous candle. In the current candle, the Fast Average crosses the Median Average from bottom to top, and the ADX indicates a buy trend. In this case, we completely close our sell position or make a partial realization.

# Divergence in Didi Index and Stochastic.
The signal of divergence in the Didi Index and the Stochastic is used to identify situations where there is a divergence in one of these indicators. When identified, a box will be drawn in the region where the divergence occurred. This region is considered an area of conflict or strength.
Depending on the context of the chart, these regions can be used as points for total or partial exit of positions. This happens because there may be a correction of the movement after these divergences occur. In some cases, if there is an ignition candle that breaks through this region, it can be used as a possible entry point into the position, taking advantage of a possible pullback.

It is recommended to wait for the candle to close before considering the signals, as this allows for a more solid confirmation.

---------------------------------------------------------------------------------------------------------------------
Indicador de Coloração baseado no setup de agulhadas do Didi Aguiar.

O setup consiste no cruzamento de 3 médias móveis, juntamente com a análise da tendência no ADX e das bandas de Bollinger abertas.

As médias móveis serão nomeadas "Didi Index". Teremos a média de 3 períodos como "Média Rápida", a média de 8 períodos como "Média Mediana" e a média de 20 períodos como "Média Lenta". Quando a Média Rápida cruzar a Média Mediana, teremos um alerta e, quando a Média Lenta cruzar a Média Mediana, teremos uma confirmação. Para ajustar o Didi Index nos sinais, a Média Mediana foi normalizada, isto é, ela sempre será igual a 0. Para a Média Lenta e a Média Rápida, levaremos em consideração apenas a diferença percentual em relação à Média Mediana.
Além das médias móveis, analisamos se o ADX está em ascensão, com o DI+ acima do DI- para indicar uma tendência de alta, ou se o ADX está subindo, com o DI- acima do DI+ para indicar uma tendência de baixa. Também verificamos se as bandas de Bollinger estão abertas. Com essas condições, teremos uma Agulhada.

Agora vou detalhar como estabeleci isso no indicador e alguns filtros que inseri para o meu uso pessoal, além de alguns sinais adicionais do setup.

# Alerta de Agulhada
Primeiramente, temos o sinal de "Alerta de Agulhada". Este sinal acontece quando a Média Rápida cruza a Média Mediana, junto com a confirmação da tendência no ADX e a abertura das Bandas de Bollinger. O filtro está ajustado em "1", o que significa que só levaremos em consideração o alerta de agulhada quando a diferença percentual entre a Média Lenta e a Média Mediana estiver abaixo de 1%. Esse sinal pode ser utilizado como um ponto de entrada ou para monitorar o ativo. Vamos aos exemplos:
• Para um "Alerta de Compra", a Média Rápida deve cruzar a Média Mediana de baixo para cima, e a diferença percentual entre a Média Lenta e a Média Mediana deve ser menor que +1% e maior que 0, conforme indicado pelo Didi Index.
• Para um "Alerta de Venda", a Média Rápida deve cruzar a Média Mediana de cima para baixo, e a diferença percentual entre a Média Lenta e a Média Mediana deve ser maior que -1% e menor que 0, conforme indicado pelo Didi Index.
Também temos a projeção do alerta, que serve como um sinal para chamar atenção e monitorar o ativo. Eu uso um filtro de "0.1", o que significa que a diferença percentual entre a Média Rápida e a Média Mediana deve ser igual ou menor que 0.1%. Vamos ver o exemplo:
• Para uma "Projeção de Alerta de Compra", a Média Rápida deve estar abaixo da Média Mediana, e a diferença percentual entre a Média Rápida e a Média Mediana deve ser maior que -0.1% e menor que 0. Além disso, a Média Lenta deve estar acima da Média Mediana no Didi Index.
• Para uma "Projeção de Alerta de Compra", a Média Rápida deve estar abaixo da Média Mediana, e a diferença percentual entre a Média Rápida e a Média Mediana deve ser maior que -0.1% e menor que 0. Além disso, a Média Lenta deve estar acima da Média Mediana no Didi Index.

# Agulhada
Após o Alerta de Agulhada, temos a confirmação da Agulhada, que ocorre quando a Média Lenta cruza a Média Mediana após o alerta. Esse sinal é utilizado para entrar na operação. Vamos dividir esse sinal em duas partes:
1. Agulhada: Utilizamos um filtro de "3" (ajustável). Isso significa que, para ser considerada uma "Agulhada", a distância em velas entre o Alerta (cruzamento da Média Rápida com a Média Mediana) e a Confirmação (cruzamento da Média Lenta com a Média Mediana) deve ser igual ou menor que 3 velas. Além disso, é necessário ter uma tendência no ADX e as Bandas de Bollinger devem estar abertas.
2. Agulhada Queijo Minas (QM): Basicamente, é uma agulhada que ocorre fora do filtro, com uma distância em velas entre o Alerta e a Confirmação acima de "3" velas. Também é necessário ter uma tendência no ADX e as Bandas de Bollinger devem estar abertas.
Para antecipar a confirmação da Agulhada, utilizamos o sinal de "Projeção de Agulhada". Esse sinal possui dois filtros: o "Projeção de Agulhada com Alerta", configurado como "0.1%", e o "Projeção de Agulhada após o Alerta", configurado como "0.3%".
1. "Projeção de Agulhada com Alerta" gera o sinal quando ocorre o "Alerta de Agulhada" (cruzamento da Média Rápida com a Média Mediana), desde que a diferença entre a Média Lenta e a Média Mediana seja menor que 0.1%.
2. "Projeção de Agulhada após o Alerta" gera o sinal quando a Média Rápida já cruzou a Média Mediana, e a diferença entre a Média Lenta e a Média Mediana deve ser menor que 0.3%.

# BJMA (Beijo da Mulher Aranha)
Existe uma outra variação da agulhada chamada BJMA. Essencialmente, ocorre quando a Média Rápida e a Média Lenta se aproximam da Média Mediana (cada uma em um polo), mas não cruzam a Mediana e voltam para o lado de onde vieram. Nesse sinal, temos dois filtros: "Delta BJMA vela anterior" e "Delta BJMA vela atual". Vejamos um exemplo:
• BJMA de Compra: Primeiramente, observamos a vela anterior, onde a Média Rápida deve estar acima de 0 (acima da Média Mediana) e a diferença percentual deve ser menor que 0.02. Em relação à Média Lenta, a configuração é a mesma, porém no sentido negativo, ou seja, ela deve estar abaixo de 0 e acima de -0.02. Agora, na vela atual, a Média Rápida deve estar acima de 0 e abaixo de 0.05, enquanto a Média Lenta deve estar abaixo de 0 e acima de -0.05.
• BJMA de Venda: Primeiramente, observamos a vela anterior, onde a Média Rápida deve estar abaixo de 0 (abaixo da Média Mediana) e a diferença percentual deve ser maior que -0.02. Em relação à Média Lenta, a configuração é a mesma, porém no sentido positivo, ou seja, ela deve estar acima de 0 e abaixo de 0.02. Agora, na vela atual, a Média Rápida deve estar abaixo de 0 e acima de -0.05, enquanto a Média Lenta deve estar acima de 0 e abaixo de 0.05.

Agora vamos abordar dois sinais que são normalmente utilizados para manter uma posição.
# Ponto Falso (Fake Point)
O Ponto Falso é usado para identificar uma retração antes de retomar o movimento. Geralmente, ele ocorre após um sinal de Agulhada ou BJMA. Vejamos exemplos:
• Venda Falsa (sinal para manter uma posição de compra): A Média Rápida cruza a Média Mediana de cima para baixo (entrando no polo negativo do Didi Index), enquanto a Média Lenta, que já está abaixo da Média Mediana (abaixo de 0), continua caindo, aumentando assim a diferença percentual entre a Média Lenta e a Média Mediana no polo negativo.
• Compra Falsa (sinal para manter uma posição de venda): O cenário é semelhante, mas no polo positivo. A Média Rápida cruza a Média Mediana, passando para o lado positivo do Didi Index, enquanto a Média Lenta, que já estava acima da Média Mediana, continua aumentando a diferença percentual em relação à Média Mediana. Por exemplo, se a Média Lenta estava em +1 no Didi Index, agora ela está em +1.3.
Também existe uma variação do Ponto Falso em que verificamos se a tendência no ADX está se mantendo na mesma direção. Ou seja, se tivermos uma Venda Falsa (que seria um sinal para permanecermos em uma posição de compra), é importante que o ADX esteja indicando uma tendência de compra, e vice-versa. Dessa forma, consideramos não apenas o cruzamento das médias, mas também a confirmação da tendência no ADX. Essa variação é chamada de Ponto Falso com Tendência (Fake Point with Trend).

# Comprado e Vendido
Esse sinal, essencialmente, verifica se os indicadores estão mantendo a confirmação dos sinais anteriores. Existem duas variações: "Comprado/Vendido" e "Comprado/Vendido sem Bandas de Bollinger". Vejamos um exemplo:
• Comprado: O Didi Index está em compra, o que significa que a Média Rápida está acima da Média Mediana (acima de 0) e a Média Lenta está abaixo da Média Mediana. Além disso, o ADX está indicando uma tendência de compra e as Bandas de Bollinger estão abertas.
• Vendido: O Didi Index está em venda, o que significa que a Média Rápida está abaixo de 0 e a Média Lenta está acima de 0. Além disso, o ADX está indicando uma tendência de venda e as Bandas de Bollinger estão abertas.
• Comprado/Vendido sem Bollinger: É o mesmo sinal, porém sem considerar se as Bandas de Bollinger estão abertas ou não.
Podemos também considerar o "Comprado/Vendido" com base no Trix e no Estocástico, que seriam confirmações adicionais do movimento.
Eu, pessoalmente, não deixo ativado o sinal de Comprado/Vendido.

Agora chegamos aos sinais de saída da posição ou de realização parcial.
# Fechar (Close)
Este sinal de saída baseia-se nos seguintes indicadores: ADX, Bandas de Bollinger, Trix e Estocástico. Aguardamos o Kick do ADX ou o ADX em queda, juntamente com as Bandas de Bollinger se fechando, e o Trix e o Estocástico mudando para o lado oposto. Vamos ver alguns exemplos:
• Fechar uma Compra (Close Buy): O ADX estava em uma tendência de compra (ADX subindo e DI+ acima do DI-), mas em seguida ocorre o Kick do ADX ou o ADX começa a cair. Além disso, as Bandas de Bollinger se fecham e o Trix e o Estocástico devem mudar para o sinal de venda.
• Fechar uma Venda (Close Sell): O ADX estava em uma tendência de venda (ADX subindo e DI- acima do DI+), mas em seguida ocorre o Kick do ADX ou o ADX começa a cair. Além disso, as Bandas de Bollinger se fecham e o Trix e o Estocástico devem mudar para o sinal de compra.
Todos os indicadores devem fornecer os sinais em conjunto, mas não é necessário que todos ocorram exatamente na mesma vela. Por exemplo:
1. Pode ocorrer o Kick do ADX e o Trix e o Estocástico mudarem para o sinal de compra, mas as Bandas de Bollinger ainda permanecerem abertas. Nesse caso, ainda não teremos o sinal de saída.
2. No candle seguinte, o ADX continua caindo (após o Kick), o Trix e o Estocástico continuam indicando compra, mas desta vez as Bandas de Bollinger se fecham. Nesse caso, teremos o sinal de "Fechamento de uma Venda".
É importante que todos os indicadores estejam em conformidade com os sinais necessários, mesmo que ocorram em velas diferentes, para que seja acionado o sinal de saída.

# Fechar com Alerta (Close with Alert)
Esse sinal ocorre quando o Didi Index muda para o lado oposto do que estava, juntamente com uma tendência no ADX, desde que não seja um ponto falso. Vejamos exemplos:
• Fechar Compra - Alerta de Venda: Suponha que estávamos em uma posição de compra no candle anterior. No candle atual, a Média Rápida cruza a Média Mediana de cima para baixo, e o ADX indica uma tendência de venda. Nesse caso, encerramos completamente nossa posição de compra ou realizamos uma realização parcial.
• Fechar Venda – Alerta de Compra: Suponha que estávamos em uma posição de venda no candle anterior. No candle atual, a Média Rápida cruza a Média Mediana de baixo para cima, e o ADX indica uma tendência de compra. Nesse caso, encerramos completamente nossa posição de venda ou realizamos uma realização parcial.

# Divergência no Didi Index e no Estocástico.
O sinal de divergência no Didi Index e no Estocástico é usado para identificar situações onde há uma divergência em um desses indicadores. Quando identificada, uma caixa será desenhada na área onde a divergência ocorreu. Essa área é considerada uma zona de briga ou força.
Dependendo do contexto do gráfico, essas zonas podem ser usadas como pontos de saída total ou parcial das posições. Isso acontece porque pode haver uma correção do movimento após a ocorrência dessas divergências. Em alguns casos, se houver uma vela de ignição que quebre essa zona, ela pode ser usada como um possível ponto de entrada na posição, aproveitando um possível pullback.

É recomendado aguardar o fechamento do candle para levar os sinais em consideração, pois isso permite obter uma confirmação mais sólida.

Release Notes:
Added alerts for each signal.
-------------------------------------------------
Adicionado alertas para cada sinal.
Release Notes:
The options for alerts have been added for all enabled signals, along with the session option to generate the alert only within the selected session.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Foram incluídas opções de alerta para todos os sinais habilitados, bem como a capacidade de definir um alerta para ser acionado somente durante a sessão selecionada.
Release Notes:
Melhorias nos textos das notificações.
--------------------------------------------------------------
Small adjustments to the alert texts.
Release Notes:
Fixed minor bugs related to alert generation.
--------------------------------------------------------------
Realizada correção em pequenos bugs relacionados à geração de alertas.
Release Notes:
Minor corrections in the alerts.
Release Notes:
Added 'Buy and Sell' filtered option. This option will only trigger a signal (color the candle) when Bollinger Bands are open, ADX is trending and above 32, and Didi is bought or sold, provided that the dominant average is rising.
------------------------------------------------------------------------------------------
Adicionada a opção "Compra e Venda" filtrada. Essa opção só ativará um sinal (colorirá a vela) quando as Bandas de Bollinger estiverem abertas, o ADX estiver em tendência e acima de 32, e o Didi estiver comprado ou vendido, desde que a média dominante esteja em alta.
Release Notes:
  • Fine-tuned the buy and sell signals for greater accuracy.
  • Optimized signals to reduce false positives, increasing reliability.
  • Implemented a new filter to minimize the impact of noise on signals, aiming for clearer analysis.
---------------------------------------------------------------------------------------------------------------
  • Ajustes finos nos sinais de compra e venda para maior precisão.
  • Otimização dos sinais para reduzir pontos falsos, aumentando a confiabilidade.
  • Implementação de um novo filtro para minimizar o impacto do ruído nos sinais, visando uma análise mais clara.
Release Notes:
Minor fixes were made to the Alerts system
-------------------------------------------------------------------------
Pequenas correções foram feitas no sistema de Alertas

Receba alertas no discord de entrada e saida do trade com base no setup do Didi Aguiar - heegerbot.com
discord.gg/FKtVgSSTCS

Receive trade entry and exit alerts based on Didi Aguiar's setup - heegerbot.com
discord.gg/FKtVgSSTCS
Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact heeger for more information, or follow the author's instructions below.

TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases you can find a good open-source alternative for free in our Community Scripts.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Author's instructions

Acesso exclusivo para assinantes do site heegerbot.com Exclusive access for heegerbot.com subscribers

Want to use this script on a chart?

Warning: please read before requesting access.