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

[amibroker] Loop thru past N bars



PureBytes Links

Trading Reference Links



Hi,
I am trying to write a for loop to loop thru the past N bars for each
backtesting cycle.

I did something like this:

lastbar = LastValue(BarIndex());

for (n=lastbar; n>=lastbar-20; n--)
{
 check close[n], etc.
}

But it seems that this loop is only run once during the auto analysis
starting at the very last bar of the chart. I want it to start from
the 1st bar in the chart.

Thanks,
Steven.








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/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/