New version 18 available now


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


New account application Trading resources
Margin rates Stock & option commissions

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

Pocket Pivot Twice in a week Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
GBETSIOS
Posted : Sunday, February 10, 2019 3:59:47 PM
Gold Customer Gold Customer

Joined: 3/9/2005
Posts: 7

Hi Bruce, Can you write a PCF to show 2 Pocket Pivots within 5 days of  each other

Bruce_L
Posted : Monday, February 11, 2019 11:35:21 AM


Worden Trainer

Joined: 10/7/2004
Posts: 64,759

Let's start with the following as the basis of our pocket pivot condition in TC2000 v18.

C > C1 AND V > MAX(ABS(C1 < C2) * V1, 10)

Now I would actually interpret your topic title and topic content in two different ways. The topic title would seem to indicate the span over which the pocket pivots can happen is a total of 5 trading days (or within 4 trading days of each other).

C > C1 AND V > MAX(ABS(C1 < C2) * V1, 10) AND CountTrue(C1 > C2 AND V1 > MAX(ABS(C2 < C3) * V2, 10), 4) > 0

While the actual question would indicate the pocket pivots need to be within 5 trading days of each other (which covers a span of 6 trading days).

C > C1 AND V > MAX(ABS(C1 < C2) * V1, 10) AND CountTrue(C1 > C2 AND V1 > MAX(ABS(C2 < C3) * V2, 10), 5) > 0

Earlier versions of TC2000 (such as v7) are going to require significantly longer formulas. The pocket pivot itself is longer.

C > C1 AND V > ABS(C1 < C2) * V1 AND V > ABS(C2 < C3) * V2 AND V > ABS(C3 < C4) * V3 AND V > ABS(C4 < C5) * V4 AND V > ABS(C5 < C6) * V5 AND V > ABS(C6 < C7) * V6 AND V > ABS(C7 < C8) * V7 AND V > ABS(C8 < C9) * V8 AND V > ABS(C9 < C10) * V9 AND V > ABS(C10 < C11) * V10

And you need to manually check for each of the individual days since there is no CountTrue() function. This makes the version where the pocket pivots have to be within 4 trading days of each other covering a span of 5 trading days the following.

C > C1 AND V > ABS(C1 < C2) * V1 AND V > ABS(C2 < C3) * V2 AND V > ABS(C3 < C4) * V3 AND V > ABS(C4 < C5) * V4 AND V > ABS(C5 < C6) * V5 AND V > ABS(C6 < C7) * V6 AND V > ABS(C7 < C8) * V7 AND V > ABS(C8 < C9) * V8 AND V > ABS(C9 < C10) * V9 AND V > ABS(C10 < C11) * V10 AND ((C1 > C2 AND V1 > ABS(C2 < C3) * V2 AND V1 > ABS(C3 < C4) * V3 AND V1 > ABS(C4 < C5) * V4 AND V1 > ABS(C5 < C6) * V5 AND V1 > ABS(C6 < C7) * V6 AND V1 > ABS(C7 < C8) * V7 AND V1 > ABS(C8 < C9) * V8 AND V1 > ABS(C9 < C10) * V9 AND V1 > ABS(C10 < C11) * V10 AND V1 > ABS(C11 < C12) * V11) OR (C2 > C3 AND V2 > ABS(C3 < C4) * V3 AND V2 > ABS(C4 < C5) * V4 AND V2 > ABS(C5 < C6) * V5 AND V2 > ABS(C6 < C7) * V6 AND V2 > ABS(C7 < C8) * V7 AND V2 > ABS(C8 < C9) * V8 AND V2 > ABS(C9 < C10) * V9 AND V2 > ABS(C10 < C11) * V10 AND V2 > ABS(C12 < C12) * V11 AND V2 > ABS(C12 < C13) * V12) OR (C3 > C4 AND V3 > ABS(C4 < C5) * V4 AND V3 > ABS(C5 < C6) * V5 AND V3 > ABS(C6 < C7) * V6 AND V3 > ABS(C7 < C8) * V7 AND V3 > ABS(C8 < C9) * V8 AND V3 > ABS(C9 < C10) * V9 AND V3 > ABS(C10 < C11) * V10 AND V3 > ABS(C12 < C12) * V11 AND V3 > ABS(C12 < C13) * V12 AND V3 > ABS(C13 < C14) * V13) OR (C4 > C5 AND V4 > ABS(C5 < C6) * V5 AND V4 > ABS(C6 < C7) * V6 AND V4 > ABS(C7 < C8) * V7 AND V4 > ABS(C8 < C9) * V8 AND V4 > ABS(C9 < C10) * V9 AND V4 > ABS(C10 < C11) * V10 AND V4 > ABS(C12 < C12) * V11 AND V4 > ABS(C12 < C13) * V12 AND V4 > ABS(C13 < C14) * V13 AND V4 > ABS(C14 < C15) * V14))

