1

I am replicating some code that I wrote in C# in AmiBroker (I'm new to AFL). This code triggers the Longs, but never fires a short. The price data has plenty of shorts (proved by C# code). What am I missing? Shorts are essentially the reverse of Longs.

Buy =   EMA(  Close , 60 ) > Ref( EMA(  Close , 60 ) , -2 )
AND ref(Close, -2) < Ref( EMA(  Close , 15 ) , -2 )
AND Ref(Close, -1) > Ref( EMA(  Close , 15 ) , -1 )
AND Close > EMA(  Close , 15 ) 
AND Close > Open;

Sell =  Close < EMA(  Close , 15 );

Short = EMA(  Close , 60 ) < Ref( EMA(  Close , 60 ) , -2 )
AND Ref( Close, -2 ) > Ref( EMA(  Close , 15 ) , -2 )
AND Ref( Close, -1 ) < Ref( EMA(  Close , 15 ) , -1 )
AND Close < EMA(  Close , 15 ) 
AND Close < Open;

Cover = Close > EMA(  Close , 15 );
RenniePet
  • 11,420
  • 7
  • 80
  • 106
Dave Tapson
  • 810
  • 1
  • 9
  • 22
  • 1
    What's AmiBroker? What's AFL? You might get some more answers if you explained what this is all about, and what it has to do with C# programming. – RenniePet Sep 11 '14 at 09:46
  • It's not C# but I don't have sufficient rep to create new tags. AmiBroker folk will know what it is all about. :) – Dave Tapson Sep 11 '14 at 11:44
  • Did a search for AmiBroker, and these are some of the tags typically used on questions about that. So you don't get frustrated C# programmers showing up here. – RenniePet Sep 11 '14 at 11:57

1 Answers1

1

D'oh! The properties of the analyser were set to fire Longs only! I set it to Longs and Shorts and all is well.

Dave Tapson
  • 810
  • 1
  • 9
  • 22