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 |

keep getting syntax error in this PCF formula Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
dfarns
Posted : Tuesday, October 20, 2009 6:27:22 PM
Registered User
Joined: 12/11/2008
Posts: 7
I have a formula for AVGC9 < XAVGC40 for 40 days then crosses.  It works fine.  I just tried to increase the 40 days to 60 days.  I copied the 40 day formula to a text editor and added the extra lines to make it 60 days.  It had no visible mistakes.  When I copied it into the Telechart PCF editor and tried to test it, I got the "error in formula syntax" error.  I redid the formula two times and also separated out the 40 to 60 day part and tried each of these in the PCF editor...each time I got the syntax error message.

I then went to the working 40 day formula and, inside the PCF editor, added the lines to make it a 60 day formula, but I stopped at each new 5 day mark and tested it.  It tested ok.  Then I tested the complete 60 day formula and it tested ok.  So I then had Telechart "calculate" the formula so I could use it.  The "calculate" process stopped when it found "syntax errors" in this formula.  I went back into the PCF formula editor and tried the "test" again.  This time is failed with the "error in formula syntax" message.

How can the formula pass the test once, and then fail it after the attempted calculate.  I've checked the entire formula letter by letter and there is nothing obviously wrong.  Below is the formula as copied from the PCF formula editor.  I hope someone can shed some light on this for me...

AVGC9 > XAVGC40  AND
AVGC9.1  <= XAVGC40.1 AND
AVGC9.2 <= XAVGC40.2 AND
AVGC9.3 <= XAVGC40.3 AND
AVGC9.4 <= XAVGC40.4 AND
AVGC9.5 <= XAVGC40.5 AND
AVGC9.6 <= XAVGC40.6 AND
AVGC9.7 <= XAVGC40.7 AND
AVGC9.8 <= XAVGC40.8 AND
AVGC9.9 <= XAVGC40.9 AND
AVGC9.10 <= XAVGC40.10  AND
AVGC9.11 <= XAVGC40.11 AND
AVGC9.12 <= XAVGC40.12 AND
AVGC9.13 <= XAVGC40.13 AND
AVGC9.14 <= XAVGC40.14 AND
AVGC9.15 <= XAVGC40.15 AND
AVGC9.16 <= XAVGC40.16 AND
AVGC9.17 <= XAVGC40.17 AND
AVGC9.18 <= XAVGC40.18 AND
AVGC9.19 <= XAVGC40.19 AND
AVGC9.20 <= XAVGC40.20 AND
AVGC9.21 <= XAVGC40.21 AND
AVGC9.22 <= XAVGC40.22 AND
AVGC9.23 <= XAVGC40.23 AND
AVGC9.24 <= XAVGC40.24 AND
AVGC9.25 <= XAVGC40.25 AND
AVGC9.26 <= XAVGC40.26 AND
AVGC9.27 <= XAVGC40.27 AND
AVGC9.28 <= XAVGC40.28 AND
AVGC9.29 <= XAVGC40.29 AND
AVGC9.30 <= XAVGC40.30 AND
AVGC9.31 <= XAVGC40.31 AND
AVGC9.32 <= XAVGC40.32 AND
AVGC9.33 <= XAVGC40.33 AND
AVGC9.34 <= XAVGC40.34 AND
AVGC9.35 <= XAVGC40.35 AND
AVGC9.36 <= XAVGC40.36 AND
AVGC9.37 <= XAVGC40.37 AND
AVGC9.38 <= XAVGC40.38 AND
AVGC9.39 <= XAVGC40.39 AND
AVGC9.40 <= XAVGC40.40 AND
AVGC9.41 <= XAVGC40.41 AND
AVGC9.42 <= XAVGC40.42 AND
AVGC9.43 <= XAVGC40.43 AND
AVGC9.44 <= XAVGC40.44 AND
AVGC9.45 <= XAVGC40.45 AND
AVGC9.46 <= XAVGC40.46 AND
AVGC9.47 <= XAVGC40.47 AND
AVGC9.48 <= XAVGC40.48 AND
AVGC9.49 <= XAVGC40.49 AND
AVGC9.50 <= XAVGC40.50 AND
AVGC9.51 <= XAVGC40.51 AND
AVGC9.52 <= XAVGC40.52 AND
AVGC9.53 <= XAVGC40.53 AND
AVGC9.54 <= XAVGC40.54 AND
AVGC9.55 <= XAVGC40.55 AND
AVGC9.56 <= XAVGC40.56 AND
AVGC9.57 <= XAVGC40.57 AND
AVGC9.58 <= XAVGC40.58 AND
AVGC9.59 <= XAVGX40.59 AND
AVGC9.60 <= XAVGC40.60

