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

[EquisMetaStock Group] Consolidation code



PureBytes Links

Trading Reference Links




Hi 
All,
<FONT face=Arial color=#0000ff 
size=2> 
I am 
trying to put some code together to pickup when a share starts to trade in a 
very tight consolidation zone.
<FONT face=Arial color=#0000ff 
size=2> 
The 
basic scenario and from my own observation is that there are periods where by 
the share price trades within the range of a candle from a few days 
before.
<FONT face=Arial color=#0000ff 
size=2> 
<SPAN 
class=126535400-18102003>My current code is
<FONT face=Arial color=#0000ff 
size=2>Ranging:=if(Sum(H>O or L<0,5)>3,1,0); ensure at least 3 of the 
last 5 days have actually done something;
<FONT face=Arial color=#0000ff 
size=2>Hg:=HHV(H,5);
<FONT face=Arial color=#0000ff 
size=2>Lw:=LLV(L,5);
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>X:=Sum(H<=Hg and Lw>=Lw,5); Count number of days in the past 5 that 
are within the range of the candle 5 days ago
<FONT face=Arial color=#0000ff 
size=2>X:=If(X>=3 and <FONT face=Arial 
color=#0000ff size=2>Ranging = 1,1,0); 
<FONT face=Arial color=#0000ff 
size=2>X;
<FONT face=Arial color=#0000ff 
size=2> 
The 
problem with this code, is that the Hg and Lw values don't remain constant and 
neither does it remain constant if you use Ref(H,-5) and ref(L,-5). The problem 
that this causes is that for each of the 5 sum calculations if looks back 5 
periods ago and gets the value 5 periods ago, so for yesterdays price 
it is actually looking back 6 days ago to get the HHV and LLV, which is exactly 
what I don't want.
<FONT face=Arial color=#0000ff 
size=2> 
Does 
anyone know how to create a constant and or reprogram the above 
code?
<FONT face=Arial color=#0000ff 
size=2> 
Thanks 
in advance.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>Regards,
Tim 
Hyder.
 






Yahoo! Groups Sponsor












To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.