evo34 77 posts msg #103316  Ignore evo34 
11/12/2011 5:18:13 PM
Can you use an indicator on custom series (other than close price, that is). Say I wanted to create a filter that used RSI of [(high+low)/2] rather than RSI of close. Is this possible? Thanks.

Kevin_in_GA 4,542 posts msg #103317  Ignore Kevin_in_GA 
11/12/2011 6:04:01 PM
It is but you would need to write the code for it. Not hard if you know the formula and there are no "if/then" type of rules.

evo34 77 posts msg #103318  Ignore evo34 
11/12/2011 10:21:07 PM
Do you know of an example I can look at? It seems like the only parameter avail. in RSI is the number of days to use. E.g., RSI(14). Using the close price seems implied and not replaceable by a custom variable, unless I am missing a technique.

evo34 77 posts msg #103319  Ignore evo34 
11/12/2011 10:22:50 PM
Oh, I just reread your post. You are saying I would have to generate the calculation of RSI manually within the filter, right?

Kevin_in_GA 4,542 posts msg #103322  Ignore Kevin_in_GA modified 
11/13/2011 12:18:04 AM
Yup. It is doable, though.
Calculation
RSI = 100  (100 / 1 + RS)
RS = Average Gain / Average Loss
To simplify the calculation explanation, RSI has been broken down into its basic components: RS, Average Gain and Average Loss. This RSI calculation is based on 14 periods, which is the default suggested by Wilder in his book. Losses are expressed as positive values, not negative values.
The very first calculations for average gain and average loss are simple 14 period averages.
•
First Average Gain = Sum of Gains over the past 14 periods / 14.
•
First Average Loss = Sum of Losses over the past 14 periods / 14
The second, and subsequent, calculations are based on the prior averages and the current gain loss:
•
Average Gain = [(previous Average Gain) x 13 + current Gain] / 14.
•
Average Loss = [(previous Average Loss) x 13 + current Loss] / 14.