Just to repeat myself, the first 40 days of this formula work fine and I've been using that PCF for weeks.  The problem only arose when I tried to add another 20 days to it.

John
Bruce_L
Posted : Wednesday, October 21, 2009 8:57:02 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The problem appears to be in the second to last line where you use XAVGX40.59 instead of XAVGC40.59. Please try the following instead:

AVGC9 > XAVGC40 AND AVGC9.1 <= XAVGC40.1 AND AVGC9.2 <= XAVGC40.2 AND AVGC9.3 <= XAVGC40.3 AND AVGC9.4 <= XAVGC40.4 AND AVGC9.5 <= XAVGC40.5 AND AVGC9.6 <= XAVGC40.6 AND AVGC9.7 <= XAVGC40.7 AND AVGC9.8 <= XAVGC40.8 AND AVGC9.9 <= XAVGC40.9 AND AVGC9.10 <= XAVGC40.10 AND AVGC9.11 <= XAVGC40.11 AND AVGC9.12 <= XAVGC40.12 AND AVGC9.13 <= XAVGC40.13 AND AVGC9.14 <= XAVGC40.14 AND AVGC9.15 <= XAVGC40.15 AND AVGC9.16 <= XAVGC40.16 AND AVGC9.17 <= XAVGC40.17 AND AVGC9.18 <= XAVGC40.18 AND AVGC9.19 <= XAVGC40.19 AND AVGC9.20 <= XAVGC40.20 AND AVGC9.21 <= XAVGC40.21 AND AVGC9.22 <= XAVGC40.22 AND AVGC9.23 <= XAVGC40.23 AND AVGC9.24 <= XAVGC40.24 AND AVGC9.25 <= XAVGC40.25 AND AVGC9.26 <= XAVGC40.26 AND AVGC9.27 <= XAVGC40.27 AND AVGC9.28 <= XAVGC40.28 AND AVGC9.29 <= XAVGC40.29 AND AVGC9.30 <= XAVGC40.30 AND AVGC9.31 <= XAVGC40.31 AND AVGC9.32 <= XAVGC40.32 AND AVGC9.33 <= XAVGC40.33 AND AVGC9.34 <= XAVGC40.34 AND AVGC9.35 <= XAVGC40.35 AND AVGC9.36 <= XAVGC40.36 AND AVGC9.37 <= XAVGC40.37 AND AVGC9.38 <= XAVGC40.38 AND AVGC9.39 <= XAVGC40.39 AND AVGC9.40 <= XAVGC40.40 AND AVGC9.41 <= XAVGC40.41 AND AVGC9.42 <= XAVGC40.42 AND AVGC9.43 <= XAVGC40.43 AND AVGC9.44 <= XAVGC40.44 AND AVGC9.45 <= XAVGC40.45 AND AVGC9.46 <= XAVGC40.46 AND AVGC9.47 <= XAVGC40.47 AND AVGC9.48 <= XAVGC40.48 AND AVGC9.49 <= XAVGC40.49 AND AVGC9.50 <= XAVGC40.50 AND AVGC9.51 <= XAVGC40.51 AND AVGC9.52 <= XAVGC40.52 AND AVGC9.53 <= XAVGC40.53 AND AVGC9.54 <= XAVGC40.54 AND AVGC9.55 <= XAVGC40.55 AND AVGC9.56 <= XAVGC40.56 AND AVGC9.57 <= XAVGC40.57 AND AVGC9.58 <= XAVGC40.58 AND AVGC9.59 <= XAVGC40.59 AND AVGC9.60 <= XAVGC40.60

You may wish to review the following:

How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.