And the version where the pocket pivots need to be within 5 trading days of each other covering a span of 6 trading days the following.

C > C1 AND V > ABS(C1 < C2) * V1 AND V > ABS(C2 < C3) * V2 AND V > ABS(C3 < C4) * V3 AND V > ABS(C4 < C5) * V4 AND V > ABS(C5 < C6) * V5 AND V > ABS(C6 < C7) * V6 AND V > ABS(C7 < C8) * V7 AND V > ABS(C8 < C9) * V8 AND V > ABS(C9 < C10) * V9 AND V > ABS(C10 < C11) * V10 AND ((C1 > C2 AND V1 > ABS(C2 < C3) * V2 AND V1 > ABS(C3 < C4) * V3 AND V1 > ABS(C4 < C5) * V4 AND V1 > ABS(C5 < C6) * V5 AND V1 > ABS(C6 < C7) * V6 AND V1 > ABS(C7 < C8) * V7 AND V1 > ABS(C8 < C9) * V8 AND V1 > ABS(C9 < C10) * V9 AND V1 > ABS(C10 < C11) * V10 AND V1 > ABS(C11 < C12) * V11) OR (C2 > C3 AND V2 > ABS(C3 < C4) * V3 AND V2 > ABS(C4 < C5) * V4 AND V2 > ABS(C5 < C6) * V5 AND V2 > ABS(C6 < C7) * V6 AND V2 > ABS(C7 < C8) * V7 AND V2 > ABS(C8 < C9) * V8 AND V2 > ABS(C9 < C10) * V9 AND V2 > ABS(C10 < C11) * V10 AND V2 > ABS(C12 < C12) * V11 AND V2 > ABS(C12 < C13) * V12) OR (C3 > C4 AND V3 > ABS(C4 < C5) * V4 AND V3 > ABS(C5 < C6) * V5 AND V3 > ABS(C6 < C7) * V6 AND V3 > ABS(C7 < C8) * V7 AND V3 > ABS(C8 < C9) * V8 AND V3 > ABS(C9 < C10) * V9 AND V3 > ABS(C10 < C11) * V10 AND V3 > ABS(C12 < C12) * V11 AND V3 > ABS(C12 < C13) * V12 AND V3 > ABS(C13 < C14) * V13) OR (C4 > C5 AND V4 > ABS(C5 < C6) * V5 AND V4 > ABS(C6 < C7) * V6 AND V4 > ABS(C7 < C8) * V7 AND V4 > ABS(C8 < C9) * V8 AND V4 > ABS(C9 < C10) * V9 AND V4 > ABS(C10 < C11) * V10 AND V4 > ABS(C12 < C12) * V11 AND V4 > ABS(C12 < C13) * V12 AND V4 > ABS(C13 < C14) * V13 AND V4 > ABS(C14 < C15) * V14) OR (C5 > C6 AND AND V5 > ABS(C6 < C7) * V6 AND V5 > ABS(C7 < C8) * V7 AND V5 > ABS(C8 < C9) * V8 AND V5 > ABS(C9 < C10) * V9 AND V5 > ABS(C10 < C11) * V10 AND V5 > ABS(C12 < C12) * V11 AND V5 > ABS(C12 < C13) * V12 AND V5 > ABS(C13 < C14) * V13 AND V5 > ABS(C14 < C15) * V14 AND V5 > ABS(C15 < C16) * V15))



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