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

Re: [amibroker] Re: Passing arrays to a DLL



PureBytes Links

Trading Reference Links

Hello,

You can also use:

endbar = LastValue( ValueWhen( status("firstbarinrange"), BarIndex() ) );

as per:
http://www.amibroker.com/guide/afl/afl_view.php?name=STATUS

Hope this helps.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "sharps_45_70" <sharps_45_70@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, September 20, 2003 10:35 PM
Subject: [amibroker] Re: Passing arrays to a DLL


> Steve,
> 
> Looks promising!  
> 
> The line:
> 
> endbar  = ValueWhen( DateNum() ==  Status("rangetodate"), BarIndex
> () ); 
> 
> seems to work well when the year is other than 2000.  
> 
> Thanks,
> Ed
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@xxxx> wrote:
> > Hi Ed,
> > 
> > You can only pass the entire array back and forth, but you can 
> arrange for the DLL to only operate on a certain time period by 
> passing other parameters. One example could be something like:
> > 
> > In AFL:
> > 
> > startbar = ValueWhen( DateNum ==  status("rangefromdate"), BarIndex
> () );
> > endbar  = ValueWhen( DateNum ==  status("rangetodate"), BarIndex
> () );
> > 
> > Then pass these to the DLL and in the DLL code something like:
> > 
> > for( i = startbar[0]; i <= endbar[0[; ++i )    // I think AB would 
> probably create startbar and endbar as arrays
> > {
> > do your testing...
> > }
> > 
> > Or, you could pass StartDate, EndDate, Datenem() and BarIndex() to 
> the DLL and do the conversion there.
> > 
> > Steve
> > 
> > 
> > 
> >   ----- Original Message ----- 
> >   From: sharps_45_70 
> >   To: amibroker@xxxxxxxxxxxxxxx 
> >   Sent: Saturday, September 20, 2003 1:41 PM
> >   Subject: [amibroker] Passing arrays to a DLL
> > 
> > 
> >   When you pass and array to a dll in the AA window, the entire 
> array 
> >   is passed regardless of the settings in the Range settings.
> > 
> >   For example, if you pass the "close" array of a symbol that you 
> have 
> >   2000 bars of data in the database, and the the range is set 
> to "all 
> >   quotations", then the size of the array passed is 2000.
> > 
> >   If you set the date range to something other than "all 
> quotations," 
> >   say 1/1/1995 to 12/31/2000, the entire 2000 element array is 
> still 
> >   passed to the dll, not just the array that represents the range 
> set 
> >   in the Range box.
> > 
> >   Does anyone know a way to synronize the number of array elements 
> >   passed to a dll with the range set in the Range box?
> > 
> >   Thanks,
> >   Ed
> > 
> > 
> > 
> > 
> >         Yahoo! Groups Sponsor 
> >               ADVERTISEMENT
> >              
> >        
> >        
> > 
> >   Send BUG REPORTS to bugs@xxxx
> >   Send SUGGESTIONS to suggest@xxxx
> >   -----------------------------------------
> >   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.
> 
> 
> 
> 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 http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
ReplayTV: Control live television
Special Sale: 50% off ReplayTV
CNet Ranked #1 over Tivo!
http://us.click.yahoo.com/aUMW7B/A6qGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/