Colored Candles Based on Two Indicators

MQL4 Indicadores Forex

Trabalho concluído

Tempo de execução 2 dias

Termos de Referência

I need an indicator for MT4 that combines the logic of the SuperTrend and Donchian Trend Ribbon indicator. The indicator should color the candles based on the following rules:


SpringGreen: When both indicators are in Buy/Uptrend mode.

Crimson Red: When both indicators are in Sell/Downtrend mode.

Dark Gray: When the indicators disagree (one is Buy, the other is Sell).


The SuperTrend indicator (the primary signal) is always in either Uptrend or Downtrend mode—there is never a “neutral” state.

Therefore, at every candle close, the chart will always display either “Uptrend” or “Downtrend” as the current SuperTrend status. While the Donchian indicator is not yet aligned with the SuperTrend (i.e., the two indicators arein opposite directions), the candles should be colored dark gray and the message should remain “Uptrend” or “Downtrend” (matching the SuperTrend’s current state).


Only when both indicators are aligned in the same direction (both Uptrend or both Downtrend), the candles change to the corresponding color (SpringGreen for Uptrend, Crimson Red for Downtrend) and the message updates to “Buy Confirmed” or “Sell Confirmed”.


Summary:


At every 1H candle close, display the current SuperTrend state:

If SuperTrend is up, show “Uptrend”

If SuperTrend is down, show “Downtrend”

While SuperTrend and Donchian are not aligned, candles are always dark gray, and the label remains “Uptrend” or “Downtrend”.

When both indicators align, candles switch to the trend color and the label changes to “Buy Confirmed”/“Sell Confirmed”,

This ensures there is never any ambiguity:

The chart always shows “Uptrend” or “Downtrend” as long as there is no confirmation.

Only after confirmation do you show the final message and color.


Last: Add a mini chart/visual box on the main chart showing the candle color changes based on this logic, but applied to 1-minute candles (no messages or alerts needed for this mini chart).


I will provide both reference indicators.

Respondido

1
Desenvolvedor 1
Classificação
(454)
Projetos
718
34%
Arbitragem
35
69% / 9%
Expirado
22
3%
Trabalhando
2
Desenvolvedor 2
Classificação
(35)
Projetos
53
74%
Arbitragem
4
50% / 0%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(298)
Projetos
477
40%
Arbitragem
105
40% / 24%
Expirado
81
17%
Carregado
Publicou: 2 códigos
4
Desenvolvedor 4
Classificação
(153)
Projetos
240
34%
Arbitragem
20
45% / 30%
Expirado
3
1%
Livre
5
Desenvolvedor 5
Classificação
(14)
Projetos
14
14%
Arbitragem
8
0% / 88%
Expirado
2
14%
Carregado
6
Desenvolvedor 6
Classificação
(1)
Projetos
2
0%
Arbitragem
1
0% / 100%
Expirado
0
Livre
Publicou: 2 códigos
7
Desenvolvedor 7
Classificação
(184)
Projetos
317
24%
Arbitragem
23
35% / 13%
Expirado
23
7%
Livre
Publicou: 3 códigos
8
Desenvolvedor 8
Classificação
(600)
Projetos
694
33%
Arbitragem
43
47% / 44%
Expirado
12
2%
Carregado
9
Desenvolvedor 9
Classificação
(44)
Projetos
53
38%
Arbitragem
8
13% / 38%
Expirado
8
15%
Livre

Informações sobre o projeto

Orçamento
39+ USD
Prazo
de 1 para 5 dias