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

Syntax error

How this is not ok…

[favorites list is 39] // !CyclesUpsDownWeekly
and [Close > SMA(10)]
and [yesterday's close < yesterday’s SMA(10)]

But this is ok?

[favorites list is 39] // !CyclesUpsDownWeekly
and [Close > SMA(10)]
and [yesterday's close < SMA(10)]

Comments

  • Options
    markdmarkd mod
    edited September 2022
    Both are OK, but in the first case, "yesterday's sma(10)" is a legal expression, but the editor is not seeing the " 's" as part of the keyword term "yesterday's"

    You can see this if you cut and paste your code into the advanced editor.

    The first "yesterday's" is all green, while the second "yesterday's" is green up to but not including the " 's", which is black. That means the editor doesn't recognize the partial "yesterday's" as a keyword.

    A keyword is a string of characters that the editor recognizes as having special meaning (in other words, when it sees that string of characters, it knows to execute certain lines of code associated with it).

    So the editor doesn't know what to do with the "s", which is not a keyword by itself, so it gives you an error.

    Retype "yesterday's" slowly so it's all green and it will pass syntax and execute correctly.

    Just a quirky thing. Probably an interruption in processing that lost the conversion from plain text to a keyword.
  • Options
    Fascinating. I actually was not using the advanced editor, and now I know I SHOULD be using it. Thank you.
Sign In or Register to comment.