Cross EMA long short system

#1
I am looking for a formula :

I would like to go long when :

the 5 day EMA cross the 8 day EMA but only if the cross between the two EMA is above the 20 day EMA and close it when the 5 cross below th 8 EMA and above the 20 day EMA

Go short when

the 5 day EMA cross the 8 day EMA but only if the cross between the two EMA is below the 20 day EMA and cover it when the 5 cross above the 8 EMA and below the 20 day EMA

My problem is not for the cross but how to write above or below another EMA

thank you for your help
 
#2
I am looking for a formula :

I would like to go long when :

the 5 day EMA cross the 8 day EMA but only if the cross between the two EMA is above the 20 day EMA and close it when the 5 cross below th 8 EMA and above the 20 day EMA

Go short when

the 5 day EMA cross the 8 day EMA but only if the cross between the two EMA is below the 20 day EMA and cover it when the 5 cross above the 8 EMA and below the 20 day EMA

My problem is not for the cross but how to write above or below another EMA

thank you for your help
this formula is difficult to write in any software but it is very easy to put it in iris software of spider. not even this any type of formula is very easy affair in this software.
 
#3
I am looking for a formula :

I would like to go long when :

the 5 day EMA cross the 8 day EMA but only if the cross between the two EMA is above the 20 day EMA and close it when the 5 cross below th 8 EMA and above the 20 day EMA

Go short when

the 5 day EMA cross the 8 day EMA but only if the cross between the two EMA is below the 20 day EMA and cover it when the 5 cross above the 8 EMA and below the 20 day EMA

My problem is not for the cross but how to write above or below another EMA

thank you for your help
I can give this code for Metastock. Do you want?
 

rkkarnani

Well-Known Member
#7
Not an expert but feel can be done in Metastock!!!

Try something like this for say going Long :
a:=Mov(C,5,E);
b:=Mov(C,8,E);
bb:=Mov(C,20,E);
a >b AND b>bb AND
Cross((Mov(C,5,E)),((Mov( C,8,E))))
What I have tried to write is that both 8 EMA and 5 are above 20 and 5 EMA Crosses 8 EMA!! Make it in an expert and draw the EMA lines and check if it is working.
Praying that it works.... ;-)
 

veluri1967

Well-Known Member
#8
Try this AFL on Amibroker

D1=Cross( EMA( Close, 5 ), EMA( Close, 8 ));
D2=Close > EMA(Close, 20);
D3=Close < EMA(Close, 20);
D4=Cross (EMA (Close, 8), EMA (Close, 5));
Buy = D1 AND D2;
Sell=D4 AND D3;
Short=D4 AND D2;
Cover= D1 AND D3;
Thick Green Arrow indicates BUY
Hallow Red Arrow indicates SELL
Thick Red Arrow indicates SHORT
Hallow Green Arrow indicates COVER.
 

Similar threads