[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Finding trading range/horizontal channel, can it be done like this?



PureBytes Links

Trading Reference Links

I want to plot a horizontal line from the Highest High Value and one 
from the Lowest Low Value for the past 30 days. In addition to this I 
want to have an exploration find stocks where the price has turned in 
the proximity of this line (support/resistance) over the past 30 days 
(or any period that I define). In other words I want to search for a 
horizontal channel that has lasted for past 30* days.

I have thought about how to implement this and maybe this is a 
suitable way?..: 

To find the the HHV for the last 10 days, AND the HHV for the last 10 
to 20 days, AND the HHV for the last 20 to 30 days.
And then the same thing for the LLV. Do you understand what I mean?

Then if the HHV/LLV for these timeperiods don't deviate from each 
other that much, then I can assume that there is resistance/support
for past 30 days at this level. I could divide the range into 
more/less timeperiods also, I don't know the best number of periods, 
I chose 3 to begin with.

What do you think about this approach? Do you find anything that 
don't make sense about this? 


/***************************************************************/
//THE CODE I HAVE COME UP WITH, 
//it's not finished by any means but you get my point hopefully
//The syntax is probably not correct, this is some kind 
//of pseudo code I guess, I have just written this in notepad
/***************************************************************/


// First find the highest high values, And lowest low values for the 
3 periods; 10 days ago, 10-20 days ago, and 20-30 days ago

HHA=HHV(H,10,-1);  	 //HHV of 10 days ago  (for example 33)
HHB=HHV(H,10,-10); 	 //HHV of 10 to 20 ago (for example 32)
HHC=HHV(H,10,-20); 	 //HHV of 20 to 30 days ago (for example 34)

LLA=LLV(L,10,-1);	 //LLV of 10 days ago  (for example 27)
LLB=LLV(L,10,-10);	 //LLV of 10 to 20 ago (for example 28)
LLC=LLV(L,10,-20); 	 //LLV of 20 to 30 days ago (for example 29)



//Then caluculate the average of these HHVs and LLVs

HHavg=(HHA+HHB+HHC/3);//(for example = 33)
LLavg=(LLA+LLB+LLC/3); //(for example =28)



//Then check to see if the averages of the three HHVs and 
//LLVs are not deviating too much, I chose 5% as example 
//of maximum deviation. 


//HHAvg is between HHV - 5% and HHV + 5%
if ((HHavg > (HHV(H,30) * 0.95)) AND (HHavg < (HHV(H,30) * 1.05))) 

AND

//LLAvg is between LLV - 5% and LLV + 5%
if ((LLavg > (LLV(L,30) * 0.95)) AND (LLavg < (LLV(L,30) * 1.05))) 

{ hChannel=TRUE; } 
//if they don't differ more than 5% there is a horizontal channel


Filter=hChannel;  //filter for stocks where hchannel is true

//now plot the channel for stocks where hChannel=true
//i.e. plot lines from HHavg and LLavg, AND plot lines 
//from HHV(H,30,-1) and LLV(L,30,-1)
//then maybe explore stocks that break out of these 
//resistance levels. Haven't thought about this yet...

//Code ends here


Please could you give your opinion on this, I might have missed 
something or maybe I'm completely off track? Is there a better way 
to find horizontal support and resistance that I could use to find 
horizontal channels/ranges?

Thank you very much for any help or suggestions or comments you can 
give! It's highly appreciated!


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.30/674 - Release Date: 2/7/2007 3:33 PM