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

Re: Back references and functions


  • To: William Brower <1000mileman@xxxxxxxxxxxxxx>
  • Subject: Re: Back references and functions
  • From: "Terry B. Rhodes" <trhodes3@xxxxxxxxx>
  • Date: Wed, 18 Apr 2001 10:42:49 -0700
  • In-reply-to: <200104131607.JAA13261@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

Hi,

You are right, the 2 different calls give different results. This
is because the code uses an exponential moving average and the 2
different calls start calculating on different bars;
RSI(C[10],14) gives results 10 bars before RSI(C,14)[10]. The
difference in this case seems acceptable to me, but who knows
what issues lurk in other functions.

So I agree that back references should always be placed outside
the arguments of the function call.

regards,

tbr

William Brower wrote:
> 
> You can try something like this.  Create an indicator that computes the 14
> period RSI of 10 bars ago.  The two ways of doing this are to put the [10]
> inside the function or outside the function.  If they were the same the
> difference should be zero.  Plot the following code in an indicator and
> look at the results in the debug window.  You will see that early on, the
> difference is not zero but gets smaller over time.  If you use TS4.0, you
> cannot use the Cleardebug function.
> 
> if barnumber = 1 then cleardebug;
> Print( d:6:0, RSI(C[10],14) -  RSI(C,14)[10]:5:5);
> 
> At 05:10 PM 4/14/01 -0700, you wrote:
> >Could you please name a function that doesn't work using the
> >first method.
> >
> >thanks,
> >
> >tbr
> >
> >William Brower wrote:
> > >
> > > Actually, both methods work, however you will find that some functions
> > > return incorrect results when the [10] is placed inside the function.  To
> > > insure correct results all the time, place the [10] outside the user
> > function.
> > >
> > > At 04:35 PM 4/13/01 -0700, you wrote:
> > > >Hi,
> > > >
> > > >I believe either
> > > >
> > > >         Highest(H[10], 5)
> > > >
> > > >or
> > > >
> > > >         Highest(H, 5)[10]
> > > >
> > > >will work.  The first is better in that it doesn't create a
> > > >series for the highest() function.
> > > >
> > > >regards,
> > > >
> > > >tbr
> > > >
> > > > >
> > > > > What is the ELA code for the highest high for the 5 minute range
> > ending 10
> > > > > minutes ago?  i.e.
> > > > >
> > > > > maxlist(h[5],h[6],h[7],h[8],h[9])
> > > > >
> > > > > or how about
> > > > >
> > > > > MaxList (h,5[10])   ???????
> > > > >
> > >
> > > Bill Brower
> > > Email: 1000mileman@xxxxxxxxxxxxxx
> > > Web Site: insideedge.net
> 
> Bill Brower
> Email: 1000mileman@xxxxxxxxxxxxxx
> Web Site: insideedge.net