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

Re: [amibroker] AA/AFL: How many bars within date range



PureBytes Links

Trading Reference Links




Hi Herman and all,
sorry, I was a little bit unclear in my question. I indeed 

meant the date range fields one 
can set in AA. 
The solution below is exactly what I was looking 
for.
BTW, it is a very interesting (hard to find, maybe tricky) 

solution. Combining 
the required filter here with the 
usual filters of <FONT 
face=Arial>the system works too, that's wonderful.
On the other hand, IMHO such a function belongs to 
AFLs core lib.
Thanks to all,
UM
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Herman vandenBergen 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, April 30, 2003 5:13 
  AM
  Subject: RE: [amibroker] AA/AFL: How many 
  bars within date range
  
  <FONT face=Arial color=#0000ff 
  size=2><FONT 
  face="Arial Narrow" color=#8b0000 size=1>
  
    Start = <FONT 
    face="Arial Narrow" color=#0000ff>ValueWhen<FONT face="Arial Narrow" 
    color=#8b0000>(<FONT face="Arial Narrow" 
    color=#0000ff>Status<FONT face="Arial Narrow" 
    color=#8b0000>(<FONT face="Arial Narrow" 
    color=#cc4466>"FirstBarInRange"<FONT face="Arial Narrow" 
    color=#8b0000>),<FONT face="Arial Narrow" 
    color=#0000ff>BarIndex<FONT face="Arial Narrow" 
    color=#8b0000>());End = 
    <FONT face="Arial Narrow" 
    color=#0000ff>ValueWhen<FONT face="Arial Narrow" 
    color=#8b0000>(<FONT face="Arial Narrow" 
    color=#0000ff>Status<FONT face="Arial Narrow" 
    color=#8b0000>(<FONT face="Arial Narrow" 
    color=#cc4466>"LastBarInRange"<FONT face="Arial Narrow" 
    color=#8b0000>),<FONT face="Arial Narrow" 
    color=#0000ff>BarIndex<FONT face="Arial Narrow" 
    color=#8b0000>());NumStartToDays = 
    End-Start;<FONT face="Arial Narrow" 
    color=#0000ff>AddColumn<FONT face="Arial Narrow" 
    color=#8b0000>(Start,<FONT face="Arial Narrow" 
    color=#cc4466>"Start"<FONT face="Arial Narrow" 
    color=#8b0000>,<FONT face="Arial Narrow" 
    color=#ff00ff>1.0<FONT face="Arial Narrow" 
    color=#8b0000>);<FONT face="Arial Narrow" 
    color=#0000ff>AddColumn<FONT face="Arial Narrow" 
    color=#8b0000>(End,<FONT face="Arial Narrow" 
    color=#cc4466>"End"<FONT face="Arial Narrow" 
    color=#8b0000>,<FONT face="Arial Narrow" 
    color=#ff00ff>1.0<FONT face="Arial Narrow" 
    color=#8b0000>);<FONT face="Arial Narrow" 
    color=#0000ff>AddColumn<FONT face="Arial Narrow" 
    color=#8b0000>(NumStartToDays,<FONT face="Arial Narrow" 
    color=#cc4466>"<FONT face="Arial Narrow" 
    color=#cc4466>NumStartToDays"<FONT face="Arial Narrow" 
    color=#8b0000>,<FONT face="Arial Narrow" 
    color=#ff00ff>1.0<FONT face="Arial Narrow" 
    color=#8b0000>);<FONT face="Arial Narrow" 
    color=#ff0000>Filter<FONT face="Arial Narrow" 
    color=#8b0000>=<FONT face="Arial Narrow" 
    color=#0000ff>Status<FONT face="Arial Narrow" 
    color=#8b0000>(<FONT face="Arial Narrow" 
    color=#cc4466>"lastBarInTest"<FONT face="Arial Narrow" 
    color=#8b0000>);
  <SPAN 
  class=290024602-30042003> <FONT face=Tahoma 
  size=2>-----Original Message-----From: Jayson 
  [mailto:jcasavant@xxxxxxxxxxxx]Sent: April 30, 2003 2:34 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  AA/AFL: How many bars within date range
  
    <SPAN 
    class=846152918-29042003>Um,
    <SPAN 
    class=846152918-29042003> 
    <SPAN 
    class=846152918-29042003>probably the simplest method would be to use a 
    combination of valuewhen, datenum and barindex... something 
    like...
    <SPAN 
    class=846152918-29042003> 
    <SPAN 
    class=846152918-29042003>start=valuewhen(datenum()==951231,barindex());
    <SPAN 
    class=846152918-29042003>end=valuewhen 
    (datenum()==1011231 ,barindex());
    <SPAN 
    class=846152918-29042003> 
    <SPAN 
    class=846152918-29042003>count=end-start; 
    <SPAN 
    class=846152918-29042003> 
    <SPAN 
    class=846152918-29042003>you might want to take a look at help for 
    assistance deciphering the date format...
     Jayson 
    <FONT face=Tahoma 
    size=2>-----Original Message-----From: uenal.mutlu@xxxxxxxxxxx 
    [mailto:uenal.mutlu@xxxxxxxxxxx]Sent: Tuesday, April 29, 2003 
    2:23 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: 
    [amibroker] AA/AFL: How many bars within date 
    rangeHi,how can I get the number of bars 
    betweena given fromdate and todate in 
  AA?ThxUM






Yahoo! Groups Sponsor












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.