Following a request by @Bard at https://www.prorealcode.com/prorealtime-indicators/pivot-support-resistance-zones/, I made this variation of the same indicator, with EMA bands replacing S&R Pivot segments:
// Pivot Support & Resistance Bands
//
// https://www.prorealcode.com/prorealtime-indicators/pivot-support-resistance-zones/
//
DEFPARAM CalculateOnLastBars = 1000
//p = 2 //2 periods
//Type = 1 //1 = Ema
PivotBAR = 2 //2 bars AFTER pivot
LookBack = 4 //4 bars BEFORE pivot
BarLookBack = PivotBAR + 1
IF low[PivotBAR] < lowest[LookBack](low)[BarLookBack] THEN
IF low[PivotBAR] = lowest[BarLookBack](low) THEN
//MySupport = BarIndex - PivotBAR
SupportPrice = low[PivotBAR]
ENDIF
ENDIF
IF high[PivotBAR] > highest[LookBack](high)[BarLookBack] THEN
IF high[PivotBAR] = highest[BarLookBack](high) THEN
//MyResistance = BarIndex - PivotBAR
ResistancePrice = high[PivotBAR]//high[BarIndex - MyResistance]
ENDIF
ENDIF
EmaResistance = average[p,Type](ResistancePrice)
EmaSupport = average[p,Type](SupportPrice)
MidLine = EmaSupport + ((EmaResistance - EmaSupport) / 2)
//DRAWSEGMENT(MyResistance,ResistancePrice,BarIndex,ResistancePrice) COLOURED(255,0,0,255)
//DRAWSEGMENT(MySupport,SupportPrice,BarIndex,SupportPrice) COLOURED(0,128,0,255)
RETURN EmaResistance COLOURED(255,0,0,255) AS "EmaResistance",EmaSupport COLOURED(0,128,0,255) AS "EmaSupport",MidLine coloured(0,0,0,32) AS "MidLine"
It returns the two bands (Support & Resistance), plus the mean line.
edit posted here https://www.prorealcode.com/prorealtime-indicators/pivot-support-resistance-bands/
bonjour nicolas
je tourne en rond depuis 1 semaine, je cherche a faire apparaître un signal sur les pivots de prt en daily et 1H, j ai besoin de ton expérience et ton savoir, cela est il réalisable en créant un indicateur qui me poserait un signal lorsque la bougie franchie le pivot ou un de ces support ou résistance et close au dessus ou en dessous de celui ci, c est impératif pour les essais que je souhaite réalisé.
rien ne ce perd tout ce transforme et s apprend.
merci à toi….
Hello Nicolas
I have been going around in circles for 1 week, I am trying to make a signal appear on the loan pivots in daily and 1 hour, I need your experience and your knowledge, this can be done by creating an indicator that would give me a signal when the candle crossed the pivot or one of these support or resistance and closed above or below this one, it is imperative for the tests which I wish carried out.
nothing loses everything transforms and learns.
thanks to you….
gregoire – Please follow the forum rules and only post in the language of the forum you are posting in.