logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Lordvader  
#1 Posted : Saturday, June 30, 2007 6:16:02 AM(UTC)
Lordvader

Rank: Member

Groups: Registered, Registered Users
Joined: 9/13/2006(UTC)
Posts: 24

Hi guys!

I would like to calculate the exact stocks closing price, if RSI(14) Crosses from up and below, the 70 line. I've tried Valuewhen, but it works only with past events. Am I right?

Can you help me with this formula?

Thanks

Regards

wblam  
#2 Posted : Saturday, June 30, 2007 6:29:20 AM(UTC)
wblam

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/25/2006(UTC)
Posts: 79

Hi Lordvader,

Do you mean how much today colsing price (now the market not yet colse) will cause today RSI cosses the 70 line?

Lordvader  
#3 Posted : Saturday, June 30, 2007 7:26:03 AM(UTC)
Lordvader

Rank: Member

Groups: Registered, Registered Users
Joined: 9/13/2006(UTC)
Posts: 24

Yes Wblam, That's It!

Could you help?

Thanks a lot

wblam  
#4 Posted : Saturday, June 30, 2007 9:42:04 AM(UTC)
wblam

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/25/2006(UTC)
Posts: 79

Let a = average increase in the past 14 days, and

b = average decrease in the past 14 days.

RSI(14)= a/(a +b) *100 =70.

need to solve the above equation.

Please give me some time. If I solve it, I will post back.

Lordvader  
#5 Posted : Saturday, June 30, 2007 11:16:58 AM(UTC)
Lordvader

Rank: Member

Groups: Registered, Registered Users
Joined: 9/13/2006(UTC)
Posts: 24

ok!

I read about, that this function is known as RevEngRSI.

Regards

wblam  
#6 Posted : Saturday, June 30, 2007 11:22:27 PM(UTC)
wblam

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/25/2006(UTC)
Posts: 79

Hi Lordvader,

Since I do not have MS pro ver. I change the question to:

What tomorrow closing price will cause tomorrow RSI crosses the 70 line?

My solution is as follow:

Let u=average increase in the past 14 days including today using Wilder's smoothing method.

d=average decrease in the past 14 days including today using Wilder's smoothing method.

Case 1: Today RSI<70,

Tomorrow to cross 70, price must increase. If tomorrow price increase,

tomorrow 14-day average increase = (14-1)/14*u + 1/14*(c1 - c0)

{c1=tomorrow close, c0=today close}

tomorrow 14-day average decrease= (14-1)/14*d

Tomorrow RSI = ((14-1)/14*u + 1/14*(c1 - c0))/((14-1)/14*u + 1/14*(c1 - c0)+(14-1)/14*d)=70/100

rearrange we have:

c1=((14-1)*(70/100-1)*u+70/100*(14-1)*d+(1-70/100)*c0)/(1-70/100)

Case 2: Today RSI>70,

Tomorrow to cross 70, price must decrease. If tomorrow price decrease,

tomorrow 14-day average increase = (14-1)/14*u

tomorrow 14-day average decrease= (14-1)/14*d + 1/14*(c0-c1)

Tomorrow RSI = ((14-1)/14*u )/((14-1)/14*u +(14-1)/14*d+ 1/14*(c0-c1))=70/100

rearrange we have:

c1=(14-1)*(1-100/70)*u+(14-1)*d+c0

My MS indicator code is as follow:

n:=Input("No. of periods",2,100,14);
y:=Input("RSI level to cross",1,99,70);
x:=y/100;
u:=Max(C-Ref(C,-1),0);
aveu:=Wilders(u,n);
d:=Max(Ref(C,-1)-C,0);
aved:=Wilders(d,n);
xabove:=((n-1)*(x-1)*aveu+(n-1)*x*aved+(1-x)*C)/(1-x);
xbelow:=(n-1)*(1-1/x)*aveu+(n-1)*aved+C;
plot:=If(RSI(C,n)<x,xabove,xbelow);
plot;

I solved this last night before sleep in a hurry and I am a beginner learner of indictor coding. You or any other members please help me to check the solution and coding.

drakula  
#7 Posted : Sunday, June 1, 2008 5:11:10 AM(UTC)
drakula

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 3/14/2008(UTC)
Posts: 2

Thanks.
This one was just what I was looking for. Seems to work fine.

Users browsing this topic
Guest (Hidden)
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.