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.

Scan Error when adding multiplication by 100 to statement

Scan Error when adding multiplication by 100 to my,

- This statement works OK and gives me results, eg, for MSFT as 0.713

and [ weekly EMA(10,weekly ROC(1)) / weekly EMA(10,absval(weekly ROC(1))) > 0.70]

- I want to revise it to multiply results by 100 so the MSFT would then become 71.3. This is the revised scan statement I am trying to use.

and [ (( weekly EMA(10,weekly ROC(1)) / weekly EMA(10,absval(weekly ROC(1))) ) * 100) > 70]

But, when I Check Syntax I get error......... Your scan syntax is incorrect. Could not parse "" located in the clause "(( WEEKLY EMA(10,WEEKLY ROC(1)) / WEEKLY EMA(10,ABSVAL(WEEKLY ROC(1))) ) * 100) > 70"

What is the issue? Thanks for your help.....Bob

Best Answers

  • markdmarkd mod
    edited August 2016 Answer ✓
    You need to use brackets - [ ] - for grouping instead of parentheses - ( ) - .
    Parentheses are used only for functions, like ema( ), max( ), etc.

    So, this

    and [ (( weekly EMA(10,weekly ROC(1)) / weekly EMA(10,absval(weekly ROC(1))) ) * 100) > 70]

    should be this:

    and [ [ weekly EMA(10,weekly ROC(1)) / weekly EMA(10,absval(weekly ROC(1))) ] * 100 > 70 ]

    You need only one additional pair of brackets - around the division terms.
  • markdmarkd mod
    edited August 2016 Answer ✓
    I think the absval() function is limited in what it can evaluate. I had a similar problem comparing values preceded by "1 day ago". I emailed support and they told me absval() was not written to handle that phrase. So it may not be able to handle yours either (maybe it's the brackets, or maybe its the absval inside the absval? no way to know without asking support).

    Maybe you can re-write it into two scans, one for up closes, one for down closes, so you don't have to deal with mixed signs? Just a thought.

    I think once you get it to work, you can just copy it to the end, remove the "and", put rank by in front of it and remove the >70.

Answers

  • Mark, thanks, that fixed it.....I am still a dummy since I cannot fix my next step...help please as I have problem with brackets or logic.......
    - I am performing this scan on the S&P 100 with your statement revision and of course I get both positive & negative values... and what I want to do is to find the absval so I end up with values between 0 and 100. Here is my statement,......I am getting no syntax errors but getting no scan results........
    - and [ absval( [ weekly EMA(10,weekly ROC(1)) / weekly EMA(10,absval(weekly ROC(1))) ] * 100) > 70 ]
    - after I completing this step I want to convert it to a Rank by statement......could you help on this one also......Thanks, Bob
  • Mark, thanks for your prompt response. I will ask SC Support
Sign In or Register to comment.