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

Re: Signal Limitations - Stuck



PureBytes Links

Trading Reference Links

Thanks for your input to all who responded.  Sorry my
response isn’t more prompt but I’ve been away a few
days.

I have sorted out the initial MBB problem.  I found
the problem was in two areas:
1. I had the letter ‘0’ in place of the number zero in
one location.  (Sam Tennis’ advice to look for – one
of those “you idiot” mistakes.)
2. I found another problem which I successfully
recoded but still am not sure why it was causing a MBB
problem.  Found it by remming out sections to see
which one was causing the error (another Sam Tennis
tip – by the way this was the first time I had spoken
to him – he was very approachable and helpful to a
fairly newbie programmer like myself).

This 2nd problem was caused because I had a variable
Value10 which I assigned a function to.  This function
returns a barnumber if an event is true for a buy
signal.
At one point in the code I needed to negate that
signal if I entered a position from it – so if there
was an exit it would not re-enter the same signal
again.  I wanted to reset Value10 to zero.  When I
tried to do that I got a MBB error.  

This is how I got around it:  Used a No2nd trade
variable which is reset if there is a new function
value.

If No2ndTrade = 1 then Begin
	If Value10 <> Value10[1] then begin
		No2ndTrade = 0;
	end;
End;

Any idea why TS wouldn’t let me reset V10 to zero when
MP <> MP[1]?  

-------

Bob – A question for you – What do you mean by
dynamically determined?  

Does TS need to find a condition to be true before it
will start initializing trades?  And what happens if
you have a Lookback period of 10 for an event but it
doesn’t happen until BN 300?  Will you get a MBB error
if your MBB is set to 50?

Your suggestion to put the signal in an indicator is
an excellent one which I will use in the future.  


Thank you all for your input.  As to my system – 
Still getting out of memory / mem low messages - I do
need to upgrade – waiting for XP tho.

Debbie

--- Bob Fulks <bfulks@xxxxxxxxxxxx> wrote:
> 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
>