Registered User Joined: 10/7/2004 Posts: 45
|
How do I write a formula for stochrsi?
Sunbird
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
For a 10 period Stochrsi using an RSI of 18 and 3 you would use this PCF:
(RSI18.3 - MIN(RSI18.3,10))/(MAX(RSI18.3,10) - MIN(RSI18.3,10))
For a different RSI or period, change the numbers accordingly. You can plot this as a custom indicator or use it in an EasyScan.
- Craig Here to Help!
|
|
Registered User Joined: 7/7/2013 Posts: 10
|
Hi Trainer, For Stochastic RSI 9,9 %K1, the PCF should be
(RSI9.9 - MIN(RSI19.9,1))/(MAX(RSI9.9,1) - MIN(RSI9.9,1)). Is this correct? Thanks.
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
%K is just the smoothing of the stochastic line so if it is 1 then it doesn't need to be in the calculation at all.
Assuming your RSI parameters are period 9,smoothing 1 you would use...
(RSI9.1 - MIN(RSI9.1,9))/(MAX(RSI9.1,9) - MIN(RSI9.1,9))
This is a StochRSI for RSI9.1 and a stochastics period of 9.
|
|
Registered User Joined: 7/7/2013 Posts: 10
|
Thanks StockGuy.
|
|
Registered User Joined: 1/3/2014 Posts: 36
|
for
(RSI18.3 - MIN(RSI18.3,10))/(MAX(RSI18.3,10) - MIN(RSI18.3,10))
Would the slope be
((RSI18.3 - MIN(RSI18.3,10))/(MAX(RSI18.3,10) - MIN(RSI18.3,10)) ) -
((RSI18.3.1 - MIN(RSI18.3.1,10))/(MAX(RSI18.3.1,10) - MIN(RSI18.3.1,10)) )
or
((RSI18.3 - MIN(RSI18.3,10))/(MAX(RSI18.3,10) - MIN(RSI18.3,10)) ) -
((RSI18.3 - MIN(RSI18.3,10.1))/(MAX(RSI18.3,10.1) - MIN(RSI18.3,10.1)) )
|
|
Registered User Joined: 1/3/2014 Posts: 36
|
for a Full Stochastic 20,5,4 with a RSI of 14, how would the Stochastic RSI be written ?
thanks
steve
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The correct slope formula should be the first of the two options you provided in your first question.
The Full Stochastic 20,5 %K of a 14 period plain RSI can be written as follows.
100 * ((RSI14 - MIN(RSI14,20)) / (MAX(RSI14,20) - MIN(RSI14,20)) + (RSI14.1.1 - MIN(RSI14.1.1,20)) / (MAX(RSI14.1.1,20) - MIN(RSI14.1.1,20)) + (RSI14.1.2 - MIN(RSI14.1.2,20)) / (MAX(RSI14.1.2,20) - MIN(RSI14.1.2,20)) + (RSI14.1.3 - MIN(RSI14.1.3,20)) / (MAX(RSI14.1.3,20) - MIN(RSI14.1.3,20)) + (RSI14.1.4 - MIN(RSI14.1.4,20)) / (MAX(RSI14.1.4,20) - MIN(RSI14.1.4,20))) / 5
The Full Stochastic 20,5,4 %D of a 14 period plain RSI can be written as follows.
100 * ((RSI14 - MIN(RSI14,20)) / (MAX(RSI14,20) - MIN(RSI14,20)) + 2 * (RSI14.1.1 - MIN(RSI14.1.1,20)) / (MAX(RSI14.1.1,20) - MIN(RSI14.1.1,20)) + 3 * (RSI14.1.2 - MIN(RSI14.1.2,20)) / (MAX(RSI14.1.2,20) - MIN(RSI14.1.2,20)) + 4 * (RSI14.1.3 - MIN(RSI14.1.3,20)) / (MAX(RSI14.1.3,20) - MIN(RSI14.1.3,20)) + 4 * (RSI14.1.4 - MIN(RSI14.1.4,20)) / (MAX(RSI14.1.4,20) - MIN(RSI14.1.4,20)) + 3 * (RSI14.1.5 - MIN(RSI14.1.5,20)) / (MAX(RSI14.1.5,20) - MIN(RSI14.1.5,20)) + 2 * (RSI14.1.6 - MIN(RSI14.1.6,20)) / (MAX(RSI14.1.6,20) - MIN(RSI14.1.6,20)) + (RSI14.1.7 - MIN(RSI14.1.7,20)) / (MAX(RSI14.1.7,20) - MIN(RSI14.1.7,20))) / 20
Note that this is not based on a Wilder's smoothed RSI. There isn't a way to create Indicator Formulas for Wilder's smoothed versions which are short and fast enough to be practical or post in the forums.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/30/2015 Posts: 197
|
Can you provide the Stochastic RSI for 10 10 2 and again can i take that formula and create a true false statement i.e. (srsi formula) > 98 or (sris formula) < 2
Thank Again
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The full stochastic 10,2 %K of a 10 period plain RSI can be written as follows.
100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2
You could write your Condition Formula as follows.
100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2 > 98 OR 100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2 < 2
Or as the shorter version below.
ABS(100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2 - 50) > 48
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/30/2015 Posts: 197
|
The Money Flow 3 period was really close but the stochastic does not plot at all the same as the Stochastic RSI indicator with 10 10 2 settings ?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It uses the plain RSI without Wilder's smoothing. There isn't a way to create the formula using a StochRSI based on a Wilder's smoothed RSI.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/30/2015 Posts: 197
|
shorter version below.
ABS(100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2 - 50) > 48
IF THE ABOVE IS < 2
what is the shorter version for > 98
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The shorter version is designed to to test for both > 98 and < 2. That is what the ABS() and -50 portions of the formula do. It is designed to eliminate the OR in the longer formula.
> 98 on its own would just be:
100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2 > 98
And < 2 on its own would just be:
100 * ((RSI10 - MIN(RSI10,10)) / (MAX(RSI10,10) - MIN(RSI10,10)) + (RSI10.1.1 - MIN(RSI10.1.1,10)) / (MAX(RSI10.1.1,10))) / 2 < 2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/30/2015 Posts: 197
|
QUOTE (Bruce_L)
It uses the plain RSI without Wilder's smoothing. There isn't a way to create the formula using a StochRSI based on a Wilder's smoothed RSI.
i still don't quite under stand how the Stochastic RSI Indicator can be plotted but not calculated
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The program doesn't normally use the PCFs to plot indicators. The built in indicators are written in Visual Basic within the program itself. The indicators are calculated in order to plot them, but that doesn't mean the indicators can be re-created in a formula.
If the required syntax isn't available in the Personal Criteria Formula Language to write a reasonably short and fast version, then you aren't going to be able to create a formula for it.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |