Skip to main content

Trend Score for Amibroker (AFL)

haifx over 13 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 3)
  • Tags:
    trading system, amibroker

The strength of the trend. Code created by vole_00 srsc.

Indicator / Formula

Copy & Paste Friendly
CTS=IIf(C>=Ref(C,-5),1,-1)+
 IIf(C>=Ref(C,-6),1,-1)+
 IIf(C>=Ref(C,-7),1,-1)+
 IIf(C>=Ref(C,-8),1,-1)+
 IIf(C>=Ref(C,-9),1,-1)+
 IIf(C>=Ref(C,-10),1,-1)+
 IIf(C>=Ref(C,-11),1,-1)+
 IIf(C>=Ref(C,-12),1,-1)+
 IIf(C>=Ref(C,-13),1,-1)+
 IIf(C>=Ref(C,-14),1,-1);



 Plot(CTS, "CTS", colorBlack, styleLine ); 

 Plot(12,"",colorRed,styleLine);
 Plot(0,"",colorBlue,styleLine);
 Plot(-12,"",colorRed,styleLine);

 EntryLong = CTS>=5 AND Ref(CTS,-1)<5;
 ExitLong = CTS<0;

 Buy = EntryLong;
 Sell = ExitLong;

 PlotShapes(IIf(Buy ==1, shapeUpArrow , shapeNone), colorGreen, 0,CTS, Offset=-15);
 PlotShapes(IIf(Sell ==1, shapeDownArrow, shapeNone), colorRed, 0,CTS, Offset=-15);

6 comments

5. Divyesh
over 13 years ago

@haifx,
Can we make some modification like this….?

‘ExitLong=CTS<=5 AND Ref(CTS,-1)>5;
Buy = EntryLong;
Sell = ExitLong;
Buy=ExRem(EntryLong,ExitLong);
Sell=ExRem(ExitLong,EntryLong);’

this is queat batter for Daily TF…..

anandst,Vishwanath sir,
Sir what is your opinion for Daily TF…?

Leave Comment

Please login here to leave a comment.