Very Latest John Ehler's Correlation Trend Indicator
Forums › ProRealTime English forum › ProBuilder support › Very Latest John Ehler's Correlation Trend Indicator
- This topic has 31 replies, 4 voices, and was last updated 4 years ago by supertiti.
-
-
05/03/2020 at 3:22 PM #12959905/03/2020 at 4:59 PM #12961705/03/2020 at 5:31 PM #12961905/03/2020 at 6:45 PM #12962505/03/2020 at 7:49 PM #12963005/04/2020 at 9:26 AM #129741
Hi Bard, you have posted in the library but without the itf file. If I understand well, you want the code from the above post: https://www.prorealcode.com/topic/very-latest-ehlers-correlation-trend-indicator-2/#post-129559 to be featured in the library, right? Thanks.
05/04/2020 at 10:09 AM #129757For French traders Open office is free
https://www.openoffice.org/fr/
CTI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162// 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 settingsdefparam calculateonlastbars = 100// SHORTSx = 0Sy = 0Sxx = 0Sxy = 0Syy = 0data=customclosefor count = 0 to Length -1 doX = Data[count] // the price curveY = -count // the trend lineSx = Sx + XSy = Sy + YSxx = Sxx + X*XSxy = Sxy + X*YSyy = Syy + Y*Ynextif(Length*Sxx-Sx*Sx > 0 and Length*Syy-Sy*Sy > 0) thenctiS= (Length*Sxy-Sx*Sy)/sqrt((Length*Sxx-Sx*Sx)*(Length*Syy-Sy*Sy))endif//////////////////////////////////////////////////////////////// LONGSx = 0Sy = 0Sxx = 0Sxy = 0Syy = 0data=customclosefor count = 0 to LengthL -1 doX = Data[count] // the price curveY = -count // the trend lineSx = Sx + XSy = Sy + YSxx = Sxx + X*XSxy = Sxy + X*YSyy = Syy + Y*Ynextif(LengthL*Sxx-Sx*Sx > 0 and LengthL*Syy-Sy*Sy > 0) thenctiL= (LengthL*Sxy-Sx*Sy)/sqrt((LengthL*Sxx-Sx*Sx)*(LengthL*Syy-Sy*Sy))endif////////////////////////////////////////////////////////////////ctiS =((ctiS+1)/2)*100//ctiL =((ctiS+1)/2)*100Return ((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 "05/04/2020 at 10:25 AM #129778For French traders Open office is free
It is not about cost – it is about convenience for all forum members. ITF files can be saved and then directly imported into anyone’s PRT platform. PNG images when attached can be viewed with just one click. Code inserted into a post can be cut and pasted quickly and easily.
05/06/2020 at 1:59 PM #130232Hi @Supertiti, the Long and Short values need to be different. I added “S” and “L” so it doesn’t read Sx= 0 but Sum”S”x = 0, etc so that it can plot two periods for the CTI.
05/06/2020 at 9:52 PM #130333Hi Nicolas, great, thanks, sorry yes I only posted the new CTI system and Dev Stop itf.
Yes please use the code in the link mentioned:https://www.prorealcode.com/topic/very-latest-ehlers-correlation-trend-indicator-2/#post-129559
Thanks again for your help, always appreciated.
Looking good so far using Juanj’s Machine Learning code on the 5 and 10 period crosses and using ML on the CTI thresholds. About to turn the ML code on the period settings next…
Cheers!05/07/2020 at 11:42 AM #130416Hi @Nicolas, well, after a few hours I can’t get the machine learning (ML) code to work out the best value for the Ehler’s CTI Speriod and Lperiod of this new indicator.
Typically when a ML system won’t work and the code is good (comparing an already working ML system with the non working one using a text-compare website) it’s the settings that the ML code works through — from Starting value to Max value etc — that aren’t working, but I already know a cross over of the 5 period and 10 period CTI are good for long positions and vice versa for shorts. I just want to find out if a 3 and 7 for example are better – I will see this from graphing Value X and Y.
I can get the ML to work on a Ehler’s CTI system that looks for the best ML chosen thresholds of the CTI (graphing of X and Y thresholds in increments of 0.1 plots okay on the variables chart with static CTI periods of 5 and 10, — which work well).
Can you see from the screenshots below what is missing? The ML settings simply ask the ML algo to choose between CTI periods of 1 to 10 days for both the SPeriod short red CTI line and the LPeriod blue CTI line.
Btw, I did re-read the lengthy post: https://www.prorealcode.com/topic/how-do-you-optimise-atr-stops-around-price
again just to be sure I have done everything right in terms of labelling even though this is not a PRT optimisation but a ML algo coded “optimisation.” I hope this isn’t going to bring you out in a cold sweat!? 😅 Cheers!05/07/2020 at 1:11 PM #13043805/07/2020 at 2:23 PM #130452Good morning all,
scale from 0 to 100
I would like to do a screener where:C1 = CTI short [1] < 30
C2 = CTI short crosses over CTI longShort term strategy: when you have the result sell above 95
thank youCTI BARD12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061// CTI BARD//Ehler's Correlation Trend Indicator (CTI) //PRC_R-Squared coefficient | indicator//19.09.2018 //Updated to double Ehler's R2 03/05/2020//Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge// --- settings//LPeriod =40 //Add in Variables perso = 30//SPeriod =10 //Add in Variables perso = 5// --- end of settings///////////////////////////////////////////////////////////////////////////////////////////////////Defparam calculateonlastbars = 100//ShortSumSx = 0 // the price curveSumSy = 0SumSxx = 0SumSxy = 0SumSyy = 0 // the trend linedata=customclosefor count = 0 to SPeriod-1 doX = Data[count] // the price curveY = -count // the trend lineSumSx = SumSx + XSumSy = SumSy + YSumSxx = SumSxx + X*XSumSxy = SumSxy + X*YSumSyy = SumSyy + Y*Ynextif(SPeriod*SumSxx-SumSx*SumSx > 0 and SPeriod*SumSyy-SumSy*SumSy > 0) thenCTIShort = (SPeriod*SumSxy-SumSx*SumSy)/Sqrt((SPeriod*SumSxx-SumSx*SumSx)*(SPeriod*SumSyy-SumSy*SumSy))endif/////////////////////////////////////////////////////////////////////////////////////////////////////LongSumLx = 0SumLy = 0SumLxx = 0SumLxy = 0SumLyy = 0for count = 0 to LPeriod-1 doX = Data[count] // the price curveY = -count // the trend lineSumLx = SumLx + XSumLy = SumLy + YSumLxx = SumLxx + X*XSumLxy = SumLxy + X*YSumLyy = SumLyy + Y*Ynextif(LPeriod*SumLxx-SumLx*SumLx > 0 and LPeriod*SumLyy-SumLy*SumLy > 0) thenCTILong = (LPeriod*SumLxy-SumLx*SumLy)/Sqrt((LPeriod*SumLxx-SumLx*SumLx)*(LPeriod*SumLyy-SumLy*SumLy))endif//return CTIShort style (line,2) as "CTI Short R² Trend" , CTIShort style (point,3) as "CTI Short R² Trend" , CTILong style (line,2) as "CTI Long R² Trend", CTILong style (point,3) as "CTI Long R² Trend" , 0 style (dottedline,2)as "0", -1 as "-1", 1 as "1"// ((ctiShort+1)/2)*100return (( CTIShort +1)/2)*100 style (line,2) as "CTI Short R² Trend" , (( CTIShort +1)/2)*100 style (point,3) as "CTI Short R² Trend" ,(( CTILong +1)/2)*100 style (line,2) as "CTI Long R² Trend", (( CTILong +1)/2)*100 style (point,3) as "CTI Long R² Trend" , 50 style (dottedline,2)as " 50 ", 0 as " 0 ", 100 as " 100 ", 95 as " 95 "05/07/2020 at 3:25 PM #130463Yes, I think so!? Screenshot 2!?
I also tried, as is the normal way to use ML code in a system, with my ValueX and ValueY in the Call line “indicator name” [5, 10] as in: “indicator name” [ValueX and ValueY].
Neither that way or using “indicator name”[SPeriod, L Period] works?05/07/2020 at 6:35 PM #130498Good evening,
I think this screener code is the right one after several tries.
Each will modify the parameters to their liking.
CTI BARD UP screener123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263// CTI BARD UP screener//Ehler's Correlation Trend Indicator (CTI) //PRC_R-Squared coefficient | indicator//19.09.2018 //Updated to double Ehler's R2 03/05/2020//Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge// --- settings//LPeriod =40 //Add in Variables perso = 30//SPeriod =10 //Add in Variables perso = 5// --- end of settings///////////////////////////////////////////////////////////////////////////////////////////////////LPeriod = 30 //Add in Variables perso = 30SPeriod = 5 //Add in Variables perso = 5//ShortSumSx = 0 // the price curveSumSy = 0SumSxx = 0SumSxy = 0SumSyy = 0 // the trend linedata=customclosefor count = 0 to SPeriod-1 doX = Data[count] // the price curveY = -count // the trend lineSumSx = SumSx + XSumSy = SumSy + YSumSxx = SumSxx + X*XSumSxy = SumSxy + X*YSumSyy = SumSyy + Y*Ynextif(SPeriod*SumSxx-SumSx*SumSx > 0 and SPeriod*SumSyy-SumSy*SumSy > 0) thenCTIShort = (SPeriod*SumSxy-SumSx*SumSy)/Sqrt((SPeriod*SumSxx-SumSx*SumSx)*(SPeriod*SumSyy-SumSy*SumSy))endif/////////////////////////////////////////////////////////////////////////////////////////////////////LongSumLx = 0SumLy = 0SumLxx = 0SumLxy = 0SumLyy = 0for count = 0 to LPeriod-1 doX = Data[count] // the price curveY = -count // the trend lineSumLx = SumLx + XSumLy = SumLy + YSumLxx = SumLxx + X*XSumLxy = SumLxy + X*YSumLyy = SumLyy + Y*Ynextif(LPeriod*SumLxx-SumLx*SumLx > 0 and LPeriod*SumLyy-SumLy*SumLy > 0) thenCTILong = (LPeriod*SumLxy-SumLx*SumLy)/Sqrt((LPeriod*SumLxx-SumLx*SumLx)*(LPeriod*SumLyy-SumLy*SumLy))endif// return (( CTIShort +1)/2)*100 style (line,2) as "CTI Short R² Trend" , (( CTIShort +1)/2)*100 style (point,3) as "CTI Short R² Trend" ,(( CTILong +1)/2)*100 style (line,2) as "CTI Long R² Trend", (( CTILong +1)/2)*100 style (point,3) as "CTI Long R² Trend" , 50 style (dottedline,2)as " 50 ", 0 as " 0 ", 100 as " 100 " , 95 as " 95 "c1 = ((ctishort[1]+1)/2)*100[1] < 15c2 = ctishort crosses over ctilongc3 = ((ctiLong+1)/2)*100 < 20SCREENER [c1 and c2 and c3 ] -
AuthorPosts