Discussions
»
Special Interest Groups
»
Advanced Coding Techniques
»
Comparing two stocks from a choosen date as a index starting at 100 that day for both stocks
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/16/2006(UTC) Posts: 39
|
I try to write a formula which compares stock with a another stock or an index by setting both stocks at a (index)value of 100 at a specific date (or a specific number of days ago).
The problem is that there is a Lastvalue function but not a Firstvalue(loaded) function, unless I did not look well into the help function. When such a function could be used, the left side of the graphic could be defined to start alway at 100 (at the first loaded date in a graphic). X:= c/"Firstvalue(c)"*100
Another way to create such a function is by asking (via the input function) how many days (X) to go back from the LastValue known. Then read the closing price etc. at that specific day, divide it each by the closing price and you get an idexed plot line of the security starting at Day X with 100.
Who can help me to sort this out?
Daydreamer.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 6/3/2005(UTC) Posts: 64 Location: India
|
HI,
try using this in explorer
this will solve u r query for start date
Day1 := 11;
Month1 := 05;
Year1 := 2006;
100 * (CLOSE - ValueWhen(1,DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1, CLOSE))/ ValueWhen(1,DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1,CLOSE)
|
|
|
|
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)
|
Anton, you may be interested in the URSC tool-kit - it plots true Relative Strength % values between any two securities, starting either at x calendar days back or at a specific past date (user-defined).
jose '-)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 6/3/2005(UTC) Posts: 64 Location: India
|
sorry, i thought that u asked for comparing a stock between two dates...... and i gave formula for that. sorry mate...........
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Special Interest Groups
»
Advanced Coding Techniques
»
Comparing two stocks from a choosen date as a index starting at 100 that day for both stocks
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.