To: The Jedi who wrote (3 ) 2/2/1998 9:32:00 PM From: TechTrader42 Read Replies (1) | Respond to of 85
QP2'ers: After finding that RSI values in the QP charts data window and my QP scans weren't quite the same, I've been trying to formulate RSI for QP, with little luck. I've been working with two basic formulas for RSI, which turn out to give the same results (though they look different): This one is from TASC: RSI = 100(Su/(Su+Sd)) where Su is the sum of prices on down days and Sd is the sum of prices on up days. This one is from TA from A to Z, and works out to be the same thing: 100 minus (100 /(1+(U/D)) Where U is an average of upward price change and D is an average of downward price change. I arrived at some interesting (but useless) formulas that don't seem to give the right values. I started from Jeff's formula for Vidya, which uses upward and downward price change. (CMO is a variant of RSI). Here are two scans that I came up with, and anyone's welcome to try to fix them up (neither one returns values I'm happy with): output = "rsi.lst"; daystoload=300; issuetype=common; exchange nyse,nasdaq,amex; float updays, dndays, arsi; integer i; updays := 0; dndays := 0; // develop MAs of up and Down days for i = 0 to -13 step -1 do if close(i) > close(i-1) then updays := updays + (close(i) - close(i-1)); endif; if close(i) < close(i-1) then dndays := dndays + abs(close(i) - close(i-1)); endif; next i; if (updays+dndays) = 0 then updays := 0.0001; endif; //arsi:= (updays/(updays + dndays))*100; arsi:= 100-((100/(1+(updays/(dndays+.000001))))); println Symbol:-6,",", arsi,",", updays,",", dndays; ************* This next one works on the assumption that RSI is using more periods to calculate the average change in prices on up and down days: output = "rsi.lst"; daystoload=300; issuetype=common; exchange nyse,nasdaq,amex; float updays, dndays, arsi; integer i, d, start, j; start := 0; for d = start to 13 step 1 do updays := 0; dndays := 0; // develop MAs of up and Down days for j = 0 to -13 step -1 do i := j-d; if close(i) > close(i-1) then updays := updays + (close(i)- close(i-1)); endif; if close(i) < close(i-1) then dndays := dndays + abs(close(i)- close(i-1)); endif; next j; next d; if (updays+dndays) = 0 then updays := 0.0001; endif; arsi:= (updays/(updays + dndays))*100; //this is equal to formula below, believe it or not //arsi:= 100-((100/(1+(updays/(dndays+.000001))))); println Symbol:-6,",", arsi;