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

Re: [amibroker] SetBarsRequired()...?



PureBytes Links

Trading Reference Links

Title: AFL Function Reference - SETBARSREQUIRED

SETBARSREQUIRED
- set number of previous and future bars needed for script/DLL to properly execute

Miscellaneous functions
(AFL 2.1)


SYNTAX setbarsrequired( backwardref = -1, forwardref = -1 )
RETURNS nothing
FUNCTION set number of previous and future bars needed for script/DLL to properly execute. If your formula is pure AFL you don't need to use this function at all, as AmiBroker automatically calculates number of bars required for all its built-in functions. But if you are using script or a DLL you may need to use this function to make sure that your indicators are properly calculated in QuickAFL mode. Specifying -1 means no change. For example if you are using the script that calculates 100 bar moving average you may need to call SetBarsRequired( 100, 0 ); at the very beginning of your formula. Please note that in most cases it is not necessary (even if you are using script or DLL) because AmiBroker always provides at least 30 past data bars more than needed.
EXAMPLE setbarsrequired( 100000, 100000 ) // require all past and all future bars
SEE ALSO  

References:

The SETBARSREQUIRED function is used in the following formulas in AFL on-line library:

More information:

Updated on-line reference

 



sidhartha70 wrote:

Hi All,

I'm a little confused about the use of SetBarsRquired()... How do I
know specifically when I need to use it...? And How do I know how many
bars to specify IF I do need to use it...??

Also, doesn't it really very significantly slow code execution
down...? From my experimentation, it seems to.

I currently have some indicators plotting (e.g. fast and slow lines
crossing) and the exact bar on which a cross occurs seems to move as I
scroll backwards and forwards along a chart....

Any ideas...?


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___