New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

Integer Expected

These are 2 lines of a scan I am trying to develop that are giving me error messages
and [weekly Force(13) > 1 Week ago weekly Max(3, weekly Force(13)]
and [weekly TSI(25,13,7) > 1 Week ago weekly Max(3, weekly TSI(25,13,7)]
the messages are essentially the same
The first line gives this message:
Could not parse "(13" located in the clause "1 WEEK AGO WEEKLY MAX(3, WEEKLY FORCE(13)" (an integer was expected)
The second line gives this message:
Could not parse "(25137" located in the clause "1 WEEK AGO WEEKLY MAX(3, WEEKLY TSI(25,13,7)" (an integer was expected)
What am I doing wrong?

Comments

  • markdmarkd ✭✭✭
    edited December 2017
    In both cases, you need a closing parenthesis for the max( ) function. You have one for Force and TSI, but not for max.

    Often, when you get an error message, it identifies WHERE the problem is, but the error message is not always clear (to the non-software engineer like you and me) WHAT the problem is. It is almost always a syntax problem - there's something missing or something that doesn't belong.

    When you are using functions like max( ) or min( ), one way to get around these errors is to put in both function parentheses first, so

    and [ max( ) ... ]

    then go back and fill in between the parentheses

    and [ max(3, Force(13)) ... ]


    Same thing with brackets, especially brackets for "or" conditions. Put them in first, then fill in between them. That makes it less likely you will lose track (which everyone does at least once in a while).
  • You know, I used to write software for a living. Never on a grand level, but commercially, and once for an SPX company. I should know better and hope to be more careful. I usually go back and count my opening and closing parentheses, but was thrown off by the error message. As I look at your replies to me and others, I am impressed by your clear and calm depiction, eagerness to be helpful and often expand the reply to broaden understanding of technique in finding whatever someone is looking to find, depth of understanding of trading, and knowledge of how to use the scan engine to find good stocks, and full understanding of each of the indicators. We all have a great deal to be thankful for the service you provide. Thank you!
  • markdmarkd ✭✭✭
    Thanks for the kind words. It's often a learning experience for me, too.
Sign In or Register to comment.