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

Re: [amibroker] 10 uses for the #Include



PureBytes Links

Trading Reference Links

Herman,
 
I have not worked with the #include pre-proccessor yet...mainly I do not
know how....
 
Say I have a file called Movingaverage....( movingaverage=ma(c,28) ).....Now
I want to use this in some other formula....so I write the following:
 
#include "C:\Program Files\AmiBroker\AFL\movingaverage.afl" 

Now What do I do ??

Thank you
Anthony
 
 
-------Original Message-------
 
From: amibroker@xxxxxxxxxxxxxxx
Date: Friday, April 25, 2003 10:31:36 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] 10 uses for the #Include
 
Hello,
 
The #include does not enhance processing power or provide additional
functions. I substitute it with the full code after development or for
performance testing. However it is extremely handy for:
 
1) Making code more readable during development by hiding a major part that
doesn't require any more work. Working on a program of a few hundred lines
and scrolling back and forth, from begin to end, doesn't make for pleasant
working. Breaking it up into modules will speed up you work.
 
2) During development, when working with loops, you can hide the entire body
of the loop so that you can see the begin and the end of the loop and work
on the code in those areas. For quick temporary hiding of code sections use
a standard name like Mod1, Mod2, etc.
 
3) I plot equity and other indicators from the backtester using the Equity
button, i find this easier than working from two formula windows. Most
indicators contain completed code so they can very conveniently be put into
an #Include file, so as not to clutter up the systems code. Fred's equity
code is a nice example that you might want to have in an Include file.
 
4) Some of my systems use many calibration constants, a long line of 100
short statements messes up the code and makes it harder to work with.
Placing the assignments in an include file hides them nicely and makes it
very easy to switch constants by commenting out one or another include
 
5) During development I use ,any AddCollumn statements, 10, 20, even more.
In a major project it is well worth to develop such debugging tools and
leave them in the code. Simply uncomment them when you need them...
 
6) Include files can be used to "attach" documentation to a program without
cluttering the window and using up a lot of space. Sometimes it is handy to
use the Indicator formula window (if not used) to keep notes in an Include
file.
 
7) Scripts, if used, are pretty well stand-alone pieces of code and it is
nice to hide them from view.
 
8) If you use pattern recognition and work with long lists of patterns or
Candle stick patterns, you can define those in an include file.
 
9) If you want to translate Status("StockNum") to a literal string ("MSFT")
and you work the N100, you'll need a 100 statements that mess up your code.
Also since this type of code can be called from many other programs it is
nice to have it self contained.
 
10) You can pass parameters to Include files (as needed in 9 above) by
reserving a suitable variable name for Include files ,or as I do, i give the
include file a long name that tells me what it expects and what it returns.
For example: N100Number-n-ToTicker-T.afl this files expects a pointer named
"n" to be defined before using the #Include and returns the Ticker
name-string in "T". I define n before the include and use the string T after
it. Easy?
 
11) I know: I can't count! Some standard Param() applications that are
needed for debugging but not in the final version - an Include may be useful
here.
 
 
 
 
 
 
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. 
 
 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/O10svD/Me7FAA/AG3JAA/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/