Tuesday, November 18, 2008

ADR support and resistance StockFetcher filter

For anyone who believes in the idea that average day range can be an indicator of intraday support and resistance (an idea I pioneered here), the following is a StockFetcher filter written to calculate these numbers. Not flashy but it saves me from having to use a calculator which I often find myself grabbing. Put in any stock symbols that you want to check; as many as you need separated by commas. This code was written by DaveH in chat; next time you see him tell him you appreciate his work (I do!).


SYMLIST(ABK,RDN,TMA)   /* enter whatever tickers you want to calculate here*/
set{range1ago, high 1 day ago - low 1 day ago}
set{range2ago, high 2 day ago - low 2 day ago}
set{range3ago, high 3 day ago - low 3 day ago}
set{range4ago, high 4 day ago - low 4 day ago}
set{range5ago, high 5 day ago - low 5 day ago}
set{tot12, range1ago + range2ago}
set{tot34, range3ago + range4ago}
set{tot1234, tot12 + tot34}
set{tot_15, tot1234 + range5ago}
set{range_avg15, tot_15 / 5}
add column range_avg15 {5day_avg_range}
set{hi_range, open + range_avg15}
add column open
add column hi_range
set{low_range, open - range_avg15}
add column low_range

5 comments:

DaveH said...

I think this measurement is very useful. Today I was short ONNN and at 12:15ET had a profit of 5.5%. I was about to cover under my normal "take it and run" plan. But I then ran the range calculator and found that the range over the last 5 days would predict a low at about 2.76 which would give me a profit well over 10%. So I did not cover and presently at 1:24ET the position is at a profit of 9.6%.

I also am using it to determine when to sell some VECO that I shorted today. It had gone up a lot after the open before I shorted it. So in that case I want to measure the difference between the High and average range, as that will show when the stock has traversed its average range today. So I added columns to do that and to measure the difference between the the Low and the average range. I renamed the columns to make the names more descriptive. I will paste the modified code below.

Thanks to JV for the great idea!

SYMLIST(onnn,jns,veco) /* enter whatever tickers you want to calculate here*/
set{range1ago, high 1 day ago - low 1 day ago}
set{range2ago, high 2 day ago - low 2 day ago}
set{range3ago, high 3 day ago - low 3 day ago}
set{range4ago, high 4 day ago - low 4 day ago}
set{range5ago, high 5 day ago - low 5 day ago}
set{tot12, range1ago + range2ago}
set{tot34, range3ago + range4ago}
set{tot1234, tot12 + tot34}
set{tot_15, tot1234 + range5ago}
set{range_avg15, tot_15 / 5}
add column range_avg15 {5day_avg_range}
set{open_plus_range, open + range_avg15}
add column open_plus_range
set{low_plus_range, low + range_avg15}
add column low_plus_range
add column open
set{high_minus_range, high - range_avg15}
add column high_minus_range
set{open_minus_range, open - range_avg15}
add column open_minus_range

James Krieger said...

That's a great filter. Very handy

pavtrader said...

niiice

Unknown said...

Haven't even played around with this yet, but I just wanted to say thanks in advance Johnny. I appreciate all the work you do.

Walter Sobchak said...

ADR s/r totally works, Johnny V and I picked off the airlines quite a few times based on this a few months ago