Registered User Joined: 6/14/2016 Posts: 266

Yes, absolutely correct, sorry. But in one case I wantr to have an indicator the a new low and in the other cased one for a new high. Each checking the most recent 5 bars.
Not sure how to differentiate the New High from the New Low formula.
Thanks much,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

Change the MIN in the formula template to a MAX to convert it from checking for a low to checking for a high.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks a lot Bruce. Kind regards, Chris


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I just created a new indicator PCF with the MIN formula checking the lows. No error messages.
When I wanted to save it, it says Boolean result  do I want to save this as a condition.
I cancelled because, I need to create an indicator from it. Do I need to chang anything to
make your formla into an indicator?
Thanks,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

If you are following the template in my Thursday, July 05, 2018 10:46:58 AM ET post, you would get rid of the > 0 at the end to get a count.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks Bruce  that did it. Have a good weekend. Chris


Registered User Joined: 6/14/2016 Posts: 266

Good Monring,
I was wondering how to write two Scan Conditions which would define that:
1) the last bar has its Close in the upper half of the bar range?
2) the last bar has its close in the upper range of the bar range AND has a higher high than the bar before it?
Thanks and kind regards,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

Please try the following.
STOC1 >= 50 AND H > L AND H > H1
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks very much  din't know about the STOC1 function, might be able to use it, e.g. for Close
in upper third of range or something similar.
Kind regards,
Chris


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I made a custom indicator for the spread between BBBOT(.1;20) an the XAVC13:
(BBBOT(.1;20)  XAVGC13)
However, instead of using the Bottom Band, I would like to use the Bollinger Center Line
for this spread.
How wote you formulate that in a PCF Indicator?
Kind regards,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

The centerline is just the following (assuming the Bollinger Bands are simple).
AVGC20
So:
AVGC20  XAVGC13
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
Does the AVGC20 take into account that my Bollinger Bands have a bandwidth of 0.1 and a period of 20 (exponential) ?


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

The bandwidth makes no difference as to the value of the centerline. If the BBs are exponential, then the centerline would be the following instead however.
XAVGC20
So:
XAVGC20  XAVGC13
Note that the built in BBTOP() and BBBOT() functions are based on simple Bollinger Bands. If you want to write formulas for the top and bottom bands of other types of Bollinger Bands, you may want to review the following.
Bollinger Bands
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks, Bruce. Now I understand. Kind regards, Chris


Registered User Joined: 6/14/2016 Posts: 266

Hello Bruce,
Today I wanted ask ask your help with a more difficult (two part) scan formula. Perhaps you can give me the generic structure on #1:
1. The BBOT is below the lower of T361.272 and T3361.272;
2. The price ihas been moving down to the BBTOP. and the price Low is below the BBTOP now.
BBTOP = (0.2; 20), BBBOT = (0.2. 20)
Many thanks and kind regards,
Chris


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
Don't worry about the questions I posed above. I think I got them squared away on my own.
For #1 I used: BBBOT(.2, 20) < GREATEST(...T361.272.., T3361.272)
and it seems to work.
I have a new question however as follows:
 I would like to scan for the (first) Close Price Bar crossing up through the HIGHER (Greater) of the EMA50 or the BBTOP(0.2, 20).
 Inversely, I would like to scan for the first Close Price Bar crossing up the LOWER (Least) of the EMA50 or the EMA89 or the BBTOP(0.2, 20).
Thanks for your help,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

