Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 3/28/2005 Posts: 23
|
Hi Guys,
I am trying to emulate an indicator that exists in another package (but I'd much prefer to use Telechart) so perhaps you can tell me how I can set something up like it in Telechart. What I want to do is to calculate the relative performance of various ETF's by dividing the last 120 days of price close data into 4 groups of 30 days each with equal (normal) weighting for the first 3 groups of 30 days and then double weighting the most recent 30 days. So basically what I'm looking for is the relative performance of the ETF's (comparatively speaking) by comparing their relative performance over the past 120 days while double weighting the most recent 30 days of that overall 120 day performance period. Please let me know if there's a way I can do this with Telechart. Thanks, Doug
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
Not sure I understand. Is this close?
1. Calculate price performance for days 91-120 2. Calculate price performance for days 61-90 3. Calculate price performance for days 31-60 4. Calculate price performance for days 1-30 and multiply by two. 5. Add results of steps 1-4, then divide by 4.
That sounds like what you're describing, though it doesn't sound like relative performance. If I got it wrong, please clarify, and we should be able to help you.
- Doug Teaching Online!
|
|
Registered User Joined: 10/7/2004 Posts: 286
|
Here's an idea: it adds the performance of four 30day time frames plus re-adds the current 30 day time frame performance. Or if you refine it a bit by doing the same by percentage return. i.e ((C-C29)/C29)+....etc
(C-C29)+(C30-C59)+(C60-C89)+(C90-C119)+(C-C29)
jynkin
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Relative to what, netedge?
- Craig Here to Help!
|
|
Registered User Joined: 3/28/2005 Posts: 23
|
Per the questions from my inquiry. To Doug H. - yes I think you've got the gist of what I'm after. The description given to me by the makers of the other pkg. is as follows: "It looks at the last 120 days closing prices of data and breaks them into quarters. A percentage change is calculated on each quarter and then the percentage changes are averaged, with twice the weight placed on the most recent quarter's data." Thus what I am seeking is the performance of the stock over the past 120 days weighted towards the recent quarter. They call this their relative strength short term report. My purpose for this would be to compare several instruments against one another for stock (ETF) momentum selection. I'm wondering with Doug H's calculation if we should be dividing by 5 or by 4 in your step 5. Perhaps jynkin has it with the percentage return example but since I'm not very familiar with the PCF formula syntax I can't quite grasp it?
|
|
Registered User Joined: 10/7/2004 Posts: 286
|
My above example used 30 days for each "quarter" as you suggested, but each calendar quarter has approximately 63 trading days. And each year has 63 x 4 or ~ 252. So my above format for a whole years worth of data would be:
(((C-C62)/C62)+((C63-C126)/C126)+((C127-C189)/C189)+((C190-C252)/C252)+((C-C62)/C62))/5
That should give you the average percentage return for each of the last four quarters with the current quarter figured in twice.
jynkin
|
|
Registered User Joined: 10/7/2004 Posts: 286
|
This is the percentage return formula for the four quarters based on a 120 period. I think this is really what your looking for rather than the 252 day (full year) formula.
(((C-C29)/C29)+((C30-C59)/C59)+((C60-C89)/C89)+((C90-C119)/C119)+((C-C29)/C29))/5
jynkin
|
|
Registered User Joined: 12/18/2004 Posts: 180
|
QUOTE (netedge)
So basically what I'm looking for is the relative performance of the ETF's (comparatively speaking) by comparing their relative performance over the past 120 days while double weighting the most recent 30 days of that overall 120 day performance period.
I take it you probably already know this, but just incase, thought I'd remind you. You probably have your watchlist to scan set on ETFs. Be sure to use List Rank, not Market Rank on the Range Selector. I used to think it was the other way around (after all, they call it "Market Rank", when they mean "All items in system"!?!?). This will give you relative performance rank among ETFs.
|
|
Registered User Joined: 12/18/2004 Posts: 180
|
Let me throw one more thing in here, I think Jynkin's formula is what you're looking for, except that it does not look at full 30-day intervals. (C-C29)/C29 only looks at 29 days, because it takes two days to make a price change. That would be like using (C-C)/C to look for a 1-day price change. Right?
|
|
Registered User Joined: 10/7/2004 Posts: 286
|
Stmjd74, Yes.....I guess you are correct that my above formuala only compares 29 day intervals...and actually eliminates 3 other transistion intervals from consideration. I believe the below formula takes everthing into account.
(((C-C30)/C30)+((C30-C60)/C60)+((C60-C90)/C90)+((C90-C120)/C120)+((C-C30)/C30))/5
jynkin
|
|
Registered User Joined: 12/18/2004 Posts: 180
|
Looks good to me. I can't think of a better way to do it. The formula puts 40% of the weight on the latest 30 days and 20% on all the other 30-day intervals. Notice that you could shorten it down just a tad:
100*((C-C30)/C30*2+(C30-C60)/C60+(C60-C90)/C90+(C90-C120)/C120)/5
|
|
Guest-1 |