Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/4/2005(UTC) Posts: 31
|
Sorry, can't think of any other way to name this.
What I have in mind would look like a trend line. I want a continous function that would start at a specified date and plot from that date forward to "today". The value displayed would be the dollar value of the close on the start date multiplied each day in succession by the daily factor derived from a user input value for %/year growth.
In other words, it would look like a graph of the daily value of say $1000 in a savings account giving [user defined] percent interest per year. The math is all quite do-able, but I can't figure how to start with being able to place the origin at the date I want to select.
My idea for this is that I don't like comparing myself to the "market"; rather, I want to set goals and see how I currently stand against them.
Ideally, the formula should also decide how many trading days there are until 365 days after the start date... just to be accurate. I think I've seen some stuff Jose has done that I could probably derive this from.
It would seem that an indicator like this may also be used to threshold some other indicators (?)
Any ideas?
Thanx
dc
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
Try the chart indicator below for starters. If more accuracy is required, then a calendar function could be incorporated into the formula.
[code:1:74cfae3f28]
=====================================
Trendline - yearly performance growth
=====================================
---8<--------------------------------
{©Copyright 2005 Jose Silva.
For personal use only.
http://www.metastocktools.com }
{ User inputs }
StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,11);
StYear:=Input("start Year",1800,2200,2005);
growth:=Input("Yearly growth %",
-10000,10000,20)/25200;
{ Date signal }
active:=Year()>StYear
OR (Year()=StYear AND (Month()>StMnth
OR Month()=StMnth AND DayOfMonth()>=StDay));
signal:=active AND Alert(active=0,2);
{ Close at date signal }
signalVal:=ValueWhen(1,signal,C);
{ Yearly growth % trendline }
trend:=signalVal*(1+BarsSince(signal)*growth);
{ Plot on price chart }
trend
---8<--------------------------------
[/code:1:74cfae3f28]
jose '-)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
This thread continues here.
jose '-)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/7/2005(UTC) Posts: 1,346
|
hey dc.... thats a neat idea you had.... after using the downloader to create a security representing the savings account and editing the data to reflect the 1000$ daily balance , jose's deal can be ploted way into the future.... it would serve as a good goal, just as you mentioned......h
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/4/2005(UTC) Posts: 31
|
Jose, that is exactly what I was trying to figure out.
Thanx
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.