[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

Preston,

The formula you gave can be simplified as follows:

100-(100/(1+RS))=100*RS/(1+RS)=100*Z/Y/(1+Z/Y)=100*Z/(Z+Y).

Now, we can clearly see that under this simplified version, one can 
leave out the if condition for Y (since Z+Y>0).
What's more, since Z+Y is the total traded volume, one can write down:

tp:=14;
RapidRsiVol=100*SUM(v*(c>ref(c,-1),tp)/sum(v,tp)

(This one is taking in assumption that no days we'll have c=ref(c,-
1), anyway small difference it'll do.)

The thing is however, that this will plot as easily can see the 
fraction of traded volume for the up-days without taking in 
consideration if they were in a row, as Fernardo wished it to be.

In the formula i presented, what is actually plotted is the sum of 
volume for those days that we had c>ref(c,-1) in a row.
As an example, let's say we have 3 days in a row where prices went 
up. This formula will sum the volume for these 3 particular trading 
days. But, if tomorrow price goes down, the formula will return a 
zero.
Again, if i got correctly what was asked from the beginning.

Regards,

mc

--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxx> wrote:
>
> 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@> 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/