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 |

PCF for True Strength Index Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
slester63
Posted : Wednesday, March 23, 2011 11:26:00 AM
Registered User
Joined: 2/7/2011
Posts: 5
Any ideas on how to create a PCF in TC2000 to scan for True Strength Index?
Bruce_L
Posted : Wednesday, March 23, 2011 11:55:18 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
In the TC2000.com version 11 beta, I would probably just click on the True Strength Index Indicator and select either Quick Sort or Add Column.

EasyScans and Column Sorting

That said, it is possible to create a Personal Criteria Formula if the TSI settings are known. For example, a TSI with a Short Period of 3 and a Long Period of 9 could be written as:

(XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3)) / (.266931022346899 * (ABS(C - C1) + .8 * (ABS(C1 - C2) + .8 * (ABS(C2 - C3) + .8 * (ABS(C3 - C4) + .8 * (ABS(C4 - C5) + .8 * (ABS(C5 - C6) + .8 * (ABS(C6 - C7) + .8 * (ABS(C7 - C8) + .8 * (ABS(C8 - C9) + .8 * (ABS(C9 - C10) + .8 * (ABS(C10 - C11) + .8 * (ABS(C11 - C12) + .8 * (ABS(C12 - C13) + .8 * (ABS(C13 - C14) + .8 * (ABS(C14 - C15) + .8 * (ABS(C15 - C16) + .8 * (ABS(C16 - C17) + .8 * (ABS(C17 - C18) + .8 * (ABS(C18 - C19) + .8 * (ABS(C19 - C20) + .8 * (ABS(C20 - C21) + .8 * (ABS(C21 - C22) + .8 * (ABS(C22 - C23) + .8 * (ABS(C23 - C24) + .8 * (ABS(C24 - C25) + .8 * (ABS(C25 - C26) + .8 * (ABS(C26 - C27) + .8 * (ABS(C27 - C28) + .8 * (ABS(C28 - C29) + .8 * (ABS(C29 - C30) + .8 * (ABS(C30 - C31)))))))))))))))))))))))))))))))) - .166829586184425 * (ABS(C - C1) + .5 * (ABS(C1 - C2) + .5 * (ABS(C2 - C3) + .5 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10))))))))))))

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
slester63
Posted : Wednesday, March 23, 2011 9:32:05 PM
Registered User
Joined: 2/7/2011
Posts: 5
Thanks for this.  In your PCF formula below if you want to adjust the short and long periods is it just the following underlined numbers that change:

(XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3))

Also, what I had meant to originally ask was for scanning for rising through 0 on the TSI.  Is that possible?

Thanks.
Bruce_L
Posted : Thursday, March 24, 2011 8:45:23 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If you want to create a formula for TSI itself, you need to change more than those 9s and 3s as the denominator needs to change in addition to the numerator.

The Personal Criteria Formula provided is actually a manually expanded form of the following pseudo PCF which is not valid because the XAVG() function cannot accept other formulas or functions as arguments:

(XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3)) / XAVG(XAVG(ABS(C - C1),9),3)

This got converted to (also not a valid formula for the same reason):

(XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3)) / ((8 * XAVG(ABS(C - C1),9) - 2 * XAVG(ABS(C - C1),3)) / 6)

So we could avoid the cascaded Moving Averages and just expand XAVG(ABS(C - C1),9) and XAVG(ABS(C - C1),3) in the denominator.

Cascades of Moving Averages

Fortunately, you shouldn't need to worry about that if you are only worried about the TSI crossing through zero. The denominator cannot be negative and should not normally change the sign of TSI (unless it is zero). This means a formula for a TSI with a Short Period of 3 and a Long Period of 9 crossing up through zero could be written as:

XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3) > 0 AND XAVG(XAVGC9.1,3) - XAVG(XAVGC9.2,3) <= 0

And you could just change all of the 3s to the desired Short Period and all of the 9s to the desired Long Period to adjust the formula as desired.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
slester63
Posted : Thursday, March 24, 2011 10:11:27 PM
Registered User
Joined: 2/7/2011
Posts: 5
Thanks for the answer.  Does the formula calculate on daily data (ie previous close) or does it reflect real-time change?

Also, is there any practical way to shorten the list of results by focusing the search on stocks that are newly over the zero mark - eg possibly by defining a range (> 0 and < 0.29).  Otherwise I think it pulls up all stocks with TSI over 0 at that point in time.
Bruce_L
Posted : Friday, March 25, 2011 9:21:42 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The formula will be calculated based on the Bars in the Time Frame selected within the context in which it is being executed. For example, if it is being used as a Personal Criteria Formula, it will use the Time Frame selected for the PCF. If those Bars are Daily, it will use the current Price as the Close of the current Daily Bar while the market is open, not the Close of the previous Trading Day (the current Price will generally be used for the Close of the current Bar no matter what Time Frame is selected).

The formula provided in my Thursday, March 24, 2011 8:45:23 AM ET post can only determine the sign of TSI as the denominator is not being used in the calculations. It will return True for any symbol where TSI is positive during the current Bar but was negative or zero during the previous Bar.

You would need to include the denominator calculations if you want to test for TSI being below 0.29 (the formula below just adds this requirement to the crossover formula):

XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3) > 0 AND XAVG(XAVGC9.1,3) - XAVG(XAVGC9.2,3) <= 0 AND (XAVG(XAVGC9,3) - XAVG(XAVGC9.1,3)) / (.266931022346899 * (ABS(C - C1) + .8 * (ABS(C1 - C2) + .8 * (ABS(C2 - C3) + .8 * (ABS(C3 - C4) + .8 * (ABS(C4 - C5) + .8 * (ABS(C5 - C6) + .8 * (ABS(C6 - C7) + .8 * (ABS(C7 - C8) + .8 * (ABS(C8 - C9) + .8 * (ABS(C9 - C10) + .8 * (ABS(C10 - C11) + .8 * (ABS(C11 - C12) + .8 * (ABS(C12 - C13) + .8 * (ABS(C13 - C14) + .8 * (ABS(C14 - C15) + .8 * (ABS(C15 - C16) + .8 * (ABS(C16 - C17) + .8 * (ABS(C17 - C18) + .8 * (ABS(C18 - C19) + .8 * (ABS(C19 - C20) + .8 * (ABS(C20 - C21) + .8 * (ABS(C21 - C22) + .8 * (ABS(C22 - C23) + .8 * (ABS(C23 - C24) + .8 * (ABS(C24 - C25) + .8 * (ABS(C25 - C26) + .8 * (ABS(C26 - C27) + .8 * (ABS(C27 - C28) + .8 * (ABS(C28 - C29) + .8 * (ABS(C29 - C30) + .8 * (ABS(C30 - C31)))))))))))))))))))))))))))))))) - .166829586184425 * (ABS(C - C1) + .5 * (ABS(C1 - C2) + .5 * (ABS(C2 - C3) + .5 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10)))))))))))) < .29

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