Registered User Joined: 3/31/2008 Posts: 8
|
Is there a way to change the time frames to either weeks or days when programming past time frames in the PCFs?
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Personal Criteria Formulas are always based on the twenty minute delayed daily data. If your formulas are based entirely on the Open, High, Low, Close and Volumes of weekly bars, it is possible to convert them manually. I'll put the daily version followed by the weekly equivalent:
For the Open, multiply the days ago parameter by 5 and add 4 to get the weekly version.
O = O4
O1 = O9
O2 = O14
For the High, H is replaced by MAXH5 and if there is a days ago parameter in the daily version, multiply it by 5 and separate it from MAXH5 with a '.'.
H = MAXH5
H1 = MAXH5.5
H2 = MAXH5.10
The Low is treated very much like the High. L is replaced by MINL5 and if there is a days ago parameter in the daily version, multiply it by 5 and separate it from MINL5 with a '.'.
L = MINL5
L1 = MINL5.5
L2 = MINL5.10
The Close is probably the simplest. Just multiply the days ago parameter in the daily version by 5 to get the weekly version.
C = C
C1 = C5
C2 = C10
Volume is an interesting case. To get the actual Volume for a weekly bar (in Blocks of 100), you would need to multiply the Average Volume by 5. So V would be replaced by AVGV5 and if there is a days ago parameter in the daily version, multiply it by 5 and separate it from MINL5 with a '.' just like with the High and Low. But add *5 to the end of each weekly version whether or not there is a days ago parameter.
V = AVGV5*5
V1 = AVGV5.5*5
V2 = AVGV5.10*5
That said, if you are just comparing one Volume to another, there really isn't a reason to multiply it by 5 at all:
AVGV5*5 > AVGV5.5*5
Will return the same result as:
AVGV5 > AVGV5.5
Things can get a lot more complicated for weekly versions of some indicators. In same cases, it is not possible to write a weekly version (a weekly TSV for example).
Another option is to Plot your formulas as either Custom Percent True Indicators (for Boolean or True/False formulas) or as Custom Indicators (for value based formulas) and then use Indicator Sorting.
Visually Backtesting Specific Symbols
Plotting Custom Indicators with Examples
Sorting price and indicators by their Actual Value
-Bruce Personal Criteria Formulas TC2000 Support Articles
|