Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

TSV pcf is working but on the wrong time period Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jbclem
Posted : Friday, October 1, 2010 3:33:33 AM
Registered User
Joined: 1/26/2005
Posts: 113
I have written a PCF that scans for stocks where the TSV39 has crossed it's 10sma today.  It also has a second condition that the TSV39 has been below it's 10sma for the past 10 trading days.  The results are coming up with stocks where the TSV39 has just crossed it's 10sma today, but the other condition is showing up somewhere in the recent past, but not in the past 10 trading days.  When I  look at the resulting charts I can see that in the past few months there will be a period where the 2nd condition is met, but it's never met for the most recent 10 trading days.

Here's the PCF, and could someone help me troubleshoot this problem.  BTW, I've had this problem also with scans that look for double bottoms, where the scan results show the double bottom somewhere in the recent past, but never the day before.  Just like this PCF, the double bottom PCF has a triggering condition(doubling of volume) which does always show on the previous day(yesterday).  Is it possible that as long as one condition is satisfied, Telechart will ignore the time period specific of the other condition?

TSV39 below 10sma for two weeks then crosses:
=====================================
XAVG(TSV39.1,1) <= AVG(TSV39.1,10) AND XAVG(TSV39.2,1) <= AVG(TSV39.2,10) AND XAVG(TSV39.3,1) <= AVG(TSV39.3,10) AND XAVG(TSV39.4,1) <= AVG(TSV39.4,10) AND XAVG(TSV39.5,1) <= AVG(TSV39.5,10) AND XAVG(TSV39.6,1) <= AVG(TSV39.6,10) AND XAVG(TSV39.7,1) <= AVG(TSV39.7,10) AND XAVG(TSV39.8,1) <= AVG(TSV39.8,10) AND XAVG(TSV39.9,1) <= AVG(TSV39.9,10) AND XAVG(TSV39.10,1) <= AVG(TSV39.10,10) AND XAVG(TSV39,1) > AVG(TSV39,10)

Thanks for any suggestions....

John
Bruce_L
Posted : Friday, October 1, 2010 8:58:34 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (jbclem)
I have written a PCF that scans for stocks where the TSV39 has crossed it's 10sma today.  It also has a second condition that the TSV39 has been below it's 10sma for the past 10 trading days.  The results are coming up with stocks where the TSV39 has just crossed it's 10sma today, but the other condition is showing up somewhere in the recent past, but not in the past 10 trading days.  When I  look at the resulting charts I can see that in the past few months there will be a period where the 2nd condition is met, but it's never met for the most recent 10 trading days.

If the TSV is Simple, the formula could be written as:

TSV39 > AVG(TSV39,10) AND TSV39.1 < AVG(TSV39.1,10) AND TSV39.2 < AVG(TSV39.2,10) AND TSV39.3 < AVG(TSV39.3,10) AND TSV39.4 < AVG(TSV39.4,10) AND TSV39.5 < AVG(TSV39.5,10) AND TSV39.6 < AVG(TSV39.6,10) AND TSV39.7 < AVG(TSV39.7,10) AND TSV39.8 < AVG(TSV39.8,10) AND TSV39.9 < AVG(TSV39.9,10) AND TSV39.10 < AVG(TSV39.10,10)

If the TSV is Exponential, the formula could be written as:

XAVG(TSV,39) > XAVG(TSV10,39) AND XAVG(TSV1.1,39) < XAVG(TSV10.1,39) AND XAVG(TSV1.2,39) < XAVG(TSV10.2,39) AND XAVG(TSV1.3,39) < XAVG(TSV10.3,39) AND XAVG(TSV1.4,39) < XAVG(TSV10.4,39) AND XAVG(TSV1.5,39) < XAVG(TSV10.5,39) AND XAVG(TSV1.6,39) < XAVG(TSV10.6,39) AND XAVG(TSV1.7,39) < XAVG(TSV10.7,39) AND XAVG(TSV1.8,39) < XAVG(TSV10.8,39) AND XAVG(TSV1.9,39) < XAVG(TSV10.9,39) AND XAVG(TSV1.10,39) < XAVG(TSV10.10,39)

QUOTE (jbclem)
BTW, I've had this problem also with scans that look for double bottoms, where the scan results show the double bottom somewhere in the recent past, but never the day before.  Just like this PCF, the double bottom PCF has a triggering condition(doubling of volume) which does always show on the previous day(yesterday).  Is it possible that as long as one condition is satisfied, Telechart will ignore the time period specific of the other condition?

Writing a formula for a Double Bottom is well beyond my abilities, so I would need to see your formula to comment. I have not seen issues where a TeleChart Personal Criteria Formula ignores the time periods specified in any of its components.

How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
dfarns
Posted : Saturday, October 2, 2010 7:36:27 PM
Registered User
Joined: 12/11/2008
Posts: 7
Thanks for the PCF, it's much better than the one I had.  By that I mean that it is about 50% accurate, whereas mine was about 10%.  I used the one with the exponential TSV39 and the simple 10ma. Here's what happened when I ran it today, on Friday's closing prices:

There were 31 stocks named by the scan. 

  1.  15 of them complied with both conditions of the scan (the TSV39 crossover and also staying below it's 10sma for the 10 previous days). 

  2.  But there were 11 that hadn't crossed over yet and weren't even touching the TSV39 10sma.  Still, they complied with the second condition (10 days below the TSV39 10sma).

  3.  There were also 5 stocks that didn't comply with either of the conditions.  They hadn't crossed over and showed  between 3-7 days below the 10sma.

  4.   And there was one of these stocks that had crossed over 3 days ago(on Tuesday) but at that point the TSV39 had only been below it's 10sma for 3 days.

Well, this is confusing.  I'm real happy to have 15 stocks show up with accurate results but I'm puzzled about the others.  Why were they picked?  Is there a setting somewhere in Telechart that can be tweaked?   Is there something I'm missing here?

John
dfarns
Posted : Saturday, October 2, 2010 11:44:14 PM
Registered User
Joined: 12/11/2008
Posts: 7
Arg!! Please ignore my last message and all the statistics.  I just discovered that  my charts were set up for a simple TSV39 and a simple 10ma.  After I removed all the "X"s from the PCF, it worked perfectly.  My appologies...but I'm glad I figured it out, and the next time I have a similar problem the first place I'll look for a solution will at the exponentials and the simples.

Bruce_L
Posted : Monday, October 4, 2010 9:57:19 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome. I'm happy to read you were able to figure it out.

-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.