Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF Syntax Error Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ErinAnn
Posted : Thursday, May 27, 2010 10:38:35 AM
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
StockGuy
Posted : Thursday, May 27, 2010 11:50:11 AM

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.

diceman
Posted : Thursday, May 27, 2010 11:57:43 AM
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
diceman
Posted : Thursday, May 27, 2010 11:59:51 AM
Registered User
Joined: 1/28/2005
Posts: 6,049
For the record mine didnt work on symbol MEE as a custom indicator.


Thanks
diceman
 
ErinAnn
Posted : Thursday, May 27, 2010 1:32:50 PM
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
diceman
Posted : Thursday, May 27, 2010 2:31:10 PM
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
ErinAnn
Posted : Thursday, May 27, 2010 2:37:16 PM
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
StockGuy
Posted : Thursday, May 27, 2010 2:54:15 PM

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,648 time(s).

ErinAnn
Posted : Thursday, May 27, 2010 3:32:50 PM
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

diceman
Posted : Thursday, May 27, 2010 3:56:27 PM
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
ErinAnn
Posted : Thursday, May 27, 2010 5:34:22 PM
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
StockGuy
Posted : Thursday, May 27, 2010 5:36:45 PM

Administration

Joined: 9/30/2004
Posts: 9,187
Mine shows updated through 05/27/2010 17:35
ErinAnn
Posted : Thursday, May 27, 2010 6:49:48 PM
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
ErinAnn
Posted : Friday, May 28, 2010 12:11:33 PM
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
StockGuy
Posted : Friday, May 28, 2010 12:17:46 PM

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.
ErinAnn
Posted : Friday, May 28, 2010 12:48:30 PM
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
StockGuy
Posted : Friday, May 28, 2010 12:52:47 PM

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.
ErinAnn
Posted : Friday, May 28, 2010 1:06:03 PM
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

bustermu
Posted : Friday, May 28, 2010 6:14:26 PM
Registered User
Joined: 1/1/2005
Posts: 2,645
Erin,

The PCF is an ill-fated attempt to determine, on a 5-Day 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 5-Day charts. 

Thanks,
Jim Murphy
ErinAnn
Posted : Friday, May 28, 2010 11:22:27 PM
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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.