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

RE: [amibroker] 10 uses for the #Include



PureBytes Links

Trading Reference Links

Anthony:

Say your "stored" file is called Average.afl

And it says 

AV=EMA(C,25);

And you save it.

You next file can say simply

#include(C:/.........../average.afl

Buy=Cross(AV,25);
Sell=Cross(25,AV);


Instead of getting a "unknown variable" message in your main file
because it contains no variable declared "AV", it simply uses the
definition in the saved and included file.

Hope this helps.

Ken

-----Original Message-----
From: Anthony Faragasso [mailto:ajf1111@xxxxxxxx] 
Sent: Saturday, April 26, 2003 1:51 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] 10 uses for the #Include

Dingo,

 

I guess what I am trying to say is this....How does the rest of the
formula
interact with what is included in the #include function...

 

This is the Moving average that is stored elsewhere : as an example

 

Movingaverage=ma(c,28);

 

Anthony

 

 

 

 

-------Original Message-------

 

From: amibroker@xxxxxxxxxxxxxxx

Date: Saturday, April 26, 2003 1:40:00 PM

To: amibroker@xxxxxxxxxxxxxxx

Subject: RE: [amibroker] 10 uses for the #Include

 

Sure but what you've got to provide me is the AFL formula that I'll put
into
the file:

 

"C:\Program Files\AmiBroker\IncludeFiles\movingaverage.afl"

 

All the include does is allow you to have some AFL code stored in a file
that become incorportated into the rest of the formula where the include
statement is. Think of that "included" AFL as invisible.

 

 

For instance - If I have the attached formula All Code In One File.afl
and I
decide that I don't need to keep seeing all of that code for the equity
calculations in my AA window every time - it just gets in the way - I
would
break the code into 2 pieces: Main Code In One File.afl and
EquityCalcsInSeparateFile.Afl. 

 

The line #Include "C:\Program
Files\Amibroker\IncludeFiles\EquityCalcsInSeparateFile.Afl" will cause
AB to
include that code in my Main Code WHEN AB RUNS THE FORMULA.  But I don't
ever see it in the AA window.

 

That's as good an explanation as I can muster.

 

Hope its enough!

 

d

 

 

-----Original Message-----

From: Anthony Faragasso [mailto:ajf1111@xxxxxxxx] 

Sent: Saturday, April 26, 2003 1:14 PM

To: amibroker@xxxxxxxxxxxxxxx

Subject: RE: [amibroker] 10 uses for the #Include

 

 

Dingo, 

 

Ok...Could you supply a sample output using this moving average and the

#include function. 

 

I am still lost on how to use this #include function. 

 

TIA 

Anthony 

 

-------Original Message------- 

 

From: amibroker@xxxxxxxxxxxxxxx 

Date: Saturday, April 26, 2003 11:09:15 AM 

To: amibroker@xxxxxxxxxxxxxxx 

Subject: RE: [amibroker] 10 uses for the #Include 

 

Anthony, 

 

WHen you use the include you never get to see the code in the AA window.

Amibroker reads it internally when it runs your formula.  This is how
you

can save space in the AA window.  The code that is "included" should
have

been thoroughly tested and error free. 

 

d 

-----Original Message----- 

From: Anthony Faragasso [mailto:ajf1111@xxxxxxxx] 

Sent: Saturday, April 26, 2003 7:40 AM 

To: amibroker@xxxxxxxxxxxxxxx 

Subject: RE: [amibroker] 10 uses for the #Include 

 

 

Herman, 

 

Thank you for that...That much I do know...but how do I read this
file.... 

example..How would I read this in The AA window on an explore.....Or in
the 

Indicator Builder... 

 

TIA 

Anthony 

 

-------Original Message------- 

 

From: amibroker@xxxxxxxxxxxxxxx 

Date: Saturday, April 26, 2003 2:27:30 AM 

To: amibroker@xxxxxxxxxxxxxxx 

Subject: RE: [amibroker] 10 uses for the #Include 

 

You create a directory in your AmiBroker directory that is called 

"IncludeFiles", you copy all your include files to that directory. Then
to 

read the include file code into your system you insert this line: 

 

#include "C:\Program Files\AmiBroker\IncludeFiles\movingaverage.afl"; 

 

h 

 

-----Original Message----- 

From: Anthony Faragasso [mailto:ajf1111@xxxxxxxx] 

Sent: April 25, 2003 7:55 PM 

To: amibroker@xxxxxxxxxxxxxxx 

Subject: Re: [amibroker] 10 uses for the #Include 

 

 

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.

 

 

 

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 

ADVERTISEMENT 

 

 

 

 

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. 

 

 

 

 

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 

 

 

 

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. 

 

 

 

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

 

 

 

 

 

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. 

 

 


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 ---------------------~-->
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/