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 |

pullback PCF Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
gabe.aboitiz
Posted : Wednesday, February 24, 2016 3:55:25 PM
Registered User
Joined: 11/19/2015
Posts: 7

Hi,

was just wondering if I could get some help programming in a pullback into my PCF.

Basically What I have now is that the stock is on a downtrend:

C<AVGC200

It has recently uptrended:

AVGC20<=AVGC15 AND AVGC15<=AVGC10 AND AVGC10<=AVGC6 //avg price movement increasing up until the 6th bar to todays

 

and I just wanted to program in a basic 3 day pullback so i tried going with:

H.3>H.2 AND H.2>H.1 AND L.3>L.2 AND L.2>L.1

but it just ends up filtering everythign out. Is it my 'recently uptrending" criteria that is messing with it?

Is there a better way to show that a stock has been recently uptrending by showing that the average price from 20 periods ago is increasing?

Bruce_L
Posted : Wednesday, February 24, 2016 4:26:17 PM


Worden Trainer

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

You need to leave out the . in the H.3 and H.2 stuff.

It should be the following instead.

H3 > H2 AND H2 > H1 AND L3 > L2 AND L2 > L1

Checking for the 20 period average from today being greater than the 20 period average from 20 bars ago could be written as follows.

AVGC20 > AVGC20.20



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
gabe.aboitiz
Posted : Wednesday, February 24, 2016 4:44:03 PM
Registered User
Joined: 11/19/2015
Posts: 7

thanks a ton bruce.

I tried putting it in but it still is not showing stocks that are recently uptrending and then pulling back in context of a larger downtrend.

Im basically trying to filter for stocks that have bottomed from a downtrend, are startign to trend up but are giving a 3 day pullback. When I try and put all that criteria together nothing comes up.

 

how would I be able to show that average price has been increasing over the last 25 days excluding the most recent 4?

i'm trying AVGC25.4<AVGC15.4 AND AVGC15.4<AVGC10.4 which is showign that the average price of the last 25 days(excluding the last 4) is less than the average price of the last 15 (exluding the last 4) and the average price of the last 15 days (excludign the last 4) is less than the average price of the last 10 days (excluding the last 4)

then id like to include the 3 day pullback afterwards so: H3 > H2 AND H2 > H1 AND L3 > L2 AND L2 > L1

Bruce_L
Posted : Wednesday, February 24, 2016 4:57:45 PM


Worden Trainer

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

Writing the Condition Formula exactly as you indicate does seem to return symbols with a general uptrend in the 25 days prior to the most recent 4 bars with price moving up for the 2 bars ending 1 bar ago (so over a 3 bar span).

AVGC25.4 < AVGC15.4 AND AVGC15.4 < AVGC10.4 AND H3 > H2 AND H2 > H1 AND L3 > L2 AND L2 > L1



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
gabe.aboitiz
Posted : Thursday, February 25, 2016 1:42:58 PM
Registered User
Joined: 11/19/2015
Posts: 7

Thanks Bruce.

One last thing. I'm trying to create a Pcf that will filter out sideways action for the last 6 bars excluding the last 3 bars.

Could i use the moving average to identify stocks in a sideways for the last 6 bars excluding the last 3:

ABS(AVGC6.3-AVGC5.3)<.1 AND ABS(AVGC5.3-4.3)<0.1

and then how coould i use this so that it filters out stocks that meet this criteria?

Bruce_L
Posted : Thursday, February 25, 2016 3:26:20 PM


Worden Trainer

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

If you want to filter out stocks which meet a criteria, you need to create a Condition Formula which returns true when your original criteria is false.

The easiest way to do that is to put your original criteria inside of a NOT() function.

NOT(ABS(AVGC6.3-AVGC5.3)<.1 AND ABS(AVGC5.3-4.3)<0.1)

Although you could also re-write the Condition Formula from scratch instead.

ABS(AVGC6.3-AVGC5.3)>=.1 OR ABS(AVGC5.3-4.3)>=0.1

As to if it will filter for the desired price action, I could not say for sure. I might be tempted to just check for the highest price being less than a certain percentage above the lowest price.

MAXH6.3 <= MINL6.3 * 1.01

The reverso of that would be something like:

MAXH6.3 > MINL6.3 * 1.01



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
gabe.aboitiz
Posted : Friday, February 26, 2016 3:11:14 PM
Registered User
Joined: 11/19/2015
Posts: 7

Hi Bruce,

So Im still having an issue finding the right formula for identifying stocks that are in a sideways movement. the issue is that I'm not sure whether to use the highs or possibly the close, or the moving averages. I tinkered with the moving averages but it still isnt right.

is there a way to set it so that within the last 2 weeks, excluding the last 3 days the high and lows have to differ by a certain percentage so as to identify that the stock is moving in a specific direction?

i believe the best way to go about this is to use the ranges

 

 

Bruce_L
Posted : Friday, February 26, 2016 3:19:12 PM


Worden Trainer

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

Well 10 trading days would be about two weeks for stock trading. So the highest high of the 10 bars ending 3 bars ago would be the following.

MAXH10.3

And the lowest low over the same period would be the following.

MINL10.3

So if you want the highest high to less than a certain percentage (in this case 10) above the lowest low, you could use the following.

MAXH10.3 <= 1.1 * MINL10.3

And if you want it to be greater than a certain percentage you would reverse the < sign to a > sign (we'll use 5% for this example).

MAXH10.3 >= 1.05 * MINL10.3

So if you wanted the highest high to be between 5% and 10% above the lowest low, you would use AND to connect the two conditions.

1.05 * MINL10.3 <= MAXH10.3 AND MAXH10.3 <= 1.1 * MINL10.3

This would just denote the range however and not the direction of any price movement. You would need to check for that separately. For example if you wanted the price to be increasing over the same time span, you could check for price to be higher.

1.05 * MINL10.3 <= MAXH10.3 AND MAXH10.3 <= 1.1 * MINL10.3 AND C3 > C12

Writing the formula follows creating the definition. So you need to actually figure out what constitutes "sideways movement" to create the formula.



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