I am experimenting with includes, and wondering if Amibroker's, 'include' folder does some background work or maybe something with cache, as I can get some includes to work under a testing folder and others refuse to work unless under 'include' . I will eventually place all includes in include folder , I know i'm in some buggy potential area with multiple calls over several files that share includes , any possible suggestions using Include or adding 'pragma nocache' or any examples , the simple solution is I drop my functions in the current afl which then runs fine, I was just trying to subdivide a bit.
#include_once "C:\Program Files\AmiBroker\Formulas\Custom\__AMI_Bridge_alpha\Signal_Manager.afl"
// --> "C:\Program Files\AmiBroker\Formulas\Custom\__AMI_Bridge_alpha\#include_once <Trade_and_Signal_Utils.afl>
// above don't work
// below works
#include_once <Trade_and_Signal_Utils.afl>
// ? should I use this pragma nocache somewhere ?
Thanks for looking , any simple suggestions or links appreciated.
#include now accepts new way of specifying file names to include:
#include <filename.afl>
(note < > braces instead of " " ) if you specify the file name this way AmiBroker will look for the file in "standard include path" that is definable using new prefs setting in Tools->Preferences->AFL It makes much shorter to write includes and you can move include folder now without changing all AFL codes using #includes.
The default include directory is ...\AmiBroker\Formulas\Include. Unless you have changed that, your two statements above are referring to different folders. The one with quotes is looking in ...\AmiBroker\Formulas\Custom\ __AMI_Bridge_alpha while the one with angle brackets is looking in ...\AmiBroker\Formulas\Include.
Completely forgot about that 'AFL' in preferences. This infers there is no special handling and just best practice where to place them, least in my noob programming experience. Thank you for the help.
There is no special processing except what @mradtke already wrote, i.e. using standard include path as set in the preferences when <filename.afl> braces are used.