PureBytes Links
Trading Reference Links
|
> In any case, if I have a block that starts 'if x=4', and x=0, the
> block should NOT execute. Is this not correct?
Ah, but remember you're talking about "Easy" Language here...
I can't say for certain since I don't use TS100. But in TS4 you have
Series and Simple functions. Simple functions are called only when
YOU call them, like a normal function in a normal language. But for
Series functions to work right, with the proper history &etc, they
have to be called on EVERY bar -- even if YOU don't call them
yourself. The Series functions are "pulled out" and called *before*
the rest of the code executes, if I remember right, and then if you
actual execute the code that "calls" the function, that code just
references the function return value.
Or something like that. I'm a little hazy on the details.
My guess is, StandardError is a Series function, and when X=0 the
parameters to StandardError are such that StandardError barfs.
How to work around this? It's grubby since you can't just say "if
the params are bad, don't call the function" -- because EL calls it
anyway. You could try modifying the params to StandardError so it
never passes invalid parameters -- maybe some hack like:
if x = 4 then begin
(stuff)
if (dangerous parameters) then begin
SEparam1 = SaveVal1;
SEparam2 = SafeVal2;
SEparam3 = SafeVal3;
end
else begin
SEparam1 = RealVal1;
SEparam2 = RealVal2;
SEparam3 = RealVal3;
end;
b = StandardError(SEparam1, SEparam2, SEparam3);
(more stuff)
end;
Gary
|