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

RE: [amibroker] Re: finding a stock's lowest price within AA date range



PureBytes Links

Trading Reference Links




<SPAN 
class=115210019-12112003>thanks jitu, that's exactly along the lines I was 
thinking. kind of surprising there isn't a simpler way.
<SPAN 
class=115210019-12112003> 
<SPAN 
class=115210019-12112003>one other thing: to make it easier to explain, I used 
price alone as the criteria. what I'm really looking for is a price filter and a 
liquidity filter. the important difference is that the liquidity measure I want 
to use is an MA, like this:
<SPAN 
class=115210019-12112003>    MA(c * v, 50)
<SPAN 
class=115210019-12112003> 
<SPAN 
class=115210019-12112003>the tricky part seems to be that if a stock's 
data begins after the start of the AA range, the first 50 bars of that 
expression are always null, because the MA needs to get started. that's true 
even if price * volume was always high enough to qualify.
<SPAN 
class=115210019-12112003> 
<SPAN 
class=115210019-12112003>any straight ahead ideas on how to handle 
that?
<SPAN 
class=115210019-12112003> 
<SPAN 
class=115210019-12112003>thanks again,
<SPAN 
class=115210019-12112003> 
<SPAN 
class=115210019-12112003>dave
<SPAN 
class=115210019-12112003> 
<BLOCKQUOTE 
>As 
  far as lowest in the range is concerned, try following -bi = 
  BarIndex();start = LastValue(ValueWhen(Status("firstbarinrange"), 
  bi));end = LastValue(ValueWhen(Status("lastbarinrange"), bi));numBars 
  = end - start;llvNumBars = LLV(L, numBars);llvAtEndOfRange = 
  LastValue(ValueWhen(Status("lastbarinrange"), llvNumBars));// 
  Filter = llvAtEndOfRange > 10;Filter = True;AddColumn(L, 
  "L");AddColumn(llvAtEndOfRange, "llvAtEndOfRange");Jitu--- 
  In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
  wrote:> say I'd like to find stocks whose price has stayed above $1 
  within the AA> date range. any ideas how to do that?> 
  > I thought I'd first find the lowest price within that date range, 
  but I'm> not sure how. the method needs to handle stocks whose 
  quotes start after the> beginning of the range, or end before the 
  end of it, finding them if the> quotes that do exist meet the 
  criteria.> > I think the following gets you the lowest price 
  since the start of the test> range, but keeps looking past the end 
  of the test range to the end of all> quotes:> 
        LastValue(LowestSince(Status("FirstBarInTest"), 
  c))> > it seems like there should be a clean and simple way to 
  do this, but I'm not> seeing it.> > thanks in advance 
  for any ideas.> > dave






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



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