Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

ERROR:Unreachable code-1) Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
RedEagle9
Posted : Friday, January 13, 2017 2:57:37 PM
Registered User
Joined: 9/14/2016
Posts: 24

Prior to the latest update in TC2000 vs 17 the formula producing this error plotted nicely.  If I could be alowed a guess; it seems the formula is 2 characters too long to be processed. The formula ends in "-1)"   The formula is 224 characters long.

It's the first time I've recieved this error.

Thanks.

Bruce_L
Posted : Friday, January 13, 2017 3:04:50 PM


Worden Trainer

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

If you let me know the name of the layout and/or chart containing the indicator I could take a look at it to try and see if I can figure out why it is generating the error and how the fomula could be corrected.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
RedEagle9
Posted : Saturday, January 14, 2017 12:49:10 AM
Registered User
Joined: 9/14/2016
Posts: 24

This PCF creates a bolean expression, true when both moving averages are rising, false when both are falling. One is a 16 period SMA of the high+low+close/3 the other is a 9 period SMA of the high+low/2. The error flags the position 2 characters from the end the '-1'.

ABS((AVGH16+AVGL16+AVGC16)/3 > (AVGH16.1+AVGL16.1+AVGC16.1)/3 AND ((AVGH9+AVGL9)/2) >= ((AVGH9.1+AVGL9.1)/2))+(ABS((AVGH16+AVGL16+AVGC16)/3 < (AVGH16.1+AVGL16.1+AVGC16.1)/3 AND ((AVGH9+AVGL9)/2) <= ((AVGH9.1+AVGL9.1)/2))*-1)

Thanks!

StockGuy
Posted : Saturday, January 14, 2017 8:06:46 AM

Administration

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

That formula calculates a value, not a True/False result.  The error is caused by no spaces around the * at the end.

Try this version...

ABS((AVGH16+AVGL16+AVGC16)/3 > (AVGH16.1+AVGL16.1+AVGC16.1)/3 AND ((AVGH9+AVGL9)/2) >= ((AVGH9.1+AVGL9.1)/2))+(ABS((AVGH16+AVGL16+AVGC16)/3 < (AVGH16.1+AVGL16.1+AVGC16.1)/3 AND ((AVGH9+AVGL9)/2) <= ((AVGH9.1+AVGL9.1)/2)) * -1)

RedEagle9
Posted : Saturday, January 14, 2017 12:41:07 PM
Registered User
Joined: 9/14/2016
Posts: 24

Well, thank you very much.

Cheers.

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.