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 |

error in formula Topic Rating:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Readyforaction
Posted : Thursday, February 28, 2019 10:43:20 PM
Registered User
Joined: 10/28/2012
Posts: 9

Hello Bruce returning customer . i use to have this formula working great in the past but now saying i have an error in the formula.

 (AVGH14 - AVGL14) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13)) / 28 / C *100 > 1.75

it says unable to parse number 1.75 at position 480

Bruce_L
Posted : Friday, March 1, 2019 8:40:31 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Did you possibly switch to a computer using the , as the decimal marker instead of using the . as the decimal marker as is more common in the United States?

Please try the following instead (it is shorter because there have been improvements to the PCF Language since your formula was written).

100 * ATR14 / C > 175 / 100

 



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Readyforaction
Posted : Saturday, March 2, 2019 10:25:27 AM
Registered User
Joined: 10/28/2012
Posts: 9

thanks Bruce much appreciated

bcochrane
Posted : Saturday, March 2, 2019 2:00:06 PM
Registered User
Joined: 9/17/2010
Posts: 484

Bruce, out of idle curiosity, why not

100 * ATR14 / C > 1.75

Bruce_L
Posted : Monday, March 4, 2019 10:04:55 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Not all places use a . as the decimal marker. Some places use the , as the decimal marker instead for example. TC2000 does not handle this well.

If the software is run locally on a computer where the decimal marker is set to use the , instead of the . then everything done on the computer itself will want the , as the decimal marker. This includes custom indicators plotted on the chart and the testing of formulas.

But lots of calculations happen on our servers even if the software is running locally (as opposed to using TC2000 Anywhere). All of the calculations are running on a computer where the . is set as the decimal marker. Such calculations include things like WatchList columns, scans, and alerts.

This means the best solution for situations where the comma (,) is set as the decimal marker instead of the period (.) being set as the decimal marker as is more common in the United States is to try to not use decimal markers in the formula at all. This is why instead of writing:

1.75

Which does include a decimal marker, we would write:

175 / 100

Which does not include a decimal marker in such situations.

Since there weren't any actual syntax errors in the original formula and since the customer was not located in the United States, the most likely fix was to eliminate decimal markers from the formula (and I might as will simplify it with new syntax while I was at it).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
bcochrane
Posted : Tuesday, March 5, 2019 9:24:17 AM
Registered User
Joined: 9/17/2010
Posts: 484

Thanks. Rats, I knew that, just didn't make the connection.Sorry

Bruce_L
Posted : Tuesday, March 5, 2019 9:27:09 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome. Even if you knew it, having it explicitly written out again in the forums is a good idea as other people might find it easier to find the answer and reason on their own if it happens to them.



-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.