Colored Candles Based on Two Indicators

MQL4 Indicatori Forex

Lavoro terminato

Tempo di esecuzione 2 giorni

Specifiche

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.

Con risposta

1
Sviluppatore 1
Valutazioni
(454)
Progetti
720
34%
Arbitraggio
35
71% / 9%
In ritardo
22
3%
Gratuito
2
Sviluppatore 2
Valutazioni
(35)
Progetti
53
74%
Arbitraggio
4
50% / 0%
In ritardo
0
Gratuito
3
Sviluppatore 3
Valutazioni
(298)
Progetti
478
40%
Arbitraggio
105
40% / 24%
In ritardo
82
17%
Caricato
Pubblicati: 2 codici
4
Sviluppatore 4
Valutazioni
(153)
Progetti
240
34%
Arbitraggio
20
45% / 30%
In ritardo
3
1%
Gratuito
5
Sviluppatore 5
Valutazioni
(14)
Progetti
14
14%
Arbitraggio
8
0% / 88%
In ritardo
2
14%
Caricato
6
Sviluppatore 6
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
(184)
Progetti
317
24%
Arbitraggio
23
35% / 13%
In ritardo
23
7%
Gratuito
Pubblicati: 3 codici
8
Sviluppatore 8
Valutazioni
(611)
Progetti
713
33%
Arbitraggio
45
49% / 42%
In ritardo
14
2%
Occupato
9
Sviluppatore 9
Valutazioni
(44)
Progetti
53
38%
Arbitraggio
8
13% / 38%
In ritardo
8
15%
Gratuito

Informazioni sul progetto

Budget
39+ USD
Scadenze
da 1 a 5 giorno(i)