Re: [amibroker] Is it good practice to break a huge afl script to many include files?

 

Hi TJ

I will try to adjust my code the way you suggest.  Yes, I was following the c/c++ model.  This is how I have always been programming.

>>>
I don't know what you are doing but 15000 lines in AFL?
Are you doing some kind of machine learning or neural networks?
If so, personally I would put that in DLL.
<<<
I am trying to program the entire price action theory in AFL.  The 1500 lines are a basic algorithm for Support/resistance levels.  It needs fine tunning, like when a line is invalidated etc.  By the time I finish with momentum and all other ideas, I expect it to grow a lot.

Right now the code runs in 3 analysis windows (for 3 timeframes), through static vars the data is communicated to 3 chart windows (to draw the 3 time frames) and then there is a fourth chart that plots the signals.

Thank you for the suggestions.

Bob

 

On Thu, Feb 18, 2016 at 2:55 PM, Tomasz Janeczko groups@amibroker.com [amibroker] <amibroker@yahoogroups.com> wrote:
 

Hello,

Thank you very much for your e-mail.

It is wrong approach. AFL is not C/C++.
C/C++ programmers tend to create hundreds of small files.

Don't do that in AFL. One, two #included files are good choice.

In AFL #includes are intended to be used only for
well-tested and already tested "library" functions that are used in MANY formulas.
(say you have an indicator that you want to use in many places).

Any under-development code should be in the main file.
That simplifies a lot of things.

Managing 15000 line file is not a problem. There is a code folding,
bookmarks, etc.

I don't know what you are doing but 15000 lines in AFL?
Are you doing some kind of machine learning or neural networks?
If so, personally I would put that in DLL.

Best regards,
Tomasz Janeczko
amibroker.com



On 2016-02-18 09:30, 'B. Pitatzidis' bobptz@gmail.com [amibroker] wrote:
I am trying to make my scripts very modular.  Small main programs with lots of functions. 

Actually my main afl sript is less than 20 lines.  Right now my project totals about 1500 lines and I estimate that it will grow to more than 15.000 lines.

Is it a design flaw to use many #include files?  I find it very impractical to have a huge afl script with 15.000 lines.

The documentation of the #include warns about a drawback of using #include:
"Note 2: using #include command may slow down formula execution even considering the fact that AmiBroker tries to include only once and cache pre-processed text"
https://www.amibroker.com/guide/afl/_include.html

I have not benchmarked it, but I hope the delay is not much.

Lately I discovered that the new AB debugger will not allow breakpoints in included files.  This rules out the use of the debugger for my kind of design. 

This made me think that I might be doing something wrong.





__._,_.___

Posted by: "B. Pitatzidis" <bobptz@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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


.

__,_._,___


EmoticonEmoticon