Registered User Joined: 10/12/2008 Posts: 46

I'm having problems writing a pcf....when I test it, it seems fine, but when I try to update I get a message that there is a syntax error.
((AVGC100 + 2 * SQR((20 * (C * C + C5 * C5 + C10 * C10 + C15 * C15 + C20 * C20 + C25 * C25 + C30 * C30 + C35 * C35 + C40 * C40 + C45 * C45 + C50 * C50 + C55 * C55 + C60 * C60 + C65 * C65 + C70 * C70 + C75 * C75 + C80 * C80 + C85 * C85 + C90 * C90 + C95 * C95)  (AVGC100 * 20) * (AVGC100 * 20)) / (20 * 20)))  (AVGC100  2 * SQR((20 * (C * C + C5 * C5 + C10 * C10 + C15 * C15 + C20 * C20 + C25 * C25 + C30 * C30 + C35 * C35 + C40 * C40 + C45 * C45 + C50 * C50 + C55 * C55 + C60 * C60 + C65 * C65 + C70 * C70 + C75 * C75 + C80 * C80 + C85 * C85 + C90 * C90 + C95 * C95)  (AVGC100 * 20) * (AVGC100 * 20)) / (20 * 20)))) / AVGC100 <= .06
Thank you for your help.....Erin


Administration
Joined: 9/30/2004 Posts: 9,187

I cut and pasted your formula into a PCF and the Test worked. I then calculated the PCF and sorted the All Stocks list and 80 stocks returned True.


Registered User Joined: 1/28/2005 Posts: 6,049

I havnt looked at it in detail but you appear to be taking
the square root of a negitive number.
(so something is wrong with the logic not the syntax)
I would check the logic or remove the SQR's and change the .06 threshold.
Thanks
diceman


Registered User Joined: 1/28/2005 Posts: 6,049

For the record mine didnt work on symbol MEE as a custom indicator.
Thanks
diceman


Registered User Joined: 10/12/2008 Posts: 46

Thanks StockGuy. I still can't get the PCF to calculate. Since you say it's working fine, I don't know what to do. I guess the problem is on my end, but I can't figure out what it would be. I've deleted everything....restarted TC and tried to create it again....but it always gives me a syntax error when I try to calculate.
Diceman, I see your suggestion, but why would StockGuy be able to calculate the formula and I can't. Also, how do you know it's taking a square root of a neg number? I didn't write this PCF.
Thanks for the help....Erin


Registered User Joined: 1/28/2005 Posts: 6,049

I removed the SQR's and it worked.
SQR( ) gives the squareroot of whatever is in the ( ).
Remove the SQR and its just a number. (and can be negitive)
I dont know why it worked for stockguy.
I guess Im seeing the same problem you are.
Thanks
diceman


Registered User Joined: 10/12/2008 Posts: 46

Great Diceman...thanks. But here's a question....that would change the formula, so wouldn't it totally change what it's supposed to be doing? Like I said, I didn't write the formula, but it's supposed to be a formula to find stocks that are in a weekly volatility squeeze less than 6%.
Thanks for the help....Erin


Administration
Joined: 9/30/2004 Posts: 9,187

I'm not sure what's going on. The formula returns True for CNA in the PCF that I'm sorted by and also when I test the Percent True indicastor. However, it does not plot and shows a "Trig error" on the chart.
Attachments: cna.png  120 KB, downloaded 1,584 time(s).


Registered User Joined: 10/12/2008 Posts: 46

StockGuy, I can't even get that far as I can't calculate the PCF. Under my list of PCFs, it says Not Calculated. When I try to calculate, I get the syntax error. Any ideas to get past that step?
Thanks....Erin


Registered User Joined: 1/28/2005 Posts: 6,049

"Great Diceman...thanks. But here's a question....that would change the formula, so wouldn't it totally change what it's supposed to be doing? Like I said, I didn't write the formula, but it's supposed to be a formula to find"
Yes. However it at least points to where the error is.
(in a simple equation it may be as easy as changing the 6%)
When I run this. I get the error message: "Trig error".
(although I put it in the chart as a CI percent true in the top window)
Thanks
diceman


Registered User Joined: 10/12/2008 Posts: 46

Diceman or StockGuy,
When you click on fx, and see your list of pcfs....does it show "calculated" or "not calculated" for the pcf we're working with?
Thanks....Erin


Administration
Joined: 9/30/2004 Posts: 9,187

Mine shows updated through 05/27/2010 17:35


Registered User Joined: 10/12/2008 Posts: 46

Thanks StockGuy. I have no clue what's wrong....mine shows "not calculated"....I can't get it to calculate. I guess I'll try and call customer support tommorrow and see if they can figure it out.
Thanks again....Erin


Registered User Joined: 10/12/2008 Posts: 46

Diceman or StockGuy,
I called customer service and they couldn't help me....they said that there was a problem with the formula.
I got to thinking about what you said Diceman....it was taking the sq root of a negative number....so I decided to try and put in an "absolute" calculation in after the sq root, using ABS....but I'm having problems.
I still get a syntax error and I"m wondering if I'm putting the parenthesis in the wrong place. Any help would be greatly appreciated.
Thanks...Erin


Administration
Joined: 9/30/2004 Posts: 9,187

Mine isn't updating now, either. Got a syntax error when I updated this morning and it still shows updated through yesterday at 17:35.


Registered User Joined: 10/12/2008 Posts: 46

StockGuy,
Do you know how I would add ABS after the SQR? Meaning, where would the right parenthesis go?
I got the left part down, SQR(ABS(
but I don't know where to put the right parenthese. (I don't totally understand the formula.)
Also, there are 2 SQRs in the formula.
Thanks....Erin


Administration
Joined: 9/30/2004 Posts: 9,187

I don't understand the formula either. Where did you get it? Maybe the author should take a look at it.


Registered User Joined: 10/12/2008 Posts: 46

Unfortunately, I have no way to contact the author.
Do you have an formula experts there that could look at this?
Thanks....Erin


Registered User Joined: 1/1/2005 Posts: 2,645

Erin,
The PCF is an illfated attempt to determine, on a 5Day chart, if the Bollinger Bandwidth, Period 20, Standard Deviation 2, is less than or equal to 6%.
The correct PCF is given by Bruce in:
http://forums.worden.com/Default.aspx?g=posts&t=47035
Note: You need to be aware that there are no weekly charts in TeleChart; there are five distinct 5Day charts.
Thanks,
Jim Murphy


Registered User Joined: 10/12/2008 Posts: 46

Bustermu,
You're the best! Thanks so much....you've made my holiday weekend....and it's only Fri night.
Have a great weekend.....Erin


Guest1 