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

RE: [amibroker] Re: Displaced MA



PureBytes Links

Trading Reference Links

Not certain what you mean
Barcount is the count of the number of bars in your chart. It is same as
saying Lastvalue(cum(1)) or Lastvalue(Barindex()+1)
So the line
for (i=1;i<BarCount;i++)
looks at the 2nd bar (1st bar is zero) to the last bar of the data.

I would suggest your strange results could most likely be in the formulae
you are using within the code. Can you post the full code?

Just looking at the line I can see I may be wrong above and if you have put
this as a full line in the code

statement (for (i=1;i<BarCount;i++))

Then you do not use the statement part.
There are examples in the help files for using the if for etc statements 
Amibroker Formula Language - AFL Reference Manual

You do not need to define a variable or array before using it, except to
define the first value

Here is one example from the help file as above
myema[ 0 ] = Close[ 0 ]; 
for( i = 1; i < BarCount; i++ ) 
{ 
    myema[ i ] = 0.1 * Close[ i ] + 0.9 * myema[ i - 1 ]; 
}

Hope this helps


Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: mhtrading2003 [mailto:hennigmichael@xxxxxxxxxxx] 
Sent: Friday, July 09, 2004 2:46 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: number of bar limit for using for statement

--- In amibroker@xxxxxxxxxxxxxxx, "mhtrading2003" 
<hennigmichael@xxxx> wrote:
> Hello,
> 
> does anybody know if there is a number of bar limit for 
using "for" 
> statement (for (i=1;i<BarCount;i++))
> because I get strange results when backtesting with a formula 
using 
> this for statement.or is there a function lile dim in basic?
> 
> regards 
> Michael




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



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/