Registered User Joined: 3/10/2013 Posts: 41

Hi Bruce,
Can you please let me know if there is a way to write PCFs to give me number of days since an indicator I use gave me a buy or sell signal. For example when the Coppock Indicator crossed the zero line (buy) and down (Sell).
Thanks


Worden Trainer
Joined: 10/7/2004 Posts: 65,138

There is not a built in way to do this in TC2000, but the Days Since Last Peak (or other daycounting needs) describes a technique for doing so using some fairly complex Personal Criteria Formulas.
The formulas using this technique can only check over a maximum defined number of bars. The practicality of such formulas is dependent on the complexity of the condition which is being checked. Unfortunately, a Condition Formula for a Coppock Curve indicator crossing up or down through zero is so long on its own, that attempting to utilize it with the technique results in a formula which is too long and slow to be practical or post in the forums even for very short lookback periods:
SGN(10 * (C / C14 + C / C11) + 9 * (C1 / C15 + C1 / C12) + 8 * (C2 / C16 + C2 / C13) + 7 * (C3 / C17 + C3 / C14) + 6 * (C4 / C18 + C4 / C15) + 5 * (C5 / C19 + C5 / C16) + 4 * (C6 / C20 + C6 / C17) + 3 * (C7 / C21 + C7 / C18) + 2 * (C8 / C22 + C8 / C19) + (C9 / C23 + C9 / C20)  110) <> SGN(10 * (C1 / C15 + C1 / C12) + 9 * (C2 / C16 + C2 / C13) + 8 * (C3 / C17 + C3 / C14) + 7 * (C4 / C18 + C4 / C15) + 6 * (C5 / C19 + C5 / C16) + 5 * (C6 / C20 + C6 / C17) + 4 * (C7 / C21 + C7 / C18) + 3 * (C8 / C22 + C8 / C19) + 2 * (C9 / C23 + C9 / C20) + (C10 / C24 + C10 / C21)  110)
I do not know of a workaround which would allow you to count the number of bars since the Coppock Curve indicator crossed teh zero line.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 3/3/2013 Posts: 57

Morning Bruce,
Is there a way to identify if the following conditions happened w/in the past 3 days?
XAVGC5  XAVGC35 > XAVG(XAVGC5,9)  XAVG(XAVGC35,9) (MACD > its signal)
AND C >= AVGC7
OR C >= xAVGC9
AND (MAXH5)(MINL5) > 1. (if there's at least a $1 dif betw/ the last 5 bars)
AND (MAXH5) >= 1.015 * (MINL5) (if there's at least a 1.5% dif betw/ the last 5 bars)
AND C > AVGC100
As always, I greatly appreciate your input.


Worden Trainer
Joined: 10/7/2004 Posts: 65,138

The best and easiest way to create a condition for this would be to use your existing Condition Formula as the Boolean Formula in a Custom PCF % True Indicator.
If you set the Period to 3 and the Average Type to Simple, the Custom PCF % True Indicator will be greater than 0 if and only if its Boolean Formula was true at least once during the 3 most recent bars.
This allows you to click on the Custom PCF % True Indicator and select Create Scan Condition to create a condition for the Custom PCF % True Indicator being Greater Than 0. This is the same as your Condition Formula being true at least once during the 3 most recent bars.
Create Conditions from Your Chart
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 3/3/2013 Posts: 57

Hello Bruce,
So a PCF % True Indicator for MACD > its signal / Qtr (setting its Period to 62) =
XAVGC12  XAVGC26 > XAVG(XAVGC12,9)  XAVG(XAVGC26,9)
or is this PCF better: (also setting its Period to 62)
62*ABS(XAVGC12  XAVGC26 > XAVG(XAVGC12,9)  XAVG(XAVGC26,9))
Again, Thanks in advance.


Worden Trainer
Joined: 10/7/2004 Posts: 65,138

Neither is better. They do different things. The first method is probably easier as you don't have to add the 62 * () part and change the formula when changing periods.
The first formula used in a Custom PCF % True Indicator will give you the percentage of the time the Condition Formula was true over 62 bars.
The second formula used in a Custom PCF Indicator will give you the number of times the Condition Formula inside the 62 * ABS() returned true during the most recent 62 bars.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 3/3/2013 Posts: 57

Morning Bruce,
It's easy to crow about wins but I have to ask the embarassing ("I want my $ back") question regarding an option play expiring in Sept.
So, I lost >$5 on a gap down and now I want my $ back and want the probability that I can recover it by 6 weeks or less. Here's my ("I want my $ back") formula for your inspection (but I wonder if you have another thought):
% True $x / xWk within 30 bars (6wks):
(MAXC30)(MINC30) > 5.00
(& setting the period to 30).


Worden Trainer
Joined: 10/7/2004 Posts: 65,138

Your formula isn't really checking if the symbol went up or down (which may be on purpose). If you do want to check for just going up, you might want to change it something like the following:
MAXC30  C30 > 5
You might also want to set the period to something longer than 30. There is no reason I can think of to restrict it to the same time period.
As to if this would accurately give you the percent chance that you could make your money back in six weeks, I could not say or speculate.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 3/3/2013 Posts: 57

Question 1: how far to anticipate a stock moving
Question 2: and by what timeframe to get there.
Does the above % True PCF answer both Questions (historically)? And if so, instead of using MAXC30  C30 > 5, is it possible to figure 5% (not $5)?
What would be the % True PCF for the opposite: check for the symbol just going down?
Thanks in advance!
PS: Is there another way of considering (historically), how far a move & in what timeframe?
e.g, 100 * (c / XAVGC30  1) >5


Worden Trainer
Joined: 10/7/2004 Posts: 65,138

I don't understand the intent of questions 1 and 2 to definitively say yes, but I supsect the answer is in fact yes for both questions.
If you want to check for price to have gone up it least 5% in 6 weeks or less (only including closing prices), you can use the following.
MAXC30 >= 1.05 * C30
The highest percent change over those six weeks can be written as follows.
100 * (MAXC30 / C30  1)
You can change MAXC30 to MAXH30 if you want to include the highs of each trading day.
If you want to check for price to have gone down at least 5% in 6 weeks or less (only including closing prices), you can use the following.
MINC30 <= .95 * C30
The lowest percent change over those six weeks can be written as follows.
100 * (MINC30 / C30  1)
You can change MINC30 to MINL30 if you want to include the lows of each trading day.
Bruce Personal Criteria Formulas TC2000 Support Articles


Guest1 