Forums › ProRealTime foro Español › Soporte ProScreener › Divergencia Bollinger %B › Reply To: Divergencia Bollinger %B
05/07/2024 at 10:05 AM
#232417
hola
Aquí tienes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
N=40 bollUp=BollingerUp[20](close) bollDw=BollingerDown[20](close) Pboll = (close-bolldw)/(bollUp-bollDw )*100 Signal = 0 IF (BarIndex > 10+1+N) THEN ///divergencia bajista IF (Pboll[1]>Pboll AND Pboll[1]>Pboll[2]) THEN extremum2=Pboll[1] extremum1=highest[N](Pboll) preciomax2=close[1] preciomax=Highest[N](close) IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THEN for i=1 to N if Pboll[i]=extremum1 then signal=2 endif next endif endif ///divergencia alcista IF (Pboll[1]<Pboll AND Pboll[1]<Pboll[2]) THEN extremum22=Pboll[1] extremum11=lowest[N](Pboll) preciomin2=close[1] preciomin=lowest[N](close) IF(extremum22>extremum11 AND preciomin2<preciomin[1]) THEN for i2=1 to N if Pboll[i2]=extremum11[1] then signal=1 endif next ENDIF ENDIF endif screener[signal](Signal AS "1=↑, 2=↓") |