Forums › ProRealTime forum Français › Support ProBuilder › Suppression des lignes horizontales › Reply To: Suppression des lignes horizontales
10/29/2019 at 10:44 AM
#111511
Or this one:
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 |
// KAMA50 Period = 50 FastPeriod = 2 SlowPeriod = 30 Fastest = 2 / (FastPeriod + 1) Slowest = 2 / (SlowPeriod + 1) if barindex < Period+1 then Kama=close else Num = abs(close-close[Period]) Den = summation[Period](abs(close-close[1])) ER = Num / Den Alpha = SQUARE(ER *(Fastest - Slowest )+ Slowest) KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1]) endif avg = kama // KAMA50 Period1 = 200 FastPeriod1 = 2 SlowPeriod1 = 30 Fastest1 = 2 / (FastPeriod1 + 1) Slowest1 = 2 / (SlowPeriod1 + 1) if barindex < Period1+1 then Kama200=close else Num1 = abs(close-close[Period1]) Den1 = summation[Period1](abs(close-close[1])) ER1 = Num1 / Den1 Alpha1 = SQUARE(ER1 *(Fastest1 - Slowest1 )+ Slowest1) KAMA200 = (Alpha1 * Close) + ((1 -Alpha1)* Kama200[1]) endif avg1 = kama200 if avg > avg1 then distanceup = abs(avg- avg1) endif if avg < avg1 then distancedown = abs(avg - avg1) endif a = average[50](distanceup) b = average[50](distancedown) bornehaute = avg1 +A bornebasse = avg1 - B actionzone = (kama < bornehaute) and (kama > bornebasse) and (kama200 < bornehaute) and (kama200 > bornebasse) IF actionzone = 0 then bornehaute = bornehaute[1] bornebasse = bornebasse[1] ENDIF //bornehauteintervention = bornehaute and actionzone //bornebasseintervention = bornebasse and actionzone return bornehaute AS "High",bornebasse AS "Low"//bornehauteintervention as "borne haute KAMA", bornebasseintervention as "borne basse KAMA" |