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

[amibroker] For Loop Question



PureBytes Links

Trading Reference Links









Question and Problem:

 

FOR/NEXT Loops in old Basic code had an increment variable:

 

FOR(X=1,20,2) <<-- go from 1 to 20 incrementing by 2

NEXT X

 

The new FOR Loop says:

for( initializer_part; conditional_expression; iterator_part
) statement;

 

<span
>So dumb me, wanting to try the code
example:

<span
> 

<span
>Plot( Close, "Price", colorBlack,
styleCandle );

<span
>for( Range = 15; Range < 100; Range++ )

<span
>   Plot( EMA( Close, Range ),
"MA"+WriteVal(Range,0), colorRose + Range % 8, styleNoLabel );

<span
> 

<span
>But wanting to make the EMA ribbons
further apart than just an increment of 1, changed the statement to

<span
> 

<span
>For(Range=15; Range < 50, 5 )

<span
> 

<span
>And promptly locked up the program.

<span
> 

<span
>Questions:

<span
>1.  The previous old style error box
that AB would display did not display; should it? Or is it gone?

<span
>2.  How do you increment a for loop
with something other than 1?

<span
>3.  Without making me buy a C++ book,
what are the properties of the "++" operator?

<span
> 

<span
>Ken










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: 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.