When writing a Custom Condition I am asked for the time frame. If I select one day, will this Custom Condition also be valid if I change the time frame on the chart to other than one day?
I.E will it work with one week, one hour. 15 minutes etc. or is it necessary to write the Custom Condition for each time frame I plan to view?

To Bruce and Administration,
Thank you for resolving this issue.
This issue is similar to the one that comes up from time to time regarding moving averages, where an argunment is made to offset the moving average by one half the number of days in the average.
For convenience the default in the MA case is to plot the MA value on the last price bar in the series, as you are now making available for the DPO.
The earliest reference I could find to offsetting the moving average was ihn the JR Hurst Book, The Profit Magic of Stock Transaction Timing published in 1970. Although he does not refer to the DPO by name in that book, he does point out how that information can be of help in identifying cycles.
Dan

Hi Bruce,
As an example, think of a stock that has always traded at the same price. For the last 20 trading seesions the price has always closed at $50.
Today, the price closes at $75. Using the DPO calculation with a 14 day period and the formula
DPO = Close  Simple moving average [from (n / 2 + 1) days ago]
the value of the DPO would be zero for all days previous to today, which of course is correct since there was no cycle, and would have a value of 25 today, indicating a cycle change.
Using the forward looking formula others have suggested, as I understand it, the result would be shifted back 4 days giving a DPO of 25 four days ago, obviously a method to look into the future.
Dan

Hi Bruce,
Thank you for your thoughtful reply, however there are some things that appear to have changed . You made reference to Technical Analysis from A to Z by Steven Achelis.
Here is what is written in the online version of Technical Analysis from A to Z published by Equis in 2003.
Calculation
To calculate the Detrended Price Oscillator, first create an nperiod simple moving average (where "n" is the number of periods in the moving average).
Now, subtract the moving average "(n / 2) + 1" days ago, from the closing price. The result is the DPO.
DPO = Close – (Moving Average”((n/2) + 1)” days ago
Please note that he refers to days ago, not the future.
One of the messages you referred me to mentioned Wikipedia. Here is the article from Wikipedia.
The detrended price oscillator (DPO) is an indicator in technical analysis that attempts to eliminate the longterm trends in prices. Leaving shortterm trends, the indicator allows immediate overbought and oversold levels to be found more effectively.
The DPO is calculated by subtracting the simple moving average over an N day period and shifted N/2+1 days back from the price.
To calculate the Detrended Price Oscillator:
Decide on the time frame that you wish to analyze. Set n as half of that cycle period.
Calculate a simple moving average for n periods.
Calculate (n / 2 + 1)
Subtract the moving average, from (n / 2 + 1) days ago, from the closing price:
DPO = Close  Simple moving average [from (n / 2 + 1) days ago]
Rather than go on listing sources that refer to using the MA of n days ago, suffice it to say that the way Stockfinder uses the DPO does not allow its value to be referenced as of the day you wish to trade. Nor does it lend itself to easy backtesting.
FreeStockCharts, another Worden program uses the detrended price oscillator differently from StockFinder and allows for current information to be displayed.
I realize that StockFinder is an enormously flexible program that allows for the creation of indicators to perform in any way desired. What I am asking for is a default set up for DPO that allows the indicator to be used in back testing and in current selection of stocks. Using the present arrangement if I set the DPO to 50 periods and used daily bars, the most recent information would be 26 trading days ago, more than one month. Of what benefit can that be?
If it is not within your purview to make this change to the program, please let me know who to contact. Thank you again for your help.
Dan

to jas0501
Thank you for the code. That takes care of the immediate problem for me, but does nothing to iresolve the issue with Stockfinder.
Stockfinder should correct the code so that when anyone uses DPO it returns the correct values.
If a problem is known to exist and it is not repaired how can any indicator be trusted. If someone now tries to use the DPO, they will receive wrong information. If they trade based on this wrong information they may make wrong decisions. If a back test is run using the DPO as one of the parameters, the results will be erroneous.
It is difficult enouh to find that a problem exists. But to find a problem and bring it tio the attention of Stockfinderand not have the problem corrected is not good.
Dan

Hi,
I have been in contact with Support about a problem with the Detrended Price Oscillator (DPO).
Here is my last message to Support as well as the email that was sent to me in response to earlier correspondence. In the first reply to me, I was told by support that they had to refer to the programmers. In a message just received from J.C. Bryan, he wrote "
The trainers are the people that write the conditions, rules, formulas and calculations for all the Worden products"
Here is the earlier correspondence.
Thanks for getting back to me. Most sources that I have seen are in agreement with the definition you supplied, printed in a simplified manner here.
1. Decide on the time frame that you wish to analyze. Set n as half
of
that cycle period.
2. Calculate a simple moving average for n periods.
3. Calculate (n / 2 + 1)
4. Subtract the moving average, from (n / 2 + 1) days ago, from the
closing price:
DPO = Close  Simple moving average [from (n / 2 + 1) days ago]
Worden Support wrote: It's just the current Price minus the Simple Moving Average of Price using the Period of the DPO for the Moving Average Period offset (Period / 2) + 1 Bars to the left (meaning the Moving Average uses future data in its calculations which is why it ends before the rightedge of the Chart).
The explanation in parenthesis is incorrect. If we are using the current price minus the moving average of X bars ago, there is no future data involved and there is no reason for it to end X number of bars before the right edge.
However, even using the definition as given, Stockfinder does not come up with the answer shown in your formula.
Let's look at a specific example. Assume we want a 10 day DPO on COMPQX.
This according to the formula shown above would be:
Price at the close on 10/2/09 minus the 5 day simple moving average of price offset 6 days to the left.
The values are 2048.11  2131.246 or negative 83.136. Stock finder shows the last DPO as of 6 days ago of negative 2.096924.
This is a flaw in the information that is offered in your program.
Instead of referring me to your trainers, why not have your programmers fix the problems. We, who use the program, depend on the program for correct information. The messrs Worden pride themselves on the quality of their programs.
I am not interested only in a workaround for myself, but in having the problem corrected.
What is the next step in addressing this so that the problem is corrected in Stockfinder, not just on my desk.
Regards,
Dan
Original Message
From: Worden Support [mailto:Support2@Worden.com]
Sent: Thursday, October 01, 2009 1:44 PM
To: delta1@cfl.rr.com
Cc: Worden Support
Subject: Worden Support
Mr. Chiswick,
We inquired about our DPO calculation with our Trainers. They have advised that they can tell you how DPO is calculated in StockFinder. It's just the current Price minus the Simple Moving Average of Price using the Period of the DPO for the Moving Average Period offset (Period / 2) + 1 Bars to the left (meaning the Moving Average uses future data in its calculations which is why it ends before the rightedge of the Chart). Odd Periods are rounded down for purposes of determining the offset.
They're not yet sure how StockFinder is performing that calculation.
They
are still awaiting that information.

Is there a way to print out all the indiicators as well as their brief descriptions?
Is there a way to determine how these indicators are calculated?

Thank you for your help.
Is there an index of previous posts?
It is difficult to scroll through all the previous posts to determine if a question has been previously answered and an index would make it possible to hone in on areas of interest.
Dan

For use in Blocks
I'd like to create a channel with the upper line of the channel equal to a moving average of the daily highs and the lower line of the channel equal to the moving average of the daily lows.
