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

Re: [EquisMetaStock Group] exploration annual returns



PureBytes Links

Trading Reference Links




Several methods, depending upon what 
you view as an annual return.
 
------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------
Annual Return as % increase in from 
today to 250 trading periods ago.
------------<FONT 
face=Arial size=2>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------
<FONT face=Arial 
size=2> 
APPROXIMATION - return in last 250 
days.
 
Limitations:
250 trading periods may be incorrect 
if:
(i).    There are 
less than 250 trading periods (eg. illiquid stock) and your data provider 
doesn't pad no-trade days.
<FONT face=Arial 
size=2>(ii).   <FONT face=Arial 
size=2>Watch for data providers that pad for public holidays too.  This 
will make your 250 somewhat different.
 
Put the following in colA of your 
exploration:
roc(c,250,%)
 
So the following might be 
better:
 

------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------
Annual Return as % increase from 
today to the last trade exactly one year ago
------------<FONT 
face=Arial size=2>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------
<FONT face=Arial 
size=2><FONT face=Arial 
size=2><FONT face=Arial 
size=2><FONT face=Arial 
size=2>put the following in 
colA:
<FONT face=Arial 
size=2><FONT face=Arial 
size=2><FONT face=Arial 
size=2><FONT face=Arial 
size=2><SPAN 
class=q0> 
dateval := Year() + Month()/12 + 
DayOfMonth()/365;
oneyearago := dateval 
-1;
100*((C/ValueWhen(1,dateval <= 
lastvalue(oneyearago) and ref(dateval,1) > 
lastvalue(oneyearago),C))-1);
 
Limitation:
This only works for the last year in 
the chart.  You can get around this with fancy PREV statements but you 
stated you only needed this for an exploration (which is the final day in the 
chart), so that's the only bar you're interested in.
<SPAN 
class=q0><FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0><FONT face=Arial 
size=2>------------

Annual Return as % increase in from 
a given date to today
------------<FONT 
face=Arial size=2>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------

 
The date routines in Metastock are 
primitive but with a bit of thought you can get around the 
limitations.
 
eg.  Start of new year is first 
trading day in January
put the following into 
colA:
startoftradingyear := 
<FONT face=Arial 
size=2>Ref(Year(),-1)<YEAR();
<FONT face=Arial 
size=2>100*((C/ValueWhen(1,startoftradingyear,REF(C,-1)))-1);
 
eg. Start of new financial year is 
first trading day in July (eg Australia)

put the following into 
colA:
<FONT face=Arial 
size=2>startoftradingyear := REF(MONTH(),-1)=6 AND 
Month()=7;100*((C/ValueWhen(1,startoftradingyear,REF(C,-1)))-1);
 



------------<FONT 
face=Arial size=2>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------
Annual Return for previous 
year
<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0><FONT face=Arial 
size=2>------------
<FONT face=Arial 
size=2>startoftradingyear := <FONT face=Arial 
size=2>Ref(Year(),-1)<YEAR();
<FONT face=Arial 
size=2>100*((ValueWhen(1,startoftradingyear,REF(C,-1))/ValueWhen(2,startoftradingyear,REF(C,-1)))-1);
<SPAN 
class=q0> 
<SPAN 
class=q0>Limitation:
You must have at 
least two years of history for the above to work.
<SPAN 
class=q0><SPAN 
class=q0> <SPAN 
class=q0><FONT face=Arial 
size=2>
<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0><FONT face=Arial 
size=2>------------
Common pitfalls in date 
processing:

------------<FONT 
face=Arial size=2>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------------------<SPAN 
class=q0>------------<FONT face=Arial 
size=2>------------
 
1.    SINGLE 
PRECISION
Due to Metastock's use of single 
precision floating variables, you cannot expect an accurate answer from 
something like:
yyyymmdd := 
year()*10000+month()*100+dayofmonth();
 
(for fun, try plotting it... marvel 
at how it sometimes doesn't increment!)
 
You'll notice 
how:
dateval := Year() + 
Month()/12 + DayOfMonth()/365;
always 
increments...
<FONT face=Arial 
size=2> 
2.    EXPLORER 
OPTIONS
 
Make sure you set your Explorer 
Options to at least 300 records tested.  More if you're going over multiple 
year boundaries.
 
 
Hope the above helps 
you.
 
If it hasn't just ask 
away.
<FONT face=Arial 
size=2> 
Cheers,Richard.Norgate Investor Services- 
Premium Quality Stock and Futures Data for  Australian, Asian, European 
& US Markets -<A 
href="">www.premiumdata.net
<FONT face=Arial 
size=2> 






Yahoo! Groups Sponsor


  ADVERTISEMENT 









To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.