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

Re: [amibroker] Re: BarsSince(Buy)



PureBytes Links

Trading Reference Links

>> Now, note that EVERY SINGLE IMAGINABLE system that requires
>> so called "BarsSince( entry)" can be coded the VERY SAME WAY
>> and it does not involve *ANY* talent to write such basic code.
> 
> 
> Tomasz,
> 
>> Now, note that EVERY SINGLE IMAGINABLE system that requires
>> so called "BarsSince( entry)" can be coded the VERY SAME WAY
>> and it does not involve *ANY* talent to write such basic code.
> 
> I'm worried that more and more of your replies ends with similar remarks.
> I don't understand why sincere questions/requests irritate you.

I don't think that there are "more and more" replies because this is
the ONLY one remark of this kind posted in last few months.

As for the reason of irritation: over and over, I ask people to read carefully "Understanding AFL"
http://www.amibroker.com/guide/h_understandafl.html 
document from the Tutorial part of User's Guide which has key importance
for every AFL user. Unfortunatelly I find that people either do not read it at all
or do not read it carefully enough. *IF ONLY* "understanding AFL" document
was read carefully one would NOT ask questions like ones in the post in question.
If you were to repeat yourself so many times as I did you would be irritated as well.
Fortunatelly, Marcin (support representative) is doing great work on support channel 
and I almost do not touch support e-mails nowadays.

After reading the document it is clear that array statements process all array values at once
and if you reference to the same array within single LINE of code you are
getting the values that were in the array BEFORE entire line was executed.
It is just enough to read this single relatively short document to understand this.

Example:

Buy = 0;          // Line 1
Buy = 1 + Buy; // Line 2

In Line 2 the value of 1 is ADDED TO THE ENTIRE ARRAY at once. So you effectivelly
get 

Buy = 1 + 0;

There is NO interation or recurrsion here.
==========================

If you want to "iterate" (in this case cumulate the value) you have to code the iteration:

Buy = 0;
for( i = 1; i < BarCount; i++ )
{
   Buy[ i ] = 1 + Buy[ i - 1 ];
}


> We rely on AmiBroker because it allows us to test strategies without
> being a programming genius like yourself. 
> Otherwise, we would all be programming in C++.
No, I don't think so. 
I am using AFL for my own purposes too even considering that I can write the same in C++.
Why I am using AFL? 
Because it is way easier and quicker to program trading strategies and indicators.


> 
> I admit I don't have *ANY* talent and therefore I feel it would be
> nice if "BarSince(Entry)" did the LOOPING for me without my writing
> the code everytime I need it.

You may "feel that it would be nice" but I can ensure you that it won't.
The reasons are two-fold:
1. MS has only "BarsSince" + PREV and NO looping and this makes it limited
because you can only do what Equis programmers thought you would need to do.
Hundreds of MS users came to AB just because their own needs exceeded "fixed paths" that 
MS came up with.

2. Tradestation has IMPLICT looping - and this makes it limited too because
again TS creates main LOOP FOR YOU and you have NO CONTROL of this "main loop".
Again programmers thought for you what you would need.

AmiBroker does NOT assume that you will use only this or that. 
It does not assume particular coding style.
It gives you FREEDOM.
If your case requires looping - you can write a loop, 
if your case requires MULTIPLE nested loops - NO problem - you can write them as well,
if your case does not need loop - you don't need to use it.

That is what makes AB powerful - the limit is only YOUR skill and imagination.

Best regards,
Tomasz Janeczko
amibroker.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/