bonjour
je ne sais pas code mais si quelqu un pouvait me coder un indicateur avec les caracteristiques suivantes :
graphique en journalier
sur nouveau panneau
prix superieur au supertrend mensuel, hebdo, journalier en bleu fonce
prix superieur au supertrend mensuel, hebdo en bleu moyen
prix superieur au supertrend mensuel en bleu clair
prix inferieur au supertrend mensuel en rouge
prix inferieur au supertrend mensuel, hebdo en rouge
prix inferieur au supertrend mensuel, hebdo, journalier en noir
en barre ou histogramme
je sais pas si ma demande est correcte comprehensible ou faisable; je remercie toute la communaute pour votre ecoute et bienveillance
cordialement benoit le catalan
Voici le code :
// SuperTrend MTF en couleurs
//
// https://www.prorealcode.com/topic/supertrend-en-couleur/
//
// returned histogram values:
// 1 = close above Daily ST
// 3 = close above Daily and Monthly ST
// 5 = close above Daily, Monthly and Weekly ST
//
// -1 = close below Daily ST
// -3 = close below Daily and Monthly ST
// -5 = close below Daily, Monthly and Weekly ST
//
Timeframe(monthly)
mST = Supertrend[3,10]
//
Timeframe(weekly)
wST = Supertrend[3,10]
//
Timeframe(daily)
dST = Supertrend[3,10]
//
Timeframe(default)
AboveM = (close > mST)
BelowM = (close < mST)
//
AboveW = (close > wST)
BelowW = (close < wST)
//
AboveD = (close > dST)
BelowD = (close < dST)
//
Cond = 0
IF AboveD THEN
Cond = 1
IF AboveM THEN
Cond = 3
IF AboveW THEN
Cond = 5
ENDIF
ENDIF
ELSIF BelowD THEN
Cond = -1
IF BelowM THEN
Cond = -3
IF BelowW THEN
Cond = -5
ENDIF
ENDIF
ENDIF
RETURN Cond AS "Condizione ABOVE=1,3,5, BELOW=-1,-3,-5"
Désolé, j’avais oublié les différentes couleurs que vous aviez demandées, voici le code modifié :
// SuperTrend MTF en couleurs
//
// https://www.prorealcode.com/topic/supertrend-en-couleur/
//
// returned histogram values:
// 1 = close above Daily ST
// 3 = close above Daily and Monthly ST
// 5 = close above Daily, Monthly and Weekly ST
//
// -1 = close below Daily ST
// -3 = close below Daily and Monthly ST
// -5 = close below Daily, Monthly and Weekly ST
//
Timeframe(monthly)
mST = Supertrend[3,10]
//
Timeframe(weekly)
wST = Supertrend[3,10]
//
Timeframe(daily)
dST = Supertrend[3,10]
//
Timeframe(default)
AboveM = (close > mST)
BelowM = (close < mST)
//
AboveW = (close > wST)
BelowW = (close < wST)
//
AboveD = (close > dST)
BelowD = (close < dST)
//
Cond = 0
a = 0
r = 0
g = 0
b = 0
IF AboveD THEN
a = 50
r = 0
g = 0
b = 139
Cond = 1
IF AboveM THEN
Cond = 3
a = 160
IF AboveW THEN
Cond = 5
a = 255
ENDIF
ENDIF
ELSIF BelowD THEN
Cond = -1
a = 255
IF BelowM THEN
Cond = -3
a = 255
r = 255
IF BelowW THEN
Cond = -5
a = 255
ENDIF
ENDIF
ENDIF
RETURN Cond AS "Condizione ABOVE=1,3,5, BELOW=-1,-3,-5" style(histogram) coloured(r,g,b,a)