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

Re: Signal Limitations - Stuck



PureBytes Links

Trading Reference Links

It is hard to understand your questions. In addition, you keyboard is
making some characters that appear as the letter "n" with a tilde
over it at very strange places.

>Let me try to clarify my question:
>
>For example: 
>
>In order to get a buy signal an indicator must retrace
>to a buy level and the market must also retrace to an
>defined level.  If these events happen Condition1 =
>true.  If Cond1 = true then Öcontinue code.
>
>?:  Will MBB require enough bars for a Condition like
>this to be true?

There is no way to answer this without looking at the code. MBB
errors occur if you try to look back further than the MBB setting. If
the setting is at 50 and if at any point in the code running on your
data, you try to look back more than 50 bars, you get the error. It
is as simple as that.

This is because TradeStation keeps in a buffer the past 50 values of
each variable you refer to back in time. If you set the MBB at 50 and
then try to refer back 60 bars, you get the error because there is no
data saved for the value you asked for.


>In other words if this event is not true until bar
>number 300 ñ Does MBB have to be set to 300?
>
>(My guess is no but I get so many MBB errors I am
>trying to get to the root of them)

It has nothing to do with when some condition is true. All that
matters is how far back you reference.

>Question2 ñ Would appreciate any input re: the
>following MBB error messages:
>
>At an entry I assign a value (that returns a BN) from
>the current signal to Value30.  I need to do this
>because Value 10 will change and I need the current
>value for an exit.
>
>If  BarsSinceEntry = 0 AND MP <> 0 then begin
>	Value30 = Value10;
>End;

This is fine because it does not refer back in time.

>{Then continue to update it for the correct BarsBack
>each bar by using the following statement ñ outside
>the loop}
>
>If I put this statement in alone, it produces a MBB
>error:
>
>Value31 = Currentbar ñ Value30;

Try this:

CB = CurrentBar;
Value31 = CB ? Value30

(The ? in the above refers to the character ñ)

>
>If I put the statement within this loop then this
>statement does not produce a MBB error:
>
>If MP <> 0 then begin
>Value31 = Currentbar ñ Value30;
>End;
>
>Any clue why? 

This will give you a different value for Value31. You probably have
some later statement that includes using Value31 as a look back
parameter:

vxxx = variable[Value31];

and Value31 at that point exceeds the MBB setting.

Please try to debug it with print statements. There is no way to
solve these things without watching the code run.

Bob Fulks