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

Re: Need Help re: Signal Limitations - Stuck



PureBytes Links

Trading Reference Links

It sounds as though the lookback interval is determined dynamically
from the data. Unfortunately, TradeStation seems to determine the
maximum lookback distance on any bar and forces the MaxBarsBack to at
least that value, even if the long lookback only occurs on the last
bar on the chart.

You might try putting the code into an indicator set for Autodetect
for the MaxBarsBack setting and add Print statements to trace what is
going on. Something like:

   MBB = MaxBarsBack;
   if MBB <> MBB[1] then Print(Date:7:0, Time:5:0, MBB:5:0);

With Autodetect, the code is run with a MaxBarsBack setting of 1 to
determine what value is needed then it is set to that value, then run
a second time. If your lookback intervals are determined dynamically
from the data, it may have to make several tries to find the correct
value so you get a series of values in the print-log as it runs
several time to find the value. You can intersperse other print
statements in the code to determine where you are in your code when
it finds the need to reset the MaxBarsBack interval. Tedious but it
usually works...

You can then add checks to limit the lookback to some limit.

Alternately, you can store the prices you use in an array and refer
to them there.

Without looking at the code, this is just guessing, however.

Bob Fulks


At 10:49 PM -0700 8/21/01, D Wear wrote:

>I am totally confused and am writing to you as a last
>resort as I have tried to sort this problem out myself
>but am still very Stuck.  Using TS2000.
>
>I have a very strange MBB situation:
>
>I have written a strategy that incorporates some
>functions which identify very simple conditions for
>certain bars.  The inputs for these functions are
>simple Moving averages or lookback periods for a prior
>low/ high from a given BarNumber.  The functions have
>been thoroughly tested and work as indicators. 
>The largest input I use in the functions is 35. 
>
>In the signal I run a series of screens on these bars
>that are identified in the function..  One screen
>looks back for a prior low/high for a maximum of 10
>bars. 
>Now to the problem:
>
>The strategy works correctly giving buy and sell
>signals on a chart.  However it only works within very
>limited parameters:
>These parameters seem to be somewhat dependent on the
>stock/future I have up on the chart as I have fiddled
>with different MBB levels and there is no constant.  I
>initialize the variables at the beginning of the code,
>and have tried several different options of code to
>try to resolve the problem.
>Typically, I can only have about 1.5 years of daily
>data and it wonít work with anything less than 200
>bars MBB.  If I add more bars (only a year or so),
>sometimes, it will work if I increase the MBB to a
>much higher level.
>
>This confuses me as my largest input is 35 and there
>are no exponential or complicated formulas used.  I
>have tried turning off the screens in the signal, etc.
>but it doesnít help. 
>Because the signal will work correctly when tested
>under these confining parameters I am very confused.
>If there was a coding problem I would guess it
>wouldnít work at all.  I can apply it to any chart
>with these limitations.
>
>Hardware wise:  My PC is a PII 450 with 256 mb of Ram.
> I have gotten sporadic Virtual memory warnings and
>the CPU usage is often at 100%.  I am not opposed at
>changing my system if that is what will work. 
>
>If anyone can offer some help or steer me in the right
>direction that would be great.  I am literally out of
>ideas. 
>
>Sincerely, 
>
>Debbie Wear