Colored Candles Based on Two Indicators

MQL4 Göstergeler Forex

İş tamamlandı

Tamamlanma süresi: 2 gün

Şartname

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.

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(454)
Projeler
718
34%
Arabuluculuk
35
69% / 9%
Süresi dolmuş
22
3%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(35)
Projeler
53
74%
Arabuluculuk
4
50% / 0%
Süresi dolmuş
0
Serbest
3
Geliştirici 3
Derecelendirme
(298)
Projeler
477
40%
Arabuluculuk
105
40% / 24%
Süresi dolmuş
81
17%
Yüklendi
Yayınlandı: 2 kod
4
Geliştirici 4
Derecelendirme
(153)
Projeler
240
34%
Arabuluculuk
20
45% / 30%
Süresi dolmuş
3
1%
Serbest
5
Geliştirici 5
Derecelendirme
(14)
Projeler
14
14%
Arabuluculuk
8
0% / 88%
Süresi dolmuş
2
14%
Yüklendi
6
Geliştirici 6
Derecelendirme
(1)
Projeler
2
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
Yayınlandı: 2 kod
7
Geliştirici 7
Derecelendirme
(184)
Projeler
317
24%
Arabuluculuk
23
35% / 13%
Süresi dolmuş
23
7%
Serbest
Yayınlandı: 3 kod
8
Geliştirici 8
Derecelendirme
(600)
Projeler
694
33%
Arabuluculuk
43
47% / 44%
Süresi dolmuş
12
2%
Yüklendi
9
Geliştirici 9
Derecelendirme
(44)
Projeler
53
38%
Arabuluculuk
8
13% / 38%
Süresi dolmuş
8
15%
Serbest

Proje bilgisi

Bütçe
39+ USD
Son teslim tarihi
from 1 to 5 gün