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

[amibroker] Re: Which function gives "current portfolio value"?



PureBytes Links

Trading Reference Links

Here is what  I am trying to do:

Lets say that I have TickerX and tickerX has 10 years of data....I would
like to display a line chart of every year that is in the data in the same
Window....

I can currently do it with the following code:

Year1 = BarIndex() - ValueWhen(LastValue(DateNum() )-10002 ==
DateNum(),BarIndex() );

Year1 = LastValue( Year1);

Year2 = BarIndex() - ValueWhen(LastValue(DateNum() )-20002 ==
DateNum(),BarIndex() );

Year2 = LastValue( Year2);

Plot( Close,"present year",colorBlue);

Plot( Ref(Close,-Year1),"previous year", colorRed);

Plot( Ref(Close,-Year2),"2 years ago", colorGreen,styleLine);

Would it be possible to do it with a loop, therefore every year that is in
the database will be displayed ?



Thanks in advance

Anthony




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/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/