Gold Customer
Joined: 1/24/2005 Posts: 97
|
Can anyone tell me if this smoothed CCI formula from Tradestation is easily convertible to a TC2000-PCF without a lot of coding?:
[LegacyColorValue = true];
input:
Price ((h+l+c)/3),
Length (14),
Scale (245),
LineUpper(100),
LineLower(-100);
plot1(eKamCCI(Price,Length,Scale),"eKamCCI");
plot2(LineUpper,"Upper");
plot3(LineLower,"Lower");
plot4(0,"0");
{ Alert criteria }
if Plot1 crosses over LineLower then
Alert( "CCI crosses over " + NumToStr(LineLower,0) )
else if Plot1 crosses under LineLower then
Alert( "CCI crosses under " + NumToStr(LineLower,0) )
else if Plot1 crosses over LineUpper then
Alert( "CCI crosses over " + NumToStr(LineUpper,0) )
else if Plot1 crosses under LineUpper then
Alert( "CCI crosses under " + NumToStr(LineUpper,0) )
else if Plot1 crosses over 0 then
Alert( "CCI crosses over zero" )
else if Plot1 crosses under 0 then
Alert( "CCI crosses under zero" );
Thanks for any help!
Paul
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
To clarify-I need this as an indicator-maybe PCF was not the right word...
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
That tells you how to plot eKamCCI but doesn't tell you what it is.
Any special smoothing is probably in a function called: eKamCCI
Thanks
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Ok thanks-I found this-maybe this part is what you are talking about?:
Type : Function, Name : eKamCCI
input:
Price (NumericSeries),
Length(NumericSimple),
Scale (NumericSimple);
var:
Sdv(0);
Sdv = StandardDev( Price, Length, 1 );
if Sdv = 0 then
eKamCCI = eKamCCI[1]
else
eKamCCI = ( (Price - AverageFC( Price, Length )) / Sdv ) / 3 * scale;
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
From eKam himself:
"For what its worth, I just came up with this indicator that looks just like CCI, except unlike CCI, it's more bounded within the scale that you specify and does not "over react" as the classical CCI. The default scale value of 245 seem to work rather well.
The idea of this indicator is to measure where price is compared to a simple moving average. I display the measured distance from the moving average in terms of the number of standard deviations. As students of statistics know, three standard deviations is 99% of the population, so I map the number of standard deviation onto the scale range by dividing the standard deviation by 3 and multiplying it by the scale, just to make it easier for those who are used to seeing CCI oscillating in between that range."
So rather than smoothing.
It looks to be CCI in units of standard deviation.
Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Maybe the following Indicator Formula for the eKamCCI?
(H + L + C - AVG(H + L + C, 14)) / SQR(ABS(SUM((H + L + C) ^ 2, 14) - 14 * AVG(H + L + C, 14) ^ 2) / 14) / 3 * 245
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Thanks Diceman-apparently the EKAM version of CCI is not your classical CCI but whatever it is-it is the one indicator I have stuck with through hell or high water for the last 5 years...sometimes the turns are incredibly accurate (with some twists on how to read it)...
BTW it looks like you are on Tradestation under the same screen name?
Thanks for the help!
Paul
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Bruce-thanks-I'll give it a try...I'm glad they got someone as smart as you to do these formulas-that one in particular is WAY above my pay grade Lol...
I'll let you know if it is as good as the EKAM version...
Paul
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Dice-also would you happen to know EKAM? I know he left Tradestation some years ago but it looks like you have bee around there for some years too...I would love to contact him...
Paul
|
|
Registered User Joined: 6/30/2017 Posts: 1,227
|
diceman knows everybody, but I think he got that info from the internet. Google is a beautiful thing...
http://www.trader-online.tk/ELZ/t-i-eKam_CCI.html
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
QUOTE (Savrad)
Dice-also would you happen to know EKAM? I know he left Tradestation some years ago but it looks like you have bee around there for some years too...I would love to contact him...
Paul
No some of those "famous" posters were gone before I even got there.
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
Thanks for that link Uncle.
Ive used that site long ago but thought it was gone.
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Ok I guess EKAM will have to continue to be the mysterious figure who left a ton of great work behind when he left Tradestation...lol-but thanks
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Bruce-I'm getting an error when I insert the indicator formula into the custom pane...says "Formula Error" Missing argument...any thoughts on what that might be?
Paul
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
That formula was written for TC2000 v17. You would need a longer formula for earlier versions of TC2000 such as v7.
(H + L + C - AVGH14 - AVGL14 - AVGC14) / SQR(ABS((H + L + C) ^ 2 + (H1 + L1 + C1) ^ 2 + (H2 + L2 + C2) ^ 2 + (H3 + L3 + C3) ^ 2 + (H4 + L4 + C4) ^ 2 + (H5 + L5 + C5) ^ 2 + (H6 + L6 + C6) ^ 2 + (H7 + L7 + C7) ^ 2 + (H8 + L8 + C8) ^ 2 + (H9 + L9 + C9) ^ 2 + (H10 + L10 + C10) ^ 2 + (H11 + L11 + C11) ^ 2 + (H12 + L12 + C12) ^ 2 + (H13 + L13 + C13) ^ 2 - 14 * (AVGH14 + AVGL14 + AVGC14) ^ 2) / 14) / 3 * 245
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Bruce-thanks for going through all the trouble on that-it looks like a complicated formula. Well, this time there is no formula error so yes it was probably the V7 version issue...
It is a much easier read on Tradestation-the CCI grid lines at the 3,86,245 settings I use on Tradestation are impeccable on the turn but the readings on the v-7 dont even line up the same but I'm not sure that is fixable...
Thanks for your help!
Paul
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Where are the gridlines?
Try checking the following formula for TC2000 v7 to see if it has the same or similar turns. I changed the settings from 3,14,245 to 3,86,245 (or at least my interpretation of those settings - no guarantees).
(H + L + C - AVGH85 - AVGL85 - AVGC85) / SQR(ABS((H + L + C) ^ 2 + (H1 + L1 + C1) ^ 2 + (H2 + L2 + C2) ^ 2 + (H3 + L3 + C3) ^ 2 + (H4 + L4 + C4) ^ 2 + (H5 + L5 + C5) ^ 2 + (H6 + L6 + C6) ^ 2 + (H7 + L7 + C7) ^ 2 + (H8 + L8 + C8) ^ 2 + (H9 + L9 + C9) ^ 2 + (H10 + L10 + C10) ^ 2 + (H11 + L11 + C11) ^ 2 + (H12 + L12 + C12) ^ 2 + (H13 + L13 + C13) ^ 2 + (H14 + L14 + C14) ^ 2 + (H15 + L15 + C15) ^ 2 + (H16 + L16 + C16) ^ 2 + (H17 + L17 + C17) ^ 2 + (H18 + L18 + C18) ^ 2 + (H19 + L19 + C19) ^ 2 + (H20 + L20 + C20) ^ 2 + (H21 + L21 + C21) ^ 2 + (H22 + L22 + C22) ^ 2 + (H23 + L23 + C23) ^ 2 + (H24 + L24 + C24) ^ 2 + (H25 + L25 + C25) ^ 2 + (H26 + L26 + C26) ^ 2 + (H27 + L27 + C27) ^ 2 + (H28 + L28 + C28) ^ 2 + (H29 + L29 + C29) ^ 2 + (H30 + L30 + C30) ^ 2 + (H31 + L31 + C31) ^ 2 + (H32 + L32 + C32) ^ 2 + (H33 + L33 + C33) ^ 2 + (H34 + L34 + C34) ^ 2 + (H35 + L35 + C35) ^ 2 + (H36 + L36 + C36) ^ 2 + (H37 + L37 + C37) ^ 2 + (H38 + L38 + C38) ^ 2 + (H39 + L39 + C39) ^ 2 + (H40 + L40 + C40) ^ 2 + (H41 + L41 + C41) ^ 2 + (H42 + L42 + C42) ^ 2 + (H43 + L43 + C43) ^ 2 + (H44 + L44 + C44) ^ 2 + (H45 + L45 + C45) ^ 2 + (H46 + L46 + C46) ^ 2 + (H47 + L47 + C47) ^ 2 + (H48 + L48 + C48) ^ 2 + (H49 + L49 + C49) ^ 2 + (H50 + L50 + C50) ^ 2 + (H51 + L51 + C51) ^ 2 + (H52 + L52 + C52) ^ 2 + (H53 + L53 + C53) ^ 2 + (H54 + L54 + C54) ^ 2 + (H55 + L55 + C55) ^ 2 + (H56 + L56 + C56) ^ 2 + (H57 + L57 + C57) ^ 2 + (H58 + L58 + C58) ^ 2 + (H59 + L59 + C59) ^ 2 + (H60 + L60 + C60) ^ 2 + (H61 + L61 + C61) ^ 2 + (H62 + L62 + C62) ^ 2 + (H63 + L63 + C63) ^ 2 + (H64 + L64 + C64) ^ 2 + (H65 + L65 + C65) ^ 2 + (H66 + L66 + C66) ^ 2 + (H67 + L67 + C67) ^ 2 + (H68 + L68 + C68) ^ 2 + (H69 + L69 + C69) ^ 2 + (H70 + L70 + C70) ^ 2 + (H71 + L71 + C71) ^ 2 + (H72 + L72 + C72) ^ 2 + (H73 + L73 + C73) ^ 2 + (H74 + L74 + C74) ^ 2 + (H75 + L75 + C75) ^ 2 + (H76 + L76 + C76) ^ 2 + (H77 + L77 + C77) ^ 2 + (H78 + L78 + C78) ^ 2 + (H79 + L79 + C79) ^ 2 + (H80 + L80 + C80) ^ 2 + (H81 + L81 + C81) ^ 2 + (H82 + L82 + C82) ^ 2 + (H83 + L83 + C83) ^ 2 + (H84 + L84 + C84) ^ 2 - 85 * (AVGH85 + AVGL85 + AVGC85) ^ 2) / 85) / 3 * 245
The TC2000 v17 formula is quite a bit shorter.
(H + L + C - AVG(H + L + C, 85)) / SQR(ABS(SUM((H + L + C) ^ 2, 85) - 85 * AVG(H + L + C, 85) ^ 2) / 85) / 3 * 245
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Bruce-excellent-that one is vastly improved! I am referring to the Lines on the CCI Indicator (below the chart on the indicator panel) that are usually set at 0, +100, & -100 At first glance it is very close to one I have mocked up on Tradestation. I'll test it over the next few days...BTW when I create a PCF using this can you point me to how I would write the formula if for example I want the CCI to cross under -100 in the last 3 days?
I know this is basic stuff but I have been working primarily with price formulas the past several years-thanks again for all your help on this-that is quite a formula you have written!
Paul
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There isn't going to be a way to add gridlines at -100 and +100 like there is in TC2000 v17.
My best suggestion would be edit the indicator and make sure Center Zero Line is checked. Then at least the center line will be on a value of possible significance. The top and bottom lines are just going to be at 25% and 75% of the way through the entire scale.
You could add lines at 20% and 80% of the scale by adding Stochastics to the same pane or lines at 30% and 70% by adding Wilders's RSI to the same scale. You would probably want to uncheck Visible for these indicators if you decided to try it, but I'm not sure what this would add beyond the lines at 25% and 75% which are already there.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Bruce:
Ok-I'll try that-thanks much!
Paul
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Bruce I checked the CCI readings against the ones on Tradestation and they are very close-so definitely a good stab at the formula, good work!-ok, for the custom "CCI" formula like the one above-can you point me how to create a scan for it with these parameters:
-I want to scan for stocks that have in the last two days crossed below -50 CCI after:
-Being > -50 CCI for the past 35 bars-and:
-For a 7 day period beginning 23 days ago CCI was > +90 and < +150 and:
-CCI for a 20-day period beginning 25 days ago was < -100
Here is a screenshot for URI:
https://www.screencast.com/t/bS4Q4td5
Thanks for any feedback or input for this!
Paul
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Sorry, but these formulas would be way to long and slow to be practical or post in the forums in TC2000 v7 format.
I haven't checked the speed, but at least the formulas would be quite a bit shorter in TC2000 v17 format (not that it helps you).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Ok...is the v17 format the web based one at freestockcharts.com? If not-would I be able to run both versions of the software just so I can use that scan to find the charts on v17 and then I'll just track them on my v7 format?
Paul
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
TC2000 v17 installs on your computer as a native Windows application (similar to TC2000 v7). You should be able to run both TC2000 v17 and TC2000 v7 on the same computer. You can probably even run both programs simultaneously as long as you are not streaming real time data in both programs at the same time.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Thanks Bruce-I'll try it...
Is the v17 CCI version PCF criteria succinct enough for you to take a stab at it?
Thanks for any help!
Paul
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
My interpretation of Smoothed CCI 3, 86, 245 would be the following.
(H + L + C - AVG(H + L + C, 86)) / SQR(ABS(SUM((H + L + C) ^ 2, 86) - 86 * AVG(H + L + C, 86) ^ 2) / 86) / 3 * 245
So checking for this being below -50 for the two most recent bars would be:
TrueInRow((H + L + C - AVG(H + L + C, 86)) / SQR(ABS(SUM((H + L + C) ^ 2, 86) - 86 * AVG(H + L + C, 86) ^ 2) / 86) / 3 * 245 < -50, 2) = 2
Checking for this being greater than -50 for the 35 bars ending 2 bars ago would be:
TrueInRow(TrueInRow((H2 + L2 + C2 - AVG(H2 + L2 + C2, 86)) / SQR(ABS(SUM((H2 + L2 + C2) ^ 2, 86) - 86 * AVG(H2 + L2 + C2, 86) ^ 2) / 86) / 3 * 245 > -50, 35) = 35
Checking for this being between +90 and +150 for a 7 bar period beginning 23 bars ago (ending 17 bars ago) would be:
TrueInRow(ABS((H17 + L17 + C17 - AVG(H17 + L17 + C17, 86)) / SQR(ABS(SUM((H17 + L17 + C17) ^ 2, 86) - 86 * AVG(H17 + L17 + C17, 86) ^ 2) / 86) / 3 * 245 - 120) <= 30, 7) = 7
Checking for being < -100 for the 20 day period beginning 25 bars ago (ending 6 bars ago) would be:
TrueInRow((H6 + L6 + C6 - AVG(H6 + L6 + C6, 86)) / SQR(ABS(SUM((H6 + L6 + C6) ^ 2, 86) - 86 * AVG(H6 + L6 + C6, 86) ^ 2) / 86) / 3 * 245 < -100, 20) = 20
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 1/24/2005 Posts: 97
|
Diceman-is there any easy way in tradestation to do what I am attempting to do on TC-2000? For example scanning for stocks like: https://www.screencast.com/t/ahoKkbfwmh9 that first dipped below -250 EKAM CCI then popped back above -90 within X # of bars? I am assuming that would have to be done via Radarscreen? but I have done zilch scanning in Easylanguage before-any pointers would be greatly appreciated...
QUOTE (diceman)
From eKam himself:
"For what its worth, I just came up with this indicator that looks just like CCI, except unlike CCI, it's more bounded within the scale that you specify and does not "over react" as the classical CCI. The default scale value of 245 seem to work rather well.
The idea of this indicator is to measure where price is compared to a simple moving average. I display the measured distance from the moving average in terms of the number of standard deviations. As students of statistics know, three standard deviations is 99% of the population, so I map the number of standard deviation onto the scale range by dividing the standard deviation by 3 and multiplying it by the scale, just to make it easier for those who are used to seeing CCI oscillating in between that range."
So rather than smoothing.
It looks to be CCI in units of standard deviation.
Thanks
|
|
Guest-1 |