PureBytes Links
Trading Reference Links
|
At 10:12 AM 8/31/01 -0400, you wrote:
>I have a system that enters and exits depending on crossover
>of two moving averages. Why is it that if I specify mov1 > mov2
>it gives me one set of trades and if I do cross(mo1, mov2)
>it's something else?
mov1 > mov2: returns a binary hi (1) as long as mov1 is above mov2 and a lo
(0) when mov1 is below mov2.
cross(mov1,mov2): returns a binary one (1) only at the time when mov1
crosses above mov2, and a zero (0) at all other times.
To see how this works make and plot this indicator:
T1:=mov(C,10,E);
T2:=mov(C,20,E);
T1>T2;
cross(T1,T2);
For debugging purposes I often multiply and offset binary values to bring
them in range with the price chart so that you can better see the lo and
highs. Like so:
T1:=mov(C,10,E);T1;
T2:=mov(C,20,E);T2;
(T1>T2)*10;
(cross(T1,T2))*10-10;
(cross(T2,T1))*10-20;
Good luck,
Herman
>
>
>
>
|