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

[amibroker] Re: #define directive ?



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Hello,
> 
> The general principle is that AmiBroker is for TRADERS
> not for programmers. Therefore the rule is to keep the number 
language
> contructs LOW so everybody can actually understand and use AFL.

Tomasz,
Nice to read these lines. But, we have to redefine what is simple. I 
read that a lot of my codes posted here are hard to understand, 
although they are nothing but AFL, as close to the definitions as 
possible.
The majority of the questions appear when my code is short, just two 
or three lines and, perhaps, the shortest possible.
It is hard to find the measure of simplicity, especially when you 
address to a beginner.
Some more examples, perhaps, in the future users guide, solving some 
subjects with many repetitions here [various counters, for example], 
would help.
Dimitris Tsokakis

> The framework available now (with looping and user-definable 
functions)
> is 100% enough to write sophisticated trading 
systems/indicators/commentaries.
> And this is what AFL is for.
> 
> Hard core programmers are invited to use ADK to expand in anyway
> their like but I have no intentions to make AFL so complex that
> average user would have troubles understanding it.
> 
> Let's keep it simple.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "Graham" <gkavanagh@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, May 19, 2003 7:03 AM
> Subject: RE: [amibroker] #define directive ?
> 
> 
> Thanks Salil, but it seems over my head for what seems a simple 
exercise. I
> will leave it to those with a fuller understanding of programming.
> 
> Cheers,
> Graham
> http://groups.msn.com/ASXShareTrading
> http://groups.msn.com/FMSAustralia
> -----Original Message-----
> From: Salil V Gangal [mailto:salil_gangal@x...]
> Sent: Monday, 19 May 2003 12:20 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] #define directive ?
> 
> Graham,
> 
> Perhaps you are. You are considering the example I have quite 
literally.
> Following link gives more information about the #define.
> http://www-ccs.ucsd.edu/c/preproc.html#Define%20Directives
> 
> As you'll notice, one can use #define directive in a more flexible 
manner to
> cut down typing. The 45ema example I gave is just a trivial example.
> 
> Regards,
> - Salil V Gangal
> 
> 
> 
> 
> Graham <gkavanagh@xxxx> wrote:
> I may be missing your objective, but can't you already do that in 
AFL
> Then you just need to call it up. I have called it EmaExp which 
just needs
> to be referenced where you want
> 
> Example
> 
> security = C;
> security45ema = EMA(C,45);
> EmaExp = WriteIf ( LastValue(security) > LastValue
(security45ema), "Price is
> above it 45 ema","Price is not above 45 ema");
> 
> Filter=1;
> AddTextColumn(EMAexp,"exp");
> 
> 
> Cheers,
> Graham
> http://groups.msn.com/ASXShareTrading
> http://groups.msn.com/FMSAustralia
> -----Original Message-----
> From: Salil V Gangal [mailto:salil_gangal@x...]
> Sent: Monday, 19 May 2003 11:51 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] #define directive ?
> 
> Graham,
> 
> The #define directive allows one to write in short-hand rather than 
writing
> long code. The compiler substiututes the short-hand into its full 
form
> before executing it.
> 
> As an example, say if one is writing the following again and again 
and again
> in the program ==>
> 
> WriteIf ( LastValue(security) > LastValue(security45ema), "Price is 
above it
> 45 ema","Price is not above 45 ema");
> 
> Then one can just define the short-hand
> 
> #define WRITE45_EMA WriteIf ( LastValue(security) >
> LastValue(security45ema), "Price is above it 45 ema","Price is not 
above 45
> ema");
> 
> And the within the program then one needs to write just WRITE45_EMA 
which
> will mean writing whole of 'WriteIf ( LastValue(security) >
> LastValue(security45ema), "Price is above it 45 ema","Price is not 
above 45
> ema");' !
> 
> This comes in very handy when one has very large code. It cuts down 
typing
> a lot. Languages like C, C++ support #define. Since AFL already 
supports
> #include, which is similar to C, C++, I am wondering if there is 
plan to add
> #define for AFL also ...
> 
> Regards,
> - Salil V Gangal
> 
> Graham <gkavanagh@xxxx> wrote:
> What is #define represent ?
> 
> Cheers,
> Graham
> http://groups.msn.com/ASXShareTrading
> http://groups.msn.com/FMSAustralia
> -----Original Message-----
> From: Salil V Gangal [mailto:salil_gangal@x...]
> Sent: Monday, 19 May 2003 9:40 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] #define directive ?
> 
> Tomasz,
> 
> There is #include in AFL, but AFAIK there is no #define in AFL.
> 
> Are there any plans to add #define as well ? With ever increasing 
length of
> AFL scripts, I'm sure that #define will cut-down lot of typing 
while writing
> AFL scripts.
> 
> 
> Friends,
> 
> Are there any work-arounds for #define in AFL ?
> 
> Regards,
> - Salil V Gangal
> 
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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.
> 
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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.
> 
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> 
> Yahoo! Groups Sponsor
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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/Lj3uPC/Me7FAA/uetFAA/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/