Skip to main content

TRIX system base for Amibroker (AFL)

mrugen over 16 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    oscillator, trading system, amibroker

TRIX system base. This is a trading system based on trix.

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("TRIX system base");
function Trix2( array, period )
{
tmp = EMA( EMA( EMA( array, period ), period ), period );
result = (tmp - Ref( tmp , -1 ))/Ref( tmp, -1 ) ;
return result;
}
 
pertrix = Param("period Trix", 8, 0, 100,1);
persig = Param("period signal", 3, 0, 100,1);

Trixline = Trix2( (O+C)/2, pertrix );
TrixSignal = EMA( Trixline, persig);

 
Plot( Trixline, "TRIX(5)", colorRed );
Plot( TrixSignal, "EMA(TRIX,3)", colorBlue );
 
GoldenCross = Cross( TrixLine, TrixSignal );
TrixFall = Trixline < Ref( Trixline, -1 ) AND Ref( Trixline, -1 ) > Ref( Trixline, -2 );
 
Buy = GoldenCross;
Sell = TrixFall;

Short=Sell;
Cover=Buy;

shape = Buy * shapeUpTriangle + Sell * shapeDownTriangle;


PlotShapes( shape, IIf( Buy, colorLime, colorOrange ), 0,IIf( Buy, Ref(Trixline,-1)*0.9, Ref(Trixline,-1)*1.05)  );


Plot( Flip( Buy, Sell ), "Trade", colorLightGrey, styleArea | styleOwnScale, 0, 1 );
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.