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 |

Wilder's RSI Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Qc-MC
Posted : Saturday, January 31, 2015 3:52:20 PM
Registered User
Joined: 11/4/2014
Posts: 11

In a precedent posting, you give a very long formula for Wilder's RSI. Is it possible to import that long formula in custom formulas and give it a name that would be further interpreted by TC2000 as other (builded) formulas. (in order to be able, for ex. , to evaluate XAVG"myownWRSI"21)?

IF not, how can we calculate (for ex) the EMA of this long formula over 21d ?

and how to calculate what was the value of the formula  X days ago?

(Comment: It is very surprising (I am a new subscriber having work with Metastock for many years) to see that TC 2000 do not have the same formula for RSI then other's software and that this formula is not the one that is common). It is also surprising to see that we have two inidicators for RSI in TC 2000 but only one of these is supported as a build-in indicator.)

 

 

Bruce_L
Posted : Wednesday, February 4, 2015 4:35:27 PM


Worden Trainer

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

User created variables are not possible in the Personal Criteria Formula Language. There is no way to do something like XAVG"myownWRSI"21 in a PCF.

You can use the formula in a Custom PCF Indicator with the Period and Average Type set to the desired moving average you wish to apply, but I suspect this isn't what you want. If it was, you could just add a moving average to the RSI indicator directly.

If you do add a moving average to the RSI indicator, you can set the Offset setting to the number of bars ago of interest.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Qc-MC
Posted : Wednesday, February 4, 2015 7:10:49 PM
Registered User
Joined: 11/4/2014
Posts: 11

QUOTE (Bruce_L)

User created variables are not possible in the Personal Criteria Formula Language. There is no way to do something like XAVG"myownWRSI"21 in a PCF.

You can use the formula in a Custom PCF Indicator with the Period and Average Type set to the desired moving average you wish to apply, but I suspect this isn't what you want. If it was, you could just add a moving average to the RSI indicator directly.

If you do add a moving average to the RSI indicator, you can set the Offset setting to the number of bars ago of interest.

Brce,

I Knew that we can do this, but with RSI (Non Wilder), the question was for Wiilder RSI.

Anyway I found an other way to manage this.

Subject can be close for now.

Thank You.

 

cm

jrlsee
Posted : Monday, June 8, 2015 1:59:48 AM
Registered User
Joined: 6/8/2015
Posts: 2
HI,
 
I was trying to calculate the Wilder's RSI value manually. The value which I obtain does not match the computer program which it generated for Wilder RSI. Would you please provide the formular which it generate for Wilder's RSI, specifically for RSI with a period of 2.
 
Thank you,
 
Jeann
Bruce_L
Posted : Monday, June 8, 2015 10:47:46 AM


Worden Trainer

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

Calculating a Wilder's Smoothed Relative Strength Index (Wilder's RSI) by hand is a fairly daunting task. Even a 2-period version is going to require a significant number of bars to calculate a decent approximation.

The technique given in the help files is as follows.

RSI is calculated using the following formula:
RSI = 100 - (100 / (1+RS))
RS = n period average of up closes / n period average of down closes

This is pretty much the method as described by Wilder, but I probably wouldn't use it personally if I had to do it by hand. Instead I would probably use the following.

RSI = 100 * n period average of up net changes in the close / n period average of absolute net changes in the close

The same details about how the moving averages are calculated applies.

In RSI, RS uses a simple average of the up and down closes. In Wilder's RSI, RS uses Wilder's smoothing which is a different form of exponential averaging. Wilder's smoothing = Previous MA value + (1/n periods * (Close - Previous MA))

Note that when taking the n period average of the up net changes, that negative or 0 net changes are still averaged in. You just need to use zero for the value being used.

Now the non-Wilder's smooth 2-period case for this is a fairly short formula and simple to calculate.

