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

RE: [amibroker] 10 uses for the #Include



PureBytes Links

Trading Reference Links




thank 
you dale for your input...
 Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: dingo 
[mailto:dingo@xxxxxxxxxx]Sent: Sunday, April 27, 2003 12:00 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 10 
uses for the #Include
I 
don't use Include extensively at this point. 
<FONT color=#0000ff face=Arial 
size=2> 
But if 
id were to do what you are suggesting then I'd probably devise a naming scheme 
along the lines of:
<FONT color=#0000ff face=Arial 
size=2> 
Use 
the name of the indicator or some sort of mnemonic as part of the variable 
name:
    <FONT color=#0000ff 
face=Arial size=2>IE.  mac10 = Ma(c,10);
<FONT color=#0000ff face=Arial 
size=2> 
its 
best to be consistent throughout you system. For instance use the same scheme in 
naming your indicatiors, file names, variable names. Keep them unique of 
course.  Using X, A, etc doesn't do anything but save space and can lead to 
confusion when the formula is cold.  I try to be verbose (within reason) 
with the variable names so that it can help me to remember. the challenge 
can come when you have a lot of different variations on a theme.  But 
you can get creative there too with version numbers (if you're really anal you 
can keep a list of variable names, version numbers and a description 
of what they are/do - and if you're creating a lot of these then you better do 
something like this or you'll have a mess and will wind up re-creating things 
you already have).
 
<FONT color=#0000ff face=Arial 
size=2>d<SPAN 
class=796155015-27042003>     <FONT color=#0000ff 
face=Arial size=2>   
<SPAN 
class=796155015-27042003><FONT color=#0000ff 
face=Arial> 
<SPAN 
class=796155015-27042003> 
<SPAN 
class=796155015-27042003> -----Original Message-----From: 
Jayson [mailto:jcasavant@xxxxxxxxxxxx] Sent: Sunday, April 27, 2003 
10:50 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
[amibroker] 10 uses for the #Include

  <SPAN 
  class=045393014-27042003>Dale,
  Am I 
  correct in assuming that any of the variable names are also brought in as 
  well?. example....
  <SPAN 
  class=045393014-27042003> 
  <SPAN 
  class=045393014-27042003>indicator A
  <SPAN 
  class=045393014-27042003>x=Ma(c,10);
  plus 
  a whole bunch of other stuff.......
  <SPAN 
  class=045393014-27042003> 
  <SPAN 
  class=045393014-27042003>indicator B
  <SPAN 
  class=045393014-27042003> 
  <SPAN 
  class=045393014-27042003>x=roc(c,1)+dema(roc(c,10).5);
  plus 
  a whole lot of other stuff..........
  <SPAN 
  class=045393014-27042003> 
  My 
  new indicator...
  <SPAN 
  class=045393014-27042003> 
  a 
  Whole lot of stuff +
  <SPAN 
  class=045393014-27042003>#include indicator A.afl
  <SPAN 
  class=045393014-27042003>#include indicator B.afl
  <SPAN 
  class=045393014-27042003> 
  In 
  this crude example X is a named variable in both indicator A and B. Therefore 
  if I have used X as a variable in my new indicator I could get results other 
  than I have planned. 
  <SPAN 
  class=045393014-27042003> 
  I 
  guess the challenge for me is that I have so little creativity in my naming of 
  variables. When I use #include I need to first cross check all the code to be 
  sure that I have not used any variables with generic names  (x=,y= 
  var1=var2=).  It would be great if #include simply drew the final 
  calculation from the called Afl but that is not my understanding of how it 
  works. You have far more programming background than I, how do you go about 
  naming all your variables to avoid issues like this?
  <SPAN 
  class=045393014-27042003> 
   Jayson 
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: dingo 
  [mailto:dingo@xxxxxxxxxx]Sent: Saturday, April 26, 2003 11:09 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  10 uses for the #Include
  <FONT color=#0000ff face=Arial 
  size=2>Anthony,
  <FONT color=#0000ff face=Arial 
  size=2> 
  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.
  <FONT color=#0000ff face=Arial 
  size=2> 
  <FONT color=#0000ff face=Arial 
  size=2>d
  
    
    <FONT 
    face=Tahoma size=2>-----Original Message-----From: Anthony 
    Faragasso [mailto:ajf1111@xxxxxxxx] Sent: Saturday, April 26, 
    2003 7:40 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
    [amibroker] 10 uses for the #IncludeHerman, 
    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 theIndicator 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: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/) 
    -------------------------- ------------------ Check group FAQ at: <A 
    href="">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: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/) 
    -------------------------------------------- Check group FAQ at: 
    <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    Your use of Yahoo! Groups is subject to <A 
    href="">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: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/) 
    -------------------------------------------- Check group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaqhtml 
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
    Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
    SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
    Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
  SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 
  Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 
Send 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">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.