PureBytes Links
Trading Reference Links
|
Hi,
I'm trying to plot a curve from the first stock price to the last
stock price based on the compound rate of growth. So far I've been
able to determine the initial and end values and calculate the rate of
growth, r (see below). When I try to establish the "trendline", I'm
getting a syntax error, as noted below.
I don't see where the problem might be. If anyone can advise I would
appreciate it.
Thanks,
Wayne
//Determine total bar count and initial and ending values
n=LastValue(Cum(1));
FV=LastValue(ValueWhen(BarIndex()==BarCount-1,C));
SV=LastValue(ValueWhen(BarIndex()==0,C));
//Calculate the exponential rate of growth (constant)
//FV=SV(1+r)^n
r = exp( (1/n) * log(FV/SV) ) - 1;
//Calculate the trend line using the rate of growth
//Trendline = SV(1+r)^n;
//Getting syntax error on this line
Trendline = exp(Cum(1) * log(SV(1+r)));
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.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/
|