Forums › ProRealTime forum Français › Support ProBuilder › Please Convert Swing Breakout Sequence to PRORTime › Reply To: Please Convert Swing Breakout Sequence to PRORTime
04/14/2025 at 2:55 PM
#245891
Ici vous avez :
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
//---------------------------------------------// //PRC_Ultimate RSI //version = 0 //14.03.25 //Iván González @ www.prorealcode.com //Sharing ProRealTime knowledge //---------------------------------------------// // inputs //---------------------------------------------// length=14 smotype1=3 src=close smooth=14 smotype2=1 obValue=80 osValue=20 //---------------------------------------------// // Augmented RSI //---------------------------------------------// upper=highest[length](src) lower=lowest[length](src) r=upper-lower d=src-src[1] if upper>upper[1] then diff=r else if lower<lower[1] then diff=-r else diff=d endif endif //---------------------------------------------// // Moving average //---------------------------------------------// if smotype1=1 then num=average[length,1](diff) den=average[length,1](abs(diff)) elsif smotype1=2 then num=average[length,0](diff) den=average[length,0](abs(diff)) elsif smotype1=3 then alpha = 1/length if barindex = length then num = average[length](diff) den = average[length](abs(diff)) else num = alpha*diff + (1-alpha)*num[1] den = alpha*abs(diff) + (1-alpha)*den[1] endif elsif smotype1=4 then num=average[length](average[length](diff)) den=average[length](average[length](abs(diff))) endif arsi=num/den*50+50 //---------------------------------------------// // Signal //---------------------------------------------// if smotype2=1 then signal=average[smooth,1](arsi) elsif smotype2=2 then signal=average[smooth,0](arsi) elsif smotype2=2 then alpha = 1/smooth if barindex = smooth then signal = average[smooth](arsi) else signal = alpha*arsi + (1-alpha)*signal[1] endif elsif smotype1=3 then signal=average[smooth](average[smooth](arsi)) endif //---------------------------------------------// // Plot //---------------------------------------------// if arsi>obvalue then r1=0 g1=255 b1=0 a1=255 a3=0 elsif arsi<osvalue then r3=255 g3=0 b3=0 a3=255 a1=0 else a1=0 a3=0 endif colorbetween(obvalue,arsi,r1,g1,b1,a1*0.3) colorbetween(osvalue,arsi,r3,g3,b3,a3*0.3) //---------------------------------------------// return obValue style(dottedline),osValue style(dottedline),50 style(dottedline), arsi, signal as "Signal line"coloured("orange")style(line,2) |