The crossup would be:
XUP(C, GREATEST(XAVGC50, BBTOP(.2, 20))
And the crossdown would be:
XDOWN(C, LEAST(XAVGC50, BBBOT(.2, 20))
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
Something happened to my reply just now when I posted, so I'll try again:
If I were to add a third indicators to the formulas above, would this be the correct way for doing that, e.g. as an example with an additional EMA89?:
XDOWN(C, LEAST(XAVGC50, XAVGC89, BBBOT (.2, 20))
Kind regards,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

Yes, that is how you would do it. The GREATEST() and LEAST() functions can have as many arguments as you want.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks Bruce. Appreciate your help, as always.


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I'm having problems with 2 slope formulas:
1) I need to find the 20 bar slope of the BBTOP(0.2, 20) and this isn't working for me:
6 * (FAVG(BBTOP(0.20, 20)  BBTOP(0.20, 20)) / 20 > 0
2) I also need to find the 20 bar slope of the EMA89
Thanks for your help. Kind regards,
Chris


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
Just to clarify, I want to use the 20 period Linear Regression.
I thought this would work, but I get an error flag
(6 * ((FAVG((BBTOP(0.2, 20), 21))  AVG(BBTOP(0.2, 20), 21))) / 20) > 0


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

You really have to be careful about parentheses. Your 20 bar slope of the 20 bar BB top should be:
6 * (FAVG(BBTOP(.2, 20), 20)  AVG(BBTOP(.2, 20), 20)) / (20  1)
This simplifies down to the following however.
FAVG(BBTOP(.2, 20), 20) > AVG(BBTOP(.2, 20), 20)
Which would be the following for a 21 period BB.
FAVG(BBTOP(.2, 21), 20) > AVG(BBTOP(.2, 21), 20)
The 20 bar slope of EMA89 would be the following.
6 * (FAVG(XAVGC89, 20)  AVG(XAVGC89, 20)) / 19
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks very much  I'll study the way you are setting the parentheses. Chris


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I ran into another problem just now:
1) Wanted to find a decreasing Bollinger Bandwidth (using 0.2, 20) for at least 3 out of the last 5 bars. And wanted this condition to be True, so the scan only returns stocks with this criteria:
CountTrue(ABS(BBTOP(.2, 20)) < MIN(ABS(BBTOP(.2, 20.1), 5) AND (ABS(BBBOT(.2, 20)) < MIN(ABS(BBBOT(.2, 20.1), 5)) >= 3
I get a "mising period" argument at Position 113 when I try to save the PCF Condition.
2) Also, the 20bar slope of the EMA89 you helped me with this morning seems different from the
20 bar slope of the BBTOP(.2, 20). Says the latter is an indicator and saves it like that. I was wanted
to specify in the 2 formulas above that they are conditions and are True, not sure how to adapt this?
Thanks a lot. Kind regards,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

I don't understand the structure of your first formula at all, but if you are actually looking for the width of the Bollinger Bands decreasing for at least 3 out of the most recent 5 bars, please try the following.
CountTrue(STDDEV20 < STDDEV20.1, 5) >= 3
Yes, they are different. You didn't ask for the slope being greater than zero, you asked for the slope (which is a numeric value). If you want the slope to just be positive, then the formula is quite a bit simpler than calculating the actual slope.
FAVG(XAVGC89, 20) > AVG(XAVGC89, 20)
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thank you Bruce,
I'm assuming the the CountTrue formula for the Bollinger Bands takes the 20 StDev into account und the
0.20 Parameter doesn't matter here. Kind regards, Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

The .2 parameter shouldn't matter at all if you are just looking at if the bands are getting narrower because the factor would be applied to both the before and after width calculations.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I have a formula for the EMA13 being inside the BB(1.272, 21) as follows:
BBBOT(1.272, 21) <= XAVGC13 AND XAVGC13 <= BBTOP(1.272, 21) AND STDDEV20 < STDDEV20.1
How could I modify this formula to show that the spread of this Bollinger Band has been decreasing
for at last 3 of the last 5 bars? (whilst the EMA13 is within BBTOP to BBBOT)?
Thanks and kind regards,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

So the spread is decreasing 3 of 5 bars but EMA13 inside the bands for all 5 bars?
CountTrue(STDDEV21 < STDDEV21.1, 5) >= 3 AND TrueInRow(ABS(XAVGC13  AVGC21) <= 1.272 * STDDEV21, 5) = 5
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks much, Bruce, exactly what I needed.


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I'm trying to write a PCF to filter the (BBBOT  EMA13) Spread:
 The (BBBOT(0.2; 20)  XAVGC13) was above 0 yesterday but below 0 today.
 Also trying to write a formula for the Slope of the last 3 bars of the Exponential MACD(5, 13) is decreasing, and the average price of the last 3 bars (H+L+C/3) is increasing.
Many thanks for your help. Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

Please try the following for the first one.
XDOWN(BBBOT(.2, 20), XAVGC13)
And the following for the second one.
MACD5.13 < MACD5.13.3 AND FAVG(MACD5.13, 4) < AVG(MACD5.13, 4) AND H + L + C > H3 + L3 + C3 AND FAVG(H + L + C, 4) > AVG(H + L + C, 4)
Although depnending on how you are counting the bars which are increasing and decreasing, it could be the following instead.
MACD5.13 < MACD5.13.2 AND FAVG(MACD5.13, 3) < AVG(MACD5.13, 3) AND H + L + C > H2 + L2 + C2 AND FAVG(H + L + C, 3) > AVG(H + L + C, 3)
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks very much, Bruce  works well.


Registered User Joined: 6/14/2016 Posts: 266

Hi Bruce,
I'm trying to combine 2 identical conditions, namely:
L < BBTOP(0.2, 20) AND H > BBBOT(0.2, 20)
But for daily and weekly bars.
For example, if a weekly bar triggers the condition, it should end up in the results,
and vice versa for a daily bar, but not necessarily for both daily and weekly bars at the same time.
Thanks for your help. Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

There isn't a way to OR conditions with different time frames in TC2000 currently. You would need to have two separate scans.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

OK, thanks Bruce, wasn't sure about the OR condition.


Registered User Joined: 6/14/2016 Posts: 266

Hello Bruce,
I have an indicator histogram formula which gives me a (red) histogram bar when:
 the T381.618 crosses the T361.272 down. (Didn't want to paste it here because it's quite long);
I look at the indicator mainly on daily bar charts, but wanted to ask you:
 if there is a way to show the XDown T3 indicator results for a 4 hour bar directly onto the daily chart?
I didn't see any way to select this, but possibly a modification to the formula itself may do the job?
Thanks and kind regards,
Chris


Worden Trainer
Joined: 10/7/2004 Posts: 63,972

No, there isn't a way to do so and I cannot think of any workarounds.
Bruce Personal Criteria Formulas TC2000 Support Articles


Registered User Joined: 6/14/2016 Posts: 266

Thanks Bruce  I can imagine that would be a very difficult festure to implement.


Guest1 