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 |

RSI Values are ZERO When Testing a PCF Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Leutchik
Posted : Friday, June 12, 2009 10:36:17 AM
Registered User
Joined: 10/7/2004
Posts: 16

After market hours on 6-11-09 I was working on a PCF for daily bars where I looked at the 2 period RSI, Avg period 1, simple; Use Wilder's Smoothing
My test SYMBOL was GCO.
The PCF code was:
C > AVGC200 AND RSI2.1 < 10 AND RSI2.1 < RSI2.1.1  AND RSI2.1.1 < RSI2.1.2

What appeared in the test values was
22.79 > 21.17 AND 0.00 < 10 AND 0.00 < 28.95 AND 28.95 < 30.56

A couple of things appear to be wrong here.
The current RSI2 was 5.56, not 0.00.
The prior day's RSI2 was 18.26, not 28.95.
The 2nd prior day's RSI2 was 50.45, not 30.56.

I can't imagine where these RSI values are coming from.
What am I not understanding here?

Whoops! I just figured it out! The RSI flavor that the PCF evaluator uses IGNORES Wilder's smoothing and there's apparently no way to indicate you want it in a PCF. The little pop up dialog to help you code the RSI properties pointedly ignores the smoothing option; which is present in the edit indicator dialog. 
I guess that means RSI is useless to me in PCFs because I always specify to use Wilder's Smoothing.

Any comment on this?
Are there any other similar surprises in PCF evaluation?

Thanks,
Leutchik in L.A.






Thanks.

I can see that it's not pointed at the

Bruce_L
Posted : Friday, June 12, 2009 11:04:52 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
I guess my only comment would be that there are quite a few things that can be Plotted in TeleChart that do not have built in syntax in TeleChart's Personal Criteria Formula Language. A Wilder's Smoothed RSI is but one example of many.

Some examples of options not being available are that Time Frames in PCFs are Daily only even though you can Chart in other Time Frames and that the built in Syntax for the Indicators themselves always use Simple Moving Averages even though most have Exponential Charted versions available as well.

There is no practical way at all to create some Indicators such as the Plotted Envelope Channels and the ADX Indicator.

The PCF Formula Descriptions topic contains a fairly comprehensive list of the syntax that is available for constructing Personal Criteria Formulas and points out the fact that the PCF version of RSI is not Wilder's Smoothed.

It is possible to approximate a Wilder's Smoothed RSI in a Personal Criteria Formula.

One way to write a Wilder's Smoothed version of your formula would be:

C > AVGC200 AND 50 * (C - XAVGC3.1) / 2 / (.500030519440884 * (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) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14)))))))))))))))) + 50 < 10 AND C < C1  AND C1 < C2

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Leutchik
Posted : Friday, June 12, 2009 4:11:07 PM
Registered User
Joined: 10/7/2004
Posts: 16
Bruce,
Thanks for the help and the explanation.
What I posted as my PCF was just a snippet. Noting the complexity of the code you wrote, I'm not going to be able to extend it without breaking something to get to what I want.
Could you please extend your 'approximation' to the full solution? Thanks.

C > AVGC200 AND
RSI2.1    < RSI2.1.1 AND
RSI2.1.1 < RSI2.1.2 AND
RSI2.1.2 < RSI2.1.3 AND
RSI2.1.3 < RSI2.1.4 AND 
RSI2.1 < 10
RSI2.1.4 < 60

Bruce_L
Posted : Friday, June 12, 2009 4:18:00 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Please try the following:

C > AVGC200 AND C1 < C1 AND C1 < C2 AND C2 < C3 AND C3 < C4 AND 50 * (C - XAVGC3.1) / 2 / (.500030519440884 * (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) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14)))))))))))))))) + 50 < 10 AND 50 * (C4 - XAVGC3.5) / 2 / (.500030519440884 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14) + .5 * (ABS(C14 - C15) + .5 * (ABS(C15 - C16) + .5 * (ABS(C16 - C17) + .5 * (ABS(C17 - C18)))))))))))))))) + 50 < 60

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Leutchik
Posted : Friday, June 12, 2009 7:20:03 PM
Registered User
Joined: 10/7/2004
Posts: 16

Thanks for that, Bruce.

Where did you come up with the  ".500030519440884" ? 
Are you generating PCF code from a program?
It's hard to see how, doing PCF by hand, you'd come up with a number like that.

Leutchik
Bruce_L
Posted : Monday, June 15, 2009 8:28:28 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
I do use a program (a spreadsheet), to create most of the longer formulas. The Cascades of Moving Averages covers the basic construction of the manually expanded Moving Average in more detail, but as to the reason for .500030519440884, the basic idea follows:

1 / 2 results from (Period - 1) / Period + 1 used for Wilder's Smoothing.

The .500030519440884 is basically 1 - (Period - 1) / Period = 1 / 2 except that it is adjusted for unity (to make the total of all of the coefficients equal one). If we used a different number of terms in the expansion used for the approximation, the value of this term would change (fewer terms would result in a larger number while more terms would result in something closer to .5).

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