I put together this
little AFL for trading,   being new to all this I took an older AFL and put in
the parameters that I wanted to use.  It runs and give me very nice results.  However
the Short side does not work well so I leave it out
 
This is a triple
crossover 4,9,18  and when they all align this is suppose to buy
There are two ways this
can work,   
1)     
to keep looses down when 4 crosses back it
is a sell
2)     
to keep the trade a little longer then
when 4 crosses 9 then 18 it is a sell
 
This is the code I am
running
Any feedback please would
be appreciated on how this works when you test it ( I back tested it numerous
times )  doing this for a short time I know that I must be missing things here. 
I am not even sure that it is written correctly just know that it runs and
gives me nice results
Thank you for any help or
guidance here
 
 
// MarkKeitel; Triple
Cross-Over Method, taken from John Murphy's Book
Range1=Optimize("range1",4,9,18,1);
Range2=Optimize("range2",4,9,18,1);
Plot( Close,
"Price", colorBlack, styleCandle ); 
Plot(EMA( Close,range1),
"4d-ema", colorRed );  
Buy =
Cross((Close),(EMA(Close,range1))); 
Buystop =
Ref(EMA(Close,range1),-1); 
BuyPrice =
Max(Buystop,Low); 
Sell =
Cross(EMA(Close,range2),(Close)); 
Sellstop =
Ref(EMA(Close,range1),-1); 
SellPrice = Min(sellstop,High);
Short = Sell; 
Cover = Buy;