So, the code would be:

MA1 = MA(C,20);
MA2 = MA(MA1,5);

BuySignal1 = Cross(MA1,MA2);
// that's a cross of the moving average over
// the average of the average - reverse it to
// Cross(MA2,MA1) to detect the oppposite

--- In [email protected], "reydontrader" <[EMAIL PROTECTED]> wrote:
>
> not exactly.
> 
> 
> I'll have 2 moving averages:
> first:  20 period SMA by using closing price:
> MA1(Close,20)
> 
> second: 5 period SMA by using value from the 20 period SMA
> MA2( MA1(Close,20), 5)
> 
> thanks.
> 
> 
> 
> --- In [email protected], "droskill" <droskill@> wrote:
> >
> > Are you saying that the crossover should be the 20sma over the 5sma?
> > 
> > Assuming this is the case, you need to write an Exploration. 
> > Something like this:
> > 
> > BuySignal1 = Cross(MA(C,20),MA(C,5));
> > BuySignal2 = C > MA(C,20);
> > 
> > Filter = Status("lastbarinrange") AND BuySignal1 AND BuySignal2;
> > AddColumn( C, "Close");
> > 
> > 
> > --- In [email protected], "reydontrader" <marketblog@> 
> wrote:
> > >
> > > Hi,
> > > 
> > > I'm new to amibroker and try to use simple technique to scan 
> stocks 
> > > fit my requirements.
> > > 
> > > If anyone can help me I'll be grateful:
> > > 1) The price shall close above 20SMA
> > > 2) The should be following crossover:
> > > 20 SMA line (based on closing price) shall close above 5 SMA line 
> ( 
> > > based on 20SMA price).
> > > 
> > > SMA is Simple Moving Average
> > > 
> > > thanks,
> > > 
> > > Rey
> > >
> >
>


Reply via email to