100 * (ABS(C > C1) * (C - C1) + ABS(C1 > C2) * (C1 - C2)) / (ABS(C - C1 + ABS(C - C2))

The ABS(C > C1) and ABS(C1 > C2) multiply C - C1 and C1 - C2 by 1 if true and 0 if false to create the number described in the algorithm I would use to calculate this by hand. C is the current close, C1 is the previous close and C2 is the close of 2 bars ago. I didn't divide the numerator and denominator by 2 to convert the sum into an average because it would cancel out.

The above formula is for the non-Wilder's Smoothed version of RSI. As mentioned in the definition in the help files, the Wilder's smoothed version uses a type of exponential moving average for its calculation instead of simple moving averages.

On the chart, we would start calculating exponential moving averages at the oldest bar (the very first bar of data available when scrolling back) and then get a new value for the numerator and denominator at each bar. This means the Wilder's Smoothed version of RSI uses all of the data on the chart to calculate its value. The older data is less significant to the calculations than the newer data however, so the contribution of the older data to the calculations eventually becomes small enough to ignore.

I am instead going to calculate the formula from the newest data to the oldest data until I get to a point where I feel I can safely ignore the older data. I'm going to go out far enough to include the close of 14 bars ago in the calculations, but you might want to go further.

100 * (ABS(C > C1) * (C - C1) + .5 * (ABS(C1 > C2) * (C1 - C2) + .5 * (ABS(C2 > C3) * (C2 - C3) + .5 * (ABS(C3 > C4) * (C3 - C4) + .5 * (ABS(C4 > C5) * (C4 - C5) + .5 * (ABS(C5 > C6) * (C5 - C6) + .5 * (ABS(C6 > C7) * (C6 - C7) + .5 * (ABS(C7 > C8) * (C7 - C8) + .5 * (ABS(C8 > C9) * (C8 - C9) + .5 * (ABS(C9 > C10) * (C9 - C10) + .5 * (ABS(C10 > C11) * (C10 - C11) + .5 * (ABS(C11 > C12) * (C11 - C12) + .5 * (ABS(C12 > C13) * (C12 - C13) + .5 * (ABS(C13 > C14) * (C13 - C14))))))))))))))) / (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)))))))))))))))

The structure of the formula is the same, but each older factor is multiplied by .5 since it only makes half the contribution to the result as the newer factor.

There would be a factor applied at the beginning of the numerator and denominator to calculate the average, but it cancels out since it is the same in both cases. If I were actually writing a formula and not doing this by hand, I would probably re-arrange things a bit to make the formula shorter.

50 * (C - XAVGC3.1) / 2 / (.50003052 * (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

The only new syntax in this formula in the XAVGC3.1 section which stands for a 3-period exponential moving average of the close.

Personal Criteria Formula Syntax



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
pgs2235
Posted : Monday, July 20, 2015 2:40:23 PM
Registered User
Joined: 5/30/2011
Posts: 1

Bruce- Is the formula you have for Wilder's RSI 14 period or 2 period?  I need a Wilder's RSI 5 period.  You have many formulas listed, but you do not specfically state what period it is for.

Is it possible to request Worden to add a Wilder's RSI function to the PCF language - kinda like the non Wilder's RSI listed in the PCF Help file?

RSI14.1 RSI - 14 bar (Note: this does not use Wilder's Smoothing)

RSI14.10               RSI - 14 bar with 10 bar avg period

RSI14.1.1              RSI - 14 bar of previous bar

RSI14.10.1           RSI - 14 bar with 10 bar avg period 1 bar ago

-Thanks

Bruce_L
Posted : Tuesday, July 21, 2015 9:50:27 AM


Worden Trainer

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

It is for a 2-period Wilder's smoothed RSI (it was a the Wilder's smoothed version of the 2-period non-Wilder's formula given earlier in the post). A 5-period Wilder's smoothed RSI can be written as follows.

50 * (C - XAVGC9.1) / 5 / (.200017 * (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) + .8 * (ABS(C31 - C32) + .8 * (ABS(C32 - C33) + .8 * (ABS(C33 - C34) + .8 * (ABS(C34 - C35) + .8 * (ABS(C35 - C36) + .8 * (ABS(C36 - C37) + .8 * (ABS(C37 - C38) + .8 * (ABS(C38 - C39) + .8 * (ABS(C39 - C40) + .8 * (ABS(C40 - C41) + .8 * (ABS(C41 - C42)))))))))))))))))))))))))))))))))))))))))))) + 50

Thank you for your suggestion.



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