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

Re: needing help and advice on maxbarsback


  • To: omega-list@xxxxxxxxxx
  • Subject: Re: needing help and advice on maxbarsback
  • From: "Terry B. Rhodes" <trhodes3@xxxxxxxxx>
  • Date: Thu, 5 Apr 2001 14:32:12 -0700
  • In-reply-to: <200104041634.JAA20784@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

Hi All,

> >I have a great number of studies that deliver data to other programs
> >using fileappends. When doing this, it seems that a maxbarsback
> >setting of auto makes the data a little less reliable, and also must
> >cause a lot of calculation overhead. (My belief is that a maxbarsback
> >of auto just means Tradestation first tries with a low number, when
> >it hits a problem with that number it increases maxbarsback and then
> >tries again). This is correct? Anyone know the algorithm for how it
> >increases maxbarsback?
>

If you set your study to auto, TS2000 will start calculation
using an initial guess as to the proper value for MaxBarsBack. I
do not know exactly how the guess is made, but the initial value
certainly does not default to 50 bars as others suggested. Each
time the study tries to reference a bar further back than the
current MaxBarsBack TS resets MaxBarsBack to that value and
recalculates the study over again from the beginning.

For example, if you set MaxBarsBack to auto then run the
following code you should get lots and lots of output as TS
resets MaxBarsBack and recalculates the study over and over. The
number of bars between each date printed is the amount
MaxBarsBack was incremented.
 
     for j = 1 to 1000 begin
        if (C[j] = C[j] and currentbar = 1) then begin
           print(numtostr(date,0) ", " + numtostr(time,0)); 
     end;

If you user define MaxBarsBack to 1005 the study should only
print one line.

Using auto in such a situation does waste time. I have written
studies that run 30X faster with MaxBarsBack set.

> 
> >Now, when I am planning to change this setting, I am afraid of
> >causing errors that I do not have today.

As the output from the example shows, each time MaxBarsBack is
reset, calculation begins with a later date. If your calculations
for each bar are independent of this, then the output for each
bar should be identical. If the bar calculation begins on does
effect the calculation of later bars, then the output for each
bar will differ. Which output is correct will depend on what you
are trying to do.

> 
> >The manual recommends to always set it to at least 50. Why? I can not
> >see any good reason?
> 

This is probably a guess based on the tradeoff between the time
it takes to recalc when MaxBarsBack is reset and the time it
takes to load more bars than needed. The proper thing to do is
figure out the correct value and use it, or else just use Auto.

> 
> >If using the workchart assistant for scanning a lot of stocks and
> >having a maxbarsback setting that is too low, will I ever get an
> >error message telling me if maxbarsback is too low? Or will I just
> >have a number of indicators that did not deliver data for some
> >stocks? Or was even turned off? Anyone could give me some hints on
> >this?
> 

I'm pretty sure that, when you get an error in a study while
doing a scan, you just don't get values for that symbol, but I
don't remember for sure.

regards,

tbr