Australian (ASX) Stock Market Forum

Amibroker Question: Buy 5 days after Buy Signal if price is higher

Joined
26 February 2013
Posts
4
Reactions
0
Hi guys,

I am new to Amibroker, so pardon me if this question is stupid :)

I would like to implement a system which enter long in a stock 5 days after a simple moving average cross-over only if the closing price that day is higher than the closing price of the day of the cross-over.

I can handle the simple part :

FastMA = MA (C, FastMALenght);
SlowMA = MA (C, SlowMALenght);

// BUY SETUP
BUYSetUP1 = Cross(FastMA,SlowMA);

// Execute
Buy = BUYSetUP1;

Any suggestion on how could I implement the trick for the check of the price after 5 days?

Thanks for the help.

Br
Davide
 
Hi guys,

I am new to Amibroker, so pardon me if this question is stupid :)

I would like to implement a system which enter long in a stock 5 days after a simple moving average cross-over only if the closing price that day is higher than the closing price of the day of the cross-over.

I can handle the simple part :

FastMA = MA (C, FastMALenght);
SlowMA = MA (C, SlowMALenght);

// BUY SETUP
BUYSetUP1 = Cross(FastMA,SlowMA);

// Execute
Buy = BUYSetUP1;

Any suggestion on how could I implement the trick for the check of the price after 5 days?

Thanks for the help.

Br
Davide

See if this works:-

Code:
// BUY SETUP
BUYSetUP1 = Ref(Cross(FastMA,SlowMA),-5) AND
Cross(H,Ref(H,-5));
 
Top