A simple tool for converting the level of a past candlestick into a dynamic, smoothed level, to better visualise the market structure.
The idea is to be able to select precisely which historical level you wish to track, then smooth it using a moving average.
Features:
// 1 = Open
// 2 = High
// 3 = Low
// 4 = Close
The indicator allows you, in particular, to:
→ identify significant historical levels;
→ smooth levels to reduce market noise;
→ compare two different historical levels;
→ observe the dynamics of a level rather than just its raw price;
→ build custom reference points for intraday trading.
For example:
Close of the -1 candlestick → 10-period EMA
compared to
High of the -3 candlestick → 20-period SMA
This allows you to very quickly create set-ups tailored to your own trading method.
A deliberately simple indicator: no automatic signals, no market interpretation. It provides only customisable reference levels and their smoothed versions, leaving the interpretation and decision-making to the trader
DEFPARAM DrawOnLastBarOnly = False
//==================================================
// NIVEAU 1 - PARAMETRES
//==================================================
nbBougies1 = 1
// 1 = Open
// 2 = High
// 3 = Low
// 4 = Close
typeReference1 = 4
periodeMM1 = 10
// 1 = Simple
// 2 = Exponentielle
// 3 = Weighted
typeMM1 = 1
//==================================================
// NIVEAU 1 - SELECTION
//==================================================
IF typeReference1 = 1 THEN
referenceUn = Open[nbBougies1]
ENDIF
IF typeReference1 = 2 THEN
referenceUn = High[nbBougies1]
ENDIF
IF typeReference1 = 3 THEN
referenceUn = Low[nbBougies1]
ENDIF
IF typeReference1 = 4 THEN
referenceUn = Close[nbBougies1]
ENDIF
//==================================================
// NIVEAU 1 - MM
//==================================================
IF typeMM1 = 1 THEN
niveauUn = Average[periodeMM1](referenceUn)
ENDIF
IF typeMM1 = 2 THEN
niveauUn = ExponentialAverage[periodeMM1](referenceUn)
ENDIF
IF typeMM1 = 3 THEN
niveauUn = WeightedAverage[periodeMM1](referenceUn)
ENDIF
//==================================================
// NIVEAU 2 - PARAMETRES
//==================================================
nbBougiesDeux = 2
// 1 = Open
// 2 = High
// 3 = Low
// 4 = Close
typeReferenceDeux = 2
periodeMMDeux = 10
// 1 = Simple
// 2 = Exponentielle
// 3 = Weighted
typeMMDeux = 1
//==================================================
// NIVEAU 2 - SELECTION
//==================================================
IF typeReferenceDeux = 1 THEN
referenceDeux = Open[nbBougiesDeux]
ENDIF
IF typeReferenceDeux = 2 THEN
referenceDeux = High[nbBougiesDeux]
ENDIF
IF typeReferenceDeux = 3 THEN
referenceDeux = Low[nbBougiesDeux]
ENDIF
IF typeReferenceDeux = 4 THEN
referenceDeux = Close[nbBougiesDeux]
ENDIF
//==================================================
// NIVEAU 2 - MM
//==================================================
IF typeMMDeux = 1 THEN
niveauDeux = Average[periodeMMDeux](referenceDeux)
ENDIF
IF typeMMDeux = 2 THEN
niveauDeux = ExponentialAverage[periodeMMDeux](referenceDeux)
ENDIF
IF typeMMDeux = 3 THEN
niveauDeux = WeightedAverage[periodeMMDeux](referenceDeux)
ENDIF
//==================================================
// AFFICHAGE
//==================================================
RETURN niveauUn AS "Ligne 1", niveauDeux AS "Ligne 2"