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

[amibroker] Re: I am lostII



PureBytes Links

Trading Reference Links

I am still wobbly on the skates myself but I will stick my neck out.

Yes it could be any letter as long as you are consistent with it in 
the code at hand.
As used in your example it is a actually a counter.
We could use 'i' as the variable in any way we wanted but we don't 
in order to avoid confusing ourselves.
Conventionally 'i' is used as the variable for counters and the 
opening statement in counting type scenarios sets or intialises the 
counter
(say you have been using the counter before, in some languages it 
will still be set to what it was when last used so conventionally it 
is wise to reset or initialise to begin with as well as needing to 
do that anyway to walk through the task at hand).
"i" is generally used for counters because it comes from the word 
integer as in:

start off counting with the integer (i) set to zero;
      do the task and add 1 to 'i' the counter (=1);
      do the task again and add another 1 to the counter (=2);
when you count to 20 you can stop and go on with the next part of 
the job.

Note, that is not what the code example you quoted is doing.
I have only given a very crude example of what "i" is basically all 
about.

The counter in AFL is a little more sophisticated than some others 
but that is another story.


BrianB2.

--- In amibroker@xxxxxxxxxxxxxxx, allansn@xxx wrote:
>
> Steve,
> Your input is appreciated and I will do precisely what you 
stated,but I still would like a reference that would enable me to 
undesrstand what is second nature to you..
> For instance,I dont know what the  "i" stands for in the code.Most 
of the examples reference the letter  "i".I am slowly getting 
postfix and prefix,but its the things like the use of  "i" that 
leave me confused.Could it be any letter??Does  "i" have special 
meaning in programming..I dont want to bother the board members,so i 
am hoping a beginning book may answer the basic questions
> 
> ----- Original Message -----
> From: scourt2000 <stevehite@xxx>
> Date: Sunday, July 23, 2006 6:09 pm
> Subject: [amibroker] Re: I am lostII
> > 
> > > How would one become proficient/knowledgable in writing code 
> > such 
> > as this??? 
> > 
> > By understanding that the Buy[] array is not true ONLY on the 
bar 
> > where the first buy signal occurred in a trade. 
> > 
> > Required reading with 100% comprehension: 
> > 
> > 1. Tutorial in the docs on "Understanding how AFL works" 
> > 
> > When you fully understand this document, it is easy to see how 
> > excessive buy/sell signals get generated.   AFL works on arrays 
of 
> > data and compares the indices of that data in a parallel manner 
to 
> > other arrays of data in your AFL expressions and statements. 
> > 
> > Required understanding: 
> > 
> > 2. How the exrem() function works.  In the code below, Tomasz's 
> > example is walking through the Buy[] array which contains 
> > excessive 
> > buy signals.  He's only interested in the first one that 
triggered 
> > and has to ignore the excessive signals for a respective trade 
> > sequence. 
> > 
> > AFL looks on the surface like a small C-like language and, in 
many 
> > ways, it is.  However, its real power is based upon the 
> > fundamental 
> > understanding that it takes care of processing arrays upon 
arrays 
> > of 
> > data for you "behind the scenes" so you don't have to write a 
> > bunch 
> > of for() loops to get your work accomplished.   
> > 
> > You're getting stopped (mentally) by the code below not because 
of 
> > your inexperience with programming, but because of the two 
> > fundamental things about AFL I mentioned above.   
> > 
> > Steve 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, allansn@ wrote: 
> > > 
> > > Hi Terry, 
> > > Noticed you reccomended these 2 books...I have absolutely no 
> > problem coding in Amibroker,but I do run into problems with 
coding 
> > such as this.. 
> > >  for( i = 0; i < *BarCount*; i++ ) 
> > > { 
> > >  if( priceatbuy == 0 *AND* *Buy*[ i ] ) 
> > >    { 
> > >       priceatbuy = *BuyPrice*[ i ]; 
> > > 
> > > How would one become proficient/knowledgable in writing code 
> > such 
> > as this??? 
> > > Is this AFL???  or 
> > > Is this sort of language inherent in every language? 
> > > Would either of the 2 books you reccomended assist me in this 
task? 
> > > If you or anyone could point me in the direction of 
a "Dummies " 
> > book,that would be great.I would just like to be proficient at 
> > writing/understanding code such as the snippet above 
> > > 
> > > Someone reccomended Beggining Programming for Dummies by 
Wang... 
> > > 
> > > Any thoughts deeply appreciated 
> > > 
> > > Allan 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ----- Original Message ----- 
> > > From: Terry <MagicTH@> 
> > > Date: Sunday, July 16, 2006 9:34 pm 
> > > Subject: RE: [amibroker] Re: I am lost 
> > > > Great book for macro and function coding: 
> > > > http://www.wrox.com/WileyCDA/WroxTitle/productCd- 
> > 0764543717.html 
> > > > 
> > > > Excel for Dummies: 
> > > > http://www.amazon.com/gp/product/1568840500/sr=1- 
> > > > 1/qid=1153099963/ref=sr_1_1/104-1895807- 
> > 1075905?ie=UTF8&s=books 
> > > > 
> > > > 
> > > > 
> > > > -- 
> > > > 
> > > > Terry 
> > > > 
> > > > -----Original Message----- 
> > > > From: amibroker@xxxxxxxxxxxxxxx 
> > [mailto:amibroker@xxxxxxxxxxxxxxx] On 
> > > > Behalf Of MillowenaJuno 
> > > > Sent: Sunday, July 16, 2006 08:36 
> > > > To: amibroker@xxxxxxxxxxxxxxx 
> > > > Subject: Re: [amibroker] Re: I am lost 
> > > > 
> > > > 
> > > > 
> > > > Hi Ton! 
> > > > 
> > > > 
> > > > 
> > > > Is there a Programming Excel for Dummies? 
> > > > 
> > > > 
> > > > 
> > > > Thanks! 
> > > > 
> > > > 
> > > > 
> > > > Millowena 
> > > > 
> > > > 
> > > > 
> > > > 
> > > 
> > 
> > 
> > 
> > 
> > 
> >
>