Have a look at SetForeign/RestorePriceArrays:
http://www.amibroker.com/guide/afl/afl_view.php?id=247
e.g.
XofA = ...
SetForeign("B");
XofB = ...
RestorePriceArrays();
Buy = ... AND XofA > XofB;
Mike
--- In [email protected], "jocinet" <joci...@...> wrote:
>
> Hi!
>
>
> I have two tickers (A and B) on which I want to make an intraday backtest on
> 5-minute data.
> I have a custom indicator named x.
> At a given time the custom indicator's value for ticker A is 50 'x(A)=50' and
> for ticker B is 61 'x(B)=61'.
>
> I needed an array in which I could store the values of MAX(x(A),x(B)) for
> each intraday time-segment as I want to use the elements of this array as a
> condition for a buy signal to become valid.
>
> I get buy signals through another logic and if I get a buy signal for ticker
> A I want to buy only if ticker A has the greater x. So if I get
> a buy signal on A but x(A) is smaller than x(B) then I would completely
> ignore the buy signal on ticker A.
>
> How may I do that? The difficulty I face is that I am not aware of the
> techniques referencing values of custom indicators for other tickers in
> Amibroker. As I only want to take the buy signal of A as valid if
> x(A) is the greatest between the tickers this may not be solved with
> PositionScore function either.
>
> Is it possible to do that at high-level?
>
>
> Thanks for your help in advance.
>
>
> Leslie
>