The highest and lowest closing price in a date range with AFL

#1
Hi all,

I'd like to find out the highest and lowest closing price in a date range (Ex: between 01/01/2010 and 03/15/2010). Does anyone have that code in AFL? Could you please help?

Thanks
 
#2
bars = Param("Bars",100,10,200,1);

AddColumn(C,"Close");
AddColumn(HHV(H,bars),"Hmax");
AddColumn(LLV(L,bars),"Lmin");

Filter = 1;


Try the above part. It is not exactly what you need because I just get in n bars, not in a date range.
 
#3
Oh, thanks a lot, Rajiv_chandan!!! The chart is so great. However, I think my requirement is much simplier.

I want to input the parameter of Start date and End date in the date range.
The program will scan through all stocks and find out the highest/lowest price from Start date to End date. Then, it just shows the values.
Ex: Stock A
01/01/2010: Open = 21, Close = 29
01/02/2010: Open = 29, Close = 31
01/03/2010: Open = 31, Close = 27
==> The program will show the Highest of stock A from Start date 01/01/2010 to End date 01/03/2010 = 31, lowest = 21.
==> The same for other stocks. The program will also show the highest/lowest of stock B, C, .... from 01/01/2010 to 01/03/2010
I think messi_ronaldo's part of code nearly reaches my idea. However, I want to replace n bars parameter by Start date and End date parameters.

I'm just a newbie so still cannot develop anything more based on your posts. Could you please help more?

Thank you so much!
 
Last edited:
#4
hi
afl gurus in continuation of above , the said afl should scan out all such scripts with dayes range more than 10 , and should include 5 dayes average range for the script as well.


with regards
ravi