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.

Scanning for PctChange

edited April 2015 in Scanning
I am trying to create a scan using the PctChange function to get the percent change for the year of qqq etf going back to 2009 and then forward each year. the reason for the scan will be to put the % change for the qqq, a general scan and see how many etf"s beat the qqq in a specific year.
this is the scan I created:
// this scan has 1573 in the starting before the current trading day in that parameter
// or course if you run in tomorrow you would have to pull up the jan 4 2009 date in increase the number of days
//00 CHG MODEL %
[symbol starts with 'qqq ']
//&&&& PCT PARAM 1year = NUM DAYS-weeks PARM 2= % CHANGE
[weekly PctChange(52,close) < 0]
rank by weekly PctChange(52,close)

I used 52 in the weeks parameter because I want the scan to include the entire year of 2009
I had to use less than zero because I came up with a negative number for my results
if you do a performance chart the result should be around 48.27%
as you can see by the attached file this scan give a results of -33.88%

does any one have some ideas of what I am doing wrong.

Best Answer

  • gordgord admin
    edited April 2015 Answer ✓
    Scanal, the scan engine can't look into the future. So when you write "and [weekly PctChange(52,close) < 0]" it's looking at the previous 52 weeks.

    Thus you need to run your scan on Jan 1 2010, to look at the previous 52 weeks, ie 2009.

    starting 1323 days ago, (as of today)
    [symbol starts with 'qqq ']
    // and [weekly PctChange(52,close) < 0] , you don't need this clause
    rank by [weekly PctChange(52,close)]

    This scan gives me 48.267% for the QQQ

    Per the chart I get 48.27%


Sign In or Register to comment.