Forums › ProRealTime English forum › ProBuilder support › Very Latest John Ehler's Correlation Trend Indicator › Reply To: Very Latest John Ehler's Correlation Trend Indicator
05/04/2020 at 10:09 AM
#129757
For French traders Open office is free
https://www.openoffice.org/fr/
CTI
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 |
// CTI NICO d'après BARD adapté par VONASI 03.05.2020 //Ehler's Correlation Trend Indicator (CTI) //PRC_R-Squared coefficient | indicator //19.09.2018 //Nicolas @ www.prorealcode.com / Bard //Sharing ProRealTime knowledge // --- settings //SPeriod length = 10 perso = 5//Add in Variables //LPeriod lengthL = 40 perso = 30 //Add in Variables // --- end of settings defparam calculateonlastbars = 100 // SHORT Sx = 0 Sy = 0 Sxx = 0 Sxy = 0 Syy = 0 data=customclose for count = 0 to Length -1 do X = Data[count] // the price curve Y = -count // the trend line Sx = Sx + X Sy = Sy + Y Sxx = Sxx + X*X Sxy = Sxy + X*Y Syy = Syy + Y*Y next if(Length*Sxx-Sx*Sx > 0 and Length*Syy-Sy*Sy > 0) then ctiS= (Length*Sxy-Sx*Sy)/sqrt((Length*Sxx-Sx*Sx)*(Length*Syy-Sy*Sy)) endif ////////////////////////////////////////////////////////////// // LONG Sx = 0 Sy = 0 Sxx = 0 Sxy = 0 Syy = 0 data=customclose for count = 0 to LengthL -1 do X = Data[count] // the price curve Y = -count // the trend line Sx = Sx + X Sy = Sy + Y Sxx = Sxx + X*X Sxy = Sxy + X*Y Syy = Syy + Y*Y next if(LengthL*Sxx-Sx*Sx > 0 and LengthL*Syy-Sy*Sy > 0) then ctiL= (LengthL*Sxy-Sx*Sy)/sqrt((LengthL*Sxx-Sx*Sx)*(LengthL*Syy-Sy*Sy)) endif ////////////////////////////////////////////////////////////// //ctiS =((ctiS+1)/2)*100 //ctiL =((ctiS+1)/2)*100 Return ((ctiS+1)/2)*100 style(line,3) as " ctiS ", ((ctiS+1)/2)*100 style (point,3) as " ctiS " ,((ctiL+1)/2)*100 style(line,3) as " ctiL ",((ctiL+1)/2)*100 style(point,3) as " ctiL " , 0 as " zero " , 50 as " 50 " , 100 as " 100 " |