[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Problem with BarsSince and Sum



PureBytes Links

Trading Reference Links

Fernando,

Let's take a look at the Rapid RSI which is a none smoothed version. 
Here it is:

Name: Rapid RSI
Formula:
tp:= 14; { time periods in RSI calculation}
plot:= C;
change:= ROC(plot,1,$);
Z:=Sum(If(change>0,change,0),tp);
Y:=Sum(If(change<0,Abs(change),0),tp);
Ytemp:=If(y=0,0.00001,y);
RS:=Z/Ytemp;
100-(100/(1+RS))


In order to make the changes you want it would look like this:

Name: Rapid RSI Vol
Formula:
tp:= 14; { time periods in RSI calculation}
plot:= C;
change:= ROC(plot,1,$);
Z:=Sum(If(change>0,Volume,0),tp);
Y:=Sum(If(change<0,Abs(Volume),0),tp);
Ytemp:=If(y=0,0.00001,y);
RS:=Z/Ytemp;
100-(100/(1+RS))

Notice that the Z and Y variables are the sums you are looking for. Z 
variable is positive and Y variable is negative. In the case of the 
RSI it is then indexed.

Hope this helps.

Preston

 


--- In equismetastock@xxxxxxxxxxxxxxx, "Fernando Santos" 
<ptc_man3@xxx> wrote:
>
> Which RSI pumrysh?
> 
> I found this two formulas:
> 
> Q:=Input("Time Periods",1,1000,14); 
> 
> B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1);
> 
> Z:=If(B=1,Wilders(If(ROC(C,1,$)>0,ROC(C,1,$),0),LastValue(Q)),If
> (B=2,Wilders(If(ROC(O,1,$)>
> 0,ROC(O,1,$),0)LastValue(Q)),If(B=3,Wilders(If(ROC(H,1,$)>0,ROC
> (H,1,$),0),LastValue(Q)),
> If(B=4,Wilders(If(ROC(L,1,$)>0,ROC (L,1,$),0),LastValue(Q)),Wilders
(If
> (ROC(V,1,$)>0
> ,ROC(V,1,$),0),LastValue(Q))))));
> 
> Y:=If(B=1,Wilders(If(ROC(C,1,$)<0,Abs(ROC(C,1,$)),0),LastValue
(Q)),If
> (B=2,Wilders(If(ROC
> (O,1,$) <0,Abs(ROC(O,1,$)),0),LastValue(Q)),If(B=3,Wilders(If(ROC
> (H,1,$)<0,Abs
> (ROC(H,1,$)),0),LastValue(Q)),If(B=4,Wilders(If(ROC(L,1,$)0,Abs(ROC
> (L,1,$)),0),LastValue(Q))
> ,Wilders(If(ROC(V,1, $)<0,Abs(ROC(V,1,$)),0),LastValue(Q))))));
> 
> RS:=Z/Y;
> 
> 100-(100/(1+RS))
> 
> 
> And this one:
> 
> 100 - 100/
> (1.+ If(Mov(If(P-Ref(P,-1)<0,-(P-Ref(P,-1)),0),23,E)=0,1000000,Mov
(If
> (P-Ref(P,-1)>0, P-Ref(P,-1), 0),23,E) /Mov(If(P-Ref(P,-1)<0,-(P-Ref
> (P,-1)),0),23,E)))
> 
> Maybe is the late hour that I'm writing this message but I didn't 
> understand your explanation
> 
> regards
> 
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@> wrote:
> >
> > Fernando,
> > 
> > Take a look at the RSI formula.
> > Basically does what you want. To apply it to your situation you 
> will 
> > need to change to the sum of the volume instead of the close but 
> > everything else would be the same.
> > 
> > Preston
> > 
> > --- In equismetastock@xxxxxxxxxxxxxxx, "Fernando Santos" 
> > <ptc_man3@> wrote:
> > >
> > > Hi.
> > > 
> > > I'm having some problems with the Sum() and BarsSince()function.
> > > 
> > > What I want is to Sum the volume if and only when c>ref(c,-1) 
but 
> > by
> > > the numbers of bars of that variable.
> > > 
> > > Let me explain better, imagine that during this month, the 
close 
> > was
> > > higher then the previous days close 12 times.
> > > 
> > > How can I say that I want to sum the volume for those 12 
specific 
> > days
> > > when I need to know the time periods for the sum function?
> > > 
> > > Using barsince() doesn't seem to work since Sum() doesn't 
> recognize
> > > the barssince() result as time periods.
> > > 
> > > Any ideas?
> > > 
> > > Thanks
> > >
> >
>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/