Forums › ProRealTime forum Français › Support ProBuilder › Moyenne des 5 derniers changements de direction de la moyenne du Guppy › Reply To: Moyenne des 5 derniers changements de direction de la moyenne du Guppy
08/01/2021 at 8:41 PM
#174533
Voilà
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 |
defparam DRAWONLASTBARONLY=true a = close c1 = ExponentialAverage[3](a) c2 = ExponentialAverage[5](a) c3 = ExponentialAverage[8](a) c4 = ExponentialAverage[10](a) c5 = ExponentialAverage[12](a) c6 = ExponentialAverage[15](a) GuppyCTMoy = (c1 + c2 + c3 + c4 + c5 + c6)/6 c7 = ExponentialAverage[30](a) c8 = ExponentialAverage[35](a) c9 = ExponentialAverage[40](a) c10 = ExponentialAverage[45](a) c11 = ExponentialAverage[50](a) c12 = ExponentialAverage[60](a) GuppyLTMoy = (c7 + c8 + c9 + c10 + c11 + c12)/6 Ecart = (GuppyCTMoy - GuppyLTMoy) T1 = c7 - C7[1] T2 = c8 - C8[1] T3 = c9 - C9[1] T4 = C10 - C10[1] T5 = c11 - C11[1] T6 = c12 - c12[1] Guppy = (T1 + T2 + T3 + T4 + T5 + T6)/6 GuppyMoy = average[20](Guppy)*10 if GuppyMoy<GuppyMoy[1] and GuppyMoy[1]>GuppyMoy[2] and GuppyMoy[1]>0 then ch5=ch4 ch4=ch3 ch3=ch2 ch2=ch1 ch1=GuppyMoy[1] chmoy=(ch1+ch2+ch3+ch4+ch5)/5 endif if ch5<>0 then DRAWHLINE(chmoy) endif if GuppyMoy>GuppyMoy[1] and GuppyMoy[1]<GuppyMoy[2] and GuppyMoy[1]<0 then cb5=cb4 cb4=cb3 cb3=cb2 cb2=cb1 cb1=GuppyMoy[1] cbmoy=(cb1+cb2+cb3+cb4+cb5)/5 endif if cb5<>0 then DRAWHLINE(cbmoy) endif Return ecart as "ecart", guppymoy as "guppymoy" |