StockFetcher Forums · General Discussion · Need help to express this algorithm<< >>Post Follow-up
69 posts
msg #61411
Ignore binhp
4/12/2008 12:31:45 PM

Hi all,

I need help to express this algorithm:

30daylo = new 30 day low within the last 10 days

FInd stocks that the:

close is trading between +/- 1% 30daylo for the last 5 days



2,824 posts
msg #61417
Ignore nikoschopen
4/12/2008 1:51:54 PM

First of all, you can never trade below 30 day low because when it does the damn thing itself becomes the new 30 day low. As ure about to see when you run the following filter, you will only find 1 or above in the "range" column because you can never have a new 30 day low unless another 30 day low is made. So, in essence, you will only be able to find those that trade above this 30 day low (whatever that is).

days(price reached a new 30 day low,10) above 0
set{range, close / low 30 day low}
set{ratio, count(range between 0.99 and 1.01,5)}
ratio equals 5

add column range

2,817 posts
msg #61421
Ignore chetron
4/12/2008 3:25:07 PM

i am probably off base here, but try this too.

it is for the standard folks. you just need to check the column for the greater > 4 ones.

the advanced folks just need to remove the " /* " for their version.

good luck

set{yesterdays_30,low 30 day low 1 day ago}
set{last_10,count(low < yesterdays_30,10)}
set{var3,low 30 day low * 1.01}
set{var4,low 30 day low * 0.99}
set{var5,count(close > var4,1)}
set{var6,count(close < var3,1)}
set{var7,var5 * var6}
set{days_close_near_low,count(var7 > .5,13)}

draw yesterdays_30 on plot price
draw var3 on plot price
draw var4 on plot price

add column days_close_near_low

/* days_close_near_low > 4.5 */
last_10 > .5
close > 1
volume > 100000
sort column 5 descending

69 posts
msg #61446
Ignore binhp
4/14/2008 3:37:21 AM

Hello Niko and Chetron,

Thank you for jumping in promptly and provide your implementation which are very valuable to me. Now I know where to start.
Niko, you are right. The range cannot be below the30 day low.
I am still digesting and improving the code and backtesting it.

Best regards,


StockFetcher Forums · General Discussion · Need help to express this algorithm<< >>Post Follow-up

*** Disclaimer *** does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. does not recommend particular securities., Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.

Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus