Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

time frame referencing Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
commtrd
Posted : Friday, May 11, 2007 6:42:56 PM
Registered User
Joined: 5/8/2006
Posts: 6
How would I write a pcf that references specific time frames such as weekly only? Example: a simple MA crossover written so that it will return true on a weekly chart when say a 5 ma crosses a 20 ma; NOT just a 5 day chart but a true weekly chart where the bars are formatted from Mondays open to Fridays close.

I copied a pcf which seems to only return correct indication on daily charts but does not work correctly on the weekly charts. I thought that it would automatically adjust to the time frame of the chart it was plotted on but that does not seem to be the case here. It is very important to be able to use the concept of interfacing time frames and write a pcf to utilize the concept functionally accurately.

Thanks in advance for any help on this.
Bruce_L
Posted : Friday, May 11, 2007 7:37:40 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
I do not know of an automated way to write calendar week based formulas using TeleChart. If you want to use calendar weeks, you may wish to try Personal Chartist and BackScanner for Blocks Player.

Personal Criteria Formulas are always based on Daily Data. It is frequently possible to use daily formulas to test for conditions on multiple day per bar charts. There are many examples in the forums, but in all cases, a Weekly Chart would be a 5-Day per bar chart not a Calendar Week Chart (I have not provided any examples in this topic as they do not meet your stated conditions).

Another option is to create Custom Indicators or Custom Percent True Indicators and use them with Indicator Sorting. This would also not use Calendar Weeks or Months. You may wish to review the following:

Handy PCF example formulas to help you learn the syntax of PCFs!
How to create a Personal Criteria Forumula (PCF)
Plotting Custom Indicators with Examples
Visually Backtesting Specific Symbols
Sorting price and indicators by their Actual Value

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
commtrd
Posted : Friday, May 11, 2007 7:40:39 PM
Registered User
Joined: 5/8/2006
Posts: 6
I tried using an equivalent number of days
(25 for the 5) and (100 for the 20) to simulate the weekly chart plot and that seemed to work OK as long as I only run the scan on a weekend.

Still want to find out if it is possible to reference different time frames when generating pcf's for use in scans. My use of indicators is very limited to only when it is too difficult to write formulae that would identify specific price bar patterns. I trust price bars a lot more than indicators.
commtrd
Posted : Friday, May 11, 2007 7:51:50 PM
Registered User
Joined: 5/8/2006
Posts: 6
Thanks for the input Bruce.

I think the modification of using correct number of days times the desired ma length will get me there for what I am trying to do. Basically scanning for a proxy of a certain price bar / close relationship pattern which is statistically accurate to where traders would not even believe how accurate the pattern is for anticipating test points accurately and structuring my risk. I just cannot go through a couple of thousand stocks every night realistically so the list needs to be trimmed down somewhat.

I love using TC2007...it is a wonderful tool. I have much more experience with TradeStation but the scanning capabilities with TC2007 are a great tool TS would have a tough time duplicating. EasyLanguage is anything but easy...
Bruce_L
Posted : Saturday, May 12, 2007 8:27:26 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The technique mentioned in your Friday, May 11, 2007 7:40:39 PM ET post can be a good approximation. The Moving Averages of a Weekly chart in TeleChart would actually be based on the Prices from one out of five trading days however. The following would better match the charts:

Weekly (5-Day) SMA5 xUp SMA20:

C + C5 + C10 + C15 + C20 > (C25 + C30 + C35 + C40 + C45 + C50 + C55 + C60 + C65 + C70 + C75 + C80 + C85 + C90 + C95) / 3 AND (C5 + C10 + C15 + C20 + C25) <= (C30 + C35 + C40 + C45 + C50 + C55 + C60 + C65 + C70 + C75 + C80 + C85 + C90 + C95 + C100) / 3

Weekly (5-Day) SMA5 xDown SMA20:

C + C5 + C10 + C15 + C20 < (C25 + C30 + C35 + C40 + C45 + C50 + C55 + C60 + C65 + C70 + C75 + C80 + C85 + C90 + C95) / 3 AND (C5 + C10 + C15 + C20 + C25) >= (C30 + C35 + C40 + C45 + C50 + C55 + C60 + C65 + C70 + C75 + C80 + C85 + C90 + C95 + C100) / 3

You may wish to review the following:

Translating Pcf's Into Weeks

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

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.