Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 2/2/2005 Posts: 9
|
My brother sent this to me. Can you help me put this into custom indicator?
Calculation:
The first step is to determine the appropriate timeframe for analysis. One-half of this time
period should be used as the look back period [n] for the SMA window. Next, calculate a SMA of
closing prices for an n-period look back window. The third step is to determine the number
of periods (e.g., days) to shift the SMA back in time, using equation [1]:
[1] p = INT [ (n / 2) + 1]
where:
INT is the integer function;
p is the number of periods to shift the SMA back in time, and the remaining term was defined above.
If the calculation [(n / 2) + 1] results in a non-integer value, the fractional part is dropped and
the integer number is used. The final step is to calculate the difference between the current
closing price and the SMA, using equation [2]:
[2] DPO = Ct - SMA[n]t-p (for n periods)
where:
DPO is the Detrended Price Oscillator;
Ct is the closing price at time t; and,
SMA[n]t-p is the simple moving average for n periods shifted back p periods in time.
Thanks,
Farr West
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
Farr West:
Here is some information I found in the forum on this topic. See if this helps you.
Detrended price oscillator
- Doug Teaching Online!
|
|
Registered User Joined: 2/2/2005 Posts: 9
|
Doug,
Are you saying that "C-AVGC15.8" will do what that more complex formula I posted will do?
Farr West
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
I can't say that for sure. When I did a forum search and found that thread where someone had asked for the Detrended Price Oscillaor, I saw that Craig had done some poking around and suggested the C-AVGC15.8 formula. When the original questioner posted back, he said that worked for him.
If you plotted the simpler formula given, would you know by looking if it looked correct (like the original questioner did)? If so, plot the formula and take a look.
In the meantime, I will alert the other trainers to see if any of them have any other insight into this indicator. I see that your explanation includes some if-then logic, which TeleChart doesn't do outright. However, there are ways in the program to simulate some if-then logic.
Let's see if the other trainers have any input.
- Doug Teaching Online!
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Unless I missed something, yes.
Your post explains that the indicator is a plot of price less a simple moving average as of X days ago where X is half as long as the average's period plus a day. You can set the average to anything and then change the X days ago to half the period of the average plus one. Here are some examples:
C-AVGC20.11
C-AVGC6.4
C-AVGC30.16
- Craig Here to Help!
|
|
Registered User Joined: 2/2/2005 Posts: 9
|
Thanks Craig and Doug. Now this makes sense. However, it does bring another question: Is there a way to determine which parameters are best to plug in. In other words, why would I choose 6 over 15 or 20 over 30, or vice versa. I am looking more at short-term trades, rather than long-term trades.
Regards,
Farr West
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
Farr West:
It has been our pleasure to help you. However, your new question has ventured into an area that we trainers are unable to tread. I would read up on the Detrended Price Oscillator out on the web to get a feel for what settings might work for you and your trading style. I would also try various settings in TeleChart to see what results you get. Perhaps plot two or three in the same window and see how they look.
Another option here in the forum is to go to the Stock and Market Talk forum and post a question there about how others might be using the DPO. Other people who use these forums are often quite willing to share their ideas and expertise.
Good luck using the DPO!
- Doug Teaching Online!
|
|
Guest-